瀏覽代碼

init project

unknown 2 年之前
當前提交
63ccd58acc
共有 45 個文件被更改,包括 4968 次插入0 次删除
  1. 1 0
      .gitignore
  2. 3 0
      etc/1-同步点位.bat
  3. 3 0
      etc/1-导出点位.bat
  4. 3 0
      etc/1-手自动设定自动绑点.bat
  5. 50 0
      etc/使用说明.txt
  6. 199 0
      pom.xml
  7. 54 0
      src/main/java/com/pbsage/util/Config.java
  8. 97 0
      src/main/java/com/pbsage/util/Constant.java
  9. 566 0
      src/main/java/com/pbsage/util/FastJsonUtil.java
  10. 91 0
      src/main/java/com/pbsage/util/HttpUtil.java
  11. 65 0
      src/main/java/com/pbsage/util/JSONReaderUtil.java
  12. 85 0
      src/main/java/com/persagy/data_dict_tool/DataDictQueryUtil.java
  13. 158 0
      src/main/java/com/persagy/data_dict_tool/DataDictScanner.java
  14. 87 0
      src/main/java/com/persagy/data_dict_tool/DataDictToolMain.java
  15. 233 0
      src/main/java/com/persagy/data_dict_tool/v2/DataDictCheck.java
  16. 97 0
      src/main/java/com/persagy/data_dict_tool/v2/DataDictCount.java
  17. 471 0
      src/main/java/com/persagy/data_dict_tool/v2/DataDictExportAllPoint.java
  18. 89 0
      src/main/java/com/persagy/data_dict_tool/v2/DataDictPrintTree.java
  19. 43 0
      src/main/java/com/persagy/data_dict_tool/v2/DataDictQueryUtil_v2.java
  20. 352 0
      src/main/java/com/persagy/data_dict_tool/v2/DataDict_generate.java
  21. 184 0
      src/main/java/com/persagy/data_dict_tool/v2/DataDict_remove.java
  22. 5 0
      src/main/java/com/persagy/data_dict_tool/v2/IntWrapper.java
  23. 65 0
      src/main/java/com/persagy/data_dict_tool/v2/TagMain.java
  24. 14 0
      src/main/java/com/persagy/data_dict_tool/v2/ToolMain.java
  25. 85 0
      src/main/java/com/persagy/data_dict_tool/v2/UpdateInfo.java
  26. 173 0
      src/main/java/com/persagy/util/DataDictUtil.java
  27. 10 0
      src/main/java/com/persagy/util/ExcelSheet.java
  28. 316 0
      src/main/java/com/persagy/util/ExcelUtil.java
  29. 93 0
      src/main/java/com/persagy/util/FastJsonReaderUtil.java
  30. 566 0
      src/main/java/com/persagy/util/FastJsonUtil.java
  31. 8 0
      src/main/java/com/persagy/util/SequenceNo.java
  32. 227 0
      src/main/java/com/persagy/zkt_tool/ZKTAlarmMain.java
  33. 288 0
      src/main/java/com/persagy/zkt_tool/ZKTControlMain.java
  34. 9 0
      src/main/resources/config.xml
  35. 二進制
      src/main/resources/info_code-WD.xlsx
  36. 二進制
      src/main/resources/info_code-WD/6.18室外传感器.xlsx
  37. 二進制
      src/main/resources/info_code-XG.xlsx
  38. 二進制
      src/main/resources/info_code-XG/info_code-XG.xlsx
  39. 二進制
      src/main/resources/info_code-ZS.xlsx
  40. 二進制
      src/main/resources/info_code-all.xlsx
  41. 二進制
      src/main/resources/info_code-old.xlsx
  42. 二進制
      src/main/resources/info_code-system.xlsx
  43. 17 0
      src/main/resources/log4j.properties
  44. 139 0
      src/main/resources/scene-equipment-overview.json
  45. 22 0
      src/test/java/com/persagy/data_dict_tool/TestDict.java

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+/target/

+ 3 - 0
etc/1-同步点位.bat

@@ -0,0 +1,3 @@
+title 同步
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar export Pj4403070003 WD 5 15min -objType:equipment -classCode:ACATAH hbase -db:db_public
+pause

+ 3 - 0
etc/1-导出点位.bat

@@ -0,0 +1,3 @@
+title 导出点位到excel
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar export Pj4403070003 WD 5 15min
+pause

+ 3 - 0
etc/1-手自动设定自动绑点.bat

@@ -0,0 +1,3 @@
+title 手自动
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar generate Pj4403070003 WD update -file:info_code-WD.xlsx
+pause

+ 50 - 0
etc/使用说明.txt

@@ -0,0 +1,50 @@
+为对象的信息点自动生成表号功能号
+	generate		生成信息点指令
+	Pj4403070003	项目编码
+	WD				集团编码
+	print			打印待生成信息点,不写入数据库
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar generate Pj4403070003 WD print -file:info_code-WD.xlsx
+
+为对象的信息点自动生成表号功能号
+	generate		生成信息点指令
+	Pj4403070003	项目编码
+	WD				集团编码
+	print			打印待生成信息点,并写入数据库
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar generate Pj4403070003 WD update
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar generate Pj4403070003 WD update -file:info_code-WD.xlsx
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar generate Pj4403070003 WD update -file:info_code-WD.xlsx force
+
+
+
+为对象的信息点删除自动生成的表号功能号
+	remove			删除自动生成的信息点指令
+	Pj4403070003	项目编码
+	WD				集团编码
+	print			打印待生成信息点,不写入数据库
+	-all:true		是否全部点位,false只处理自动绑的点位
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar remove Pj4403070003 WD print -all:false
+
+为对象的信息点删除自动生成的表号功能号,生成
+	remove			删除自动生成的信息点指令
+	Pj4403070003	项目编码
+	WD				集团编码
+	print			打印待生成信息点,并写入数据库
+	-all:true		是否全部点位,false只处理自动绑的点位
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar remove Pj4403070003 WD update -all:false
+
+
+
+导出所有的表号功能号清单供模拟数据程序使用
+	export		导出指令
+	15			发送数据周期是15秒
+	15min		计算周期是15分钟
+	-all:true		是否全部点位,false只处理自动绑的点位
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar export Pj4403070003 WD 15 15min -all:false
+
+
+
+注意:
+info_code-WD.xlsx是所有需要处理的对象的信息点,其中WD是集团编码!
+
+java -jar data-dict-tool-0.0.1-SNAPSHOT.jar export Pj4403070003 WD 5 15min -objType:equipment -classCode:ACATAH hbase -db:db_public
+

+ 199 - 0
pom.xml

@@ -0,0 +1,199 @@
+<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.persagy</groupId>
+	<artifactId>data-dict-tool</artifactId>
+	<version>0.0.1-SNAPSHOT</version>
+	<packaging>jar</packaging>
+
+	<name>data-dict-tool</name>
+	<url>http://maven.apache.org</url>
+
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+	</properties>
+
+	<repositories>
+		<repository>
+			<id>SagaCloud</id>
+			<name>SagaCloud</name>
+			<url>http://47.93.33.207:8082/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>jdk.tools</groupId>
+			<artifactId>jdk.tools</artifactId>
+			<version>1.8</version>
+			<scope>system</scope>
+			<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
+		</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>org.apache.httpcomponents</groupId>
+			<artifactId>httpcore</artifactId>
+			<version>4.2.2</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>httpclient</artifactId>
+			<version>4.2.2</version>
+		</dependency>
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>fastjson</artifactId>
+			<version>1.2.70</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>1.2.17</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi</artifactId>
+			<version>3.9</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi-ooxml</artifactId>
+			<version>3.9</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<targetPath>${project.build.directory}/classes</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>
+					<excludes>
+						<exclude>*.properties</exclude>
+						<exclude>*.xml</exclude>
+						<exclude>*.json</exclude>
+					</excludes>
+					<archive>
+						<manifest>
+							<addClasspath>true</addClasspath>
+							<classpathPrefix></classpathPrefix>
+							<mainClass>com.persagy.data_dict_tool.v2.ToolMain</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>
+
+	<distributionManagement>
+		<repository>
+			<id>SagaCloudRelease</id>
+			<name>User Project Release</name>
+			<url>http://47.93.33.207:8082/repository/SagaCloudRelease/</url>
+		</repository>
+
+		<snapshotRepository>
+			<id>SagaCloudRelease</id>
+			<name>User Project SNAPSHOTS</name>
+			<url>http://47.93.33.207:8082/repository/SagaCloudSnapshot/</url>
+		</snapshotRepository>
+	</distributionManagement>
+
+</project>
+

+ 54 - 0
src/main/java/com/pbsage/util/Config.java

@@ -0,0 +1,54 @@
+package com.pbsage.util;
+
+import java.io.File;
+import java.net.URLDecoder;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+public class Config {
+	public static String json_file;
+	public static int thread_count_ini;
+	public static int thread_count_add;
+	public static int thread_count_max;
+	public static int loop_count;
+	public static long interval_loop;
+	public static long interval_step;
+	public static int job_count;
+
+	static {
+		try {
+			{
+				String filepathDatabase = Constant.GetPath() + "/config.xml";
+				SAXReader saxReader = new SAXReader();
+				File xmlFile = new File(URLDecoder.decode(filepathDatabase, "UTF-8"));
+				Document document = saxReader.read(xmlFile);
+				Element element;
+
+				element = (Element) document.selectSingleNode("/root/json_file");
+				json_file = element.getText();
+
+				element = (Element) document.selectSingleNode("/root/thread_count_ini");
+				thread_count_ini = Integer.parseInt(element.getText());
+				element = (Element) document.selectSingleNode("/root/thread_count_add");
+				thread_count_add = Integer.parseInt(element.getText());
+				element = (Element) document.selectSingleNode("/root/thread_count_max");
+				thread_count_max = Integer.parseInt(element.getText());
+
+				element = (Element) document.selectSingleNode("/root/loop_count");
+				loop_count = Integer.parseInt(element.getText());
+
+				element = (Element) document.selectSingleNode("/root/interval_loop");
+				interval_loop = Long.parseLong(element.getText());
+				element = (Element) document.selectSingleNode("/root/interval_step");
+				interval_step = Long.parseLong(element.getText());
+
+				element = (Element) document.selectSingleNode("/root/job_count");
+				job_count = Integer.parseInt(element.getText());
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+}

+ 97 - 0
src/main/java/com/pbsage/util/Constant.java

@@ -0,0 +1,97 @@
+package com.pbsage.util;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.Iterator;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+@SuppressWarnings("rawtypes")
+public class Constant {
+	public static String data_middle_url;
+	public static String metadata_web_url;
+
+	private static Logger logger;
+
+	private static String path = null;
+
+	public static String GetPath() {
+		if (path == null) {
+			String resource = "/log4j.properties";
+			URL resourceUrl = Constant.class.getResource(resource);
+			String resourcePath = null;
+			if (resourceUrl == null) {
+				resourcePath = System.getProperty("user.dir") + resource;
+			} else {
+				resourcePath = resourceUrl.getPath();
+			}
+			path = resourcePath.substring(0, resourcePath.length() - resource.length());
+		}
+		return path;
+	}
+
+	static {
+		try {
+			String filepathLog4j = Constant.GetPath() + "/log4j.properties";
+			PropertyConfigurator.configure(URLDecoder.decode(filepathLog4j, "UTF-8"));
+			logger = Logger.getLogger(Constant.class);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		try {
+			{
+				File xmlFile = new File(Constant.GetPath() + "/config.xml");
+				if (xmlFile.exists()) {
+					SAXReader saxReader = new SAXReader();
+					Document document = saxReader.read(xmlFile);
+					Iterator iter;
+					Element element;
+
+					iter = document.selectNodes("/root/data_middle").iterator();
+					if (iter.hasNext()) {
+						element = (Element) iter.next();
+						data_middle_url = element.attribute("url").getValue();
+						if (!data_middle_url.endsWith("/")) {
+							data_middle_url = data_middle_url + "/";
+						}
+					}
+					iter = document.selectNodes("/root/metadata_web").iterator();
+					if (iter.hasNext()) {
+						element = (Element) iter.next();
+						metadata_web_url = element.attribute("url").getValue();
+						if (!metadata_web_url.endsWith("/")) {
+							metadata_web_url = metadata_web_url + "/";
+						}
+					}
+				}
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public synchronized static void debug(String message) {
+		logger.debug(message);
+	}
+
+	public synchronized static void info(String message) {
+		logger.info(message);
+	}
+
+	public synchronized static void warn(String message) {
+		logger.warn(message);
+	}
+
+	public synchronized static void error(String message) {
+		logger.error(message);
+	}
+
+	public synchronized static void fatal(String message) {
+		logger.fatal(message);
+	}
+}

+ 566 - 0
src/main/java/com/pbsage/util/FastJsonUtil.java

@@ -0,0 +1,566 @@
+package com.pbsage.util;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+public class FastJsonUtil {
+	public static Set<Object> ValueArray2ValueSet(JSONArray valueArray) {
+		Set<Object> valueSet = new HashSet<Object>();
+		for (int index_va = 0; index_va < valueArray.size(); index_va++) {
+			Object valueItem = valueArray.get(index_va);
+			valueSet.add(valueItem);
+		}
+		return valueSet;
+	}
+
+	public static JSONArray ValueSet2ValueArray(Set<Object> valueSet) {
+		JSONArray valueArray = new JSONArray();
+		Iterator<Object> valueIter = valueSet.iterator();
+		while (valueIter.hasNext()) {
+			Object valueItem = valueIter.next();
+			valueArray.add(valueItem);
+		}
+		return valueArray;
+	}
+
+	public static Set<Object> ValueSet_or(List<Set<Object>> valueSetList) {
+		Set<Object> result = new HashSet<Object>();
+		for (int i = 0; i < valueSetList.size(); i++) {
+			Set<Object> valueSet = valueSetList.get(i);
+			result.addAll(valueSet);
+		}
+		return result;
+	}
+
+	public static Set<Object> ValueSet_and(List<Set<Object>> valueSetList) {
+		Set<Object> result = new HashSet<Object>();
+		Set<Object> first = valueSetList.get(0);
+		Iterator<Object> valueIter = first.iterator();
+		while (valueIter.hasNext()) {
+			Object valueItem = valueIter.next();
+			boolean all_in = true;
+			for (int i = 1; i < valueSetList.size(); i++) {
+				Set<Object> valueSet = valueSetList.get(i);
+				if (!valueSet.contains(valueItem)) {
+					all_in = false;
+					break;
+				}
+			}
+			if (all_in) {
+				result.add(valueItem);
+			}
+		}
+		return result;
+	}
+
+	public static Set<Object> ValueSet_sub(Set<Object> valueSet1, Set<Object> valueSet2) {
+		Set<Object> result = new HashSet<Object>();
+		Iterator<Object> valueIter = valueSet1.iterator();
+		while (valueIter.hasNext()) {
+			Object valueItem = valueIter.next();
+			if (!valueSet2.contains(valueItem)) {
+				result.add(valueItem);
+			}
+		}
+		return result;
+	}
+
+	public static String toFormatString(Object value) {
+		return toStringInner(value, true);
+	}
+
+	public static String toString(Object value) {
+		return toStringInner(value, false);
+	}
+
+	private static String toStringInner(Object value, boolean has_enter) {
+		if (value == null)
+			return "null";
+
+		if (value instanceof String) {
+			StringBuffer sb = new StringBuffer();
+			escape((String) value, sb);
+			return "\"" + sb.toString() + "\"";
+		}
+
+		if (value instanceof Double) {
+			if (((Double) value).isInfinite() || ((Double) value).isNaN())
+				return "null";
+			else
+				return value.toString();
+		}
+
+		if (value instanceof Float) {
+			if (((Float) value).isInfinite() || ((Float) value).isNaN())
+				return "null";
+			else
+				return value.toString();
+		}
+
+		if (value instanceof Number)
+			return value.toString();
+
+		if (value instanceof Boolean)
+			return value.toString();
+
+		if (value instanceof JSONObject) {
+			JSONObject valueJSON = (JSONObject) value;
+			StringBuffer sb = new StringBuffer();
+			boolean first = true;
+			Iterator<String> iter = valueJSON.keySet().iterator();
+
+			sb.append('{');
+			while (iter.hasNext()) {
+				String key = iter.next();
+
+				if (first)
+					first = false;
+				else
+					sb.append(',');
+
+				if (has_enter) {
+					sb.append("\r\n\t");
+				}
+
+				sb.append('\"');
+				escape(key, sb);
+				sb.append('\"').append(':');
+				String valueString = toStringInner(valueJSON.get(key), has_enter);
+				sb.append(valueString.replaceAll("\r\n", "\r\n\t"));
+			}
+			if (has_enter) {
+				sb.append("\r\n");
+			}
+			sb.append('}');
+			return sb.toString();
+		}
+
+		if (value instanceof JSONArray) {
+			JSONArray valueJSON = (JSONArray) value;
+			boolean first = true;
+			StringBuffer sb = new StringBuffer();
+
+			sb.append('[');
+			for (int i = 0; i < valueJSON.size(); i++) {
+				if (first)
+					first = false;
+				else
+					sb.append(',');
+
+				if (has_enter) {
+					sb.append("\r\n\t");
+				}
+
+				Object valueInner = valueJSON.get(i);
+				if (valueInner == null) {
+					sb.append("null");
+					continue;
+				}
+				String valueString = toStringInner(valueInner, has_enter);
+				sb.append(valueString.replaceAll("\r\n", "\r\n\t"));
+			}
+			if (has_enter) {
+				sb.append("\r\n");
+			}
+			sb.append(']');
+			return sb.toString();
+
+		}
+
+		return value.toString();
+	}
+
+	public static void escape(String s, StringBuffer sb) {
+		for (int i = 0; i < s.length(); i++) {
+			char ch = s.charAt(i);
+			switch (ch) {
+			case '"':
+				sb.append("\\\"");
+				break;
+			case '\\':
+				sb.append("\\\\");
+				break;
+			case '\b':
+				sb.append("\\b");
+				break;
+			case '\f':
+				sb.append("\\f");
+				break;
+			case '\n':
+				sb.append("\\n");
+				break;
+			case '\r':
+				sb.append("\\r");
+				break;
+			case '\t':
+				sb.append("\\t");
+				break;
+			case '/':
+				sb.append("\\/");
+				break;
+			default:
+				// Reference: http://www.unicode.org/versions/Unicode5.1.0/
+				if ((ch >= '\u0000' && ch <= '\u001F') || (ch >= '\u007F' && ch <= '\u009F') || (ch >= '\u2000' && ch <= '\u20FF')) {
+					String ss = Integer.toHexString(ch);
+					sb.append("\\u");
+					for (int k = 0; k < 4 - ss.length(); k++) {
+						sb.append('0');
+					}
+					sb.append(ss.toUpperCase());
+				} else {
+					sb.append(ch);
+				}
+			}
+		} // for
+	}
+
+	public static Long getLong(JSONObject json, String name) throws Exception {
+		if (json.containsKey(name)) {
+			Object item = json.get(name);
+			if (item instanceof Integer) {
+				return ((Integer) item).longValue();
+			} else if (item instanceof Long) {
+				return ((Long) item).longValue();
+			} else if (item instanceof BigInteger) {
+				return ((BigInteger) item).longValue();
+			} else {
+				throw new Exception("FastJsonUtil: " + "JSON property " + name + " cant Cast to Long:" + FastJsonUtil.toFormatString(json));
+			}
+		} else {
+			return null;
+		}
+	}
+
+	public static Long getDouble(JSONObject json, String name) throws Exception {
+		if (json.containsKey(name)) {
+			Object item = json.get(name);
+			if (item instanceof Integer) {
+				return ((Integer) item).longValue();
+			} else if (item instanceof Long) {
+				return ((Long) item).longValue();
+			} else if (item instanceof BigInteger) {
+				return ((BigInteger) item).longValue();
+			} else if (item instanceof Float) {
+				return ((Float) item).longValue();
+			} else if (item instanceof Double) {
+				return ((Double) item).longValue();
+			} else if (item instanceof BigDecimal) {
+				return ((BigDecimal) item).longValue();
+			} else {
+				throw new Exception("FastJsonUtil: " + "JSON property " + name + " cant Cast to Double:" + FastJsonUtil.toFormatString(json));
+			}
+		} else {
+			return null;
+		}
+	}
+
+	public static void Set_JSON(Object entity, JSONObject json) throws Exception {
+		Class<?> targetClass = entity.getClass();
+
+		Method[] targetMethodArray = targetClass.getMethods();
+		for (int i = 0; i < targetMethodArray.length; i++) {
+			Method method = targetMethodArray[i];
+			int modifiers = method.getModifiers();
+			String methodName = method.getName();
+			if (modifiers == 1 && methodName.startsWith("get")) {
+				Class<?>[] parameterTypes = method.getParameterTypes();
+				if (parameterTypes.length == 0) {
+					String fieldName = methodName.substring(3);
+					fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1);
+					if (json.containsKey(fieldName)) {
+						json.remove(fieldName);
+					}
+					Object value = method.invoke(entity, new Object[] {});
+					if (value != null) {
+						String valueClassName = value.getClass().getName();
+						Object put_value = null;
+						if (valueClassName.equals("java.lang.String")) {
+							put_value = value;
+						} else if (valueClassName.equals("java.util.Date")) {
+							SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+							put_value = sdf.format((Date) value);
+						} else if (valueClassName.equals("java.lang.Long") || valueClassName.equals("long")) {
+							put_value = value;
+						} else if (valueClassName.equals("java.lang.Double") || valueClassName.equals("double")) {
+							put_value = value;
+						} else if (valueClassName.equals("java.lang.Boolean") || valueClassName.equals("boolean")) {
+							put_value = value;
+						} else {
+							put_value = To_JSON(value);
+						}
+
+						json.put(fieldName, put_value);
+					}
+				}
+			}
+		}
+	}
+
+	public static void Set_JavaObject(JSONObject json, Object entity) throws Exception {
+		Class<?> targetClass = entity.getClass();
+
+		if (json == null) {
+			return;
+		}
+
+		Method[] targetMethodArray = targetClass.getMethods();
+		for (int i = 0; i < targetMethodArray.length; i++) {
+			Method method = targetMethodArray[i];
+			int modifiers = method.getModifiers();
+			String methodName = method.getName();
+			if (modifiers == 1 && methodName.startsWith("set")) {
+				Class<?>[] parameterTypes = method.getParameterTypes();
+				if (parameterTypes.length == 1) {
+					String fieldName = methodName.substring(3);
+					fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1);
+					Class<?> paramClass = parameterTypes[0];
+					if (json.containsKey(fieldName)) {
+						Object sourceFieldValue = json.get(fieldName);
+						Object targetFieldValue = To_JavaObject(sourceFieldValue, paramClass);
+
+						method.invoke(entity, new Object[] { targetFieldValue });
+					}
+				}
+			}
+		}
+	}
+
+	public static Object To_JSON(Object source) throws Exception {
+		Class<?> sourceClass = source.getClass();
+		if (sourceClass.isArray()) {
+			JSONArray result = new JSONArray();
+			int array_length = Array.getLength(source);
+			for (int i = 0; i < array_length; i++) {
+				Object item = Array.get(source, i);
+				result.add(To_JSON(item));
+			}
+			return result;
+		} else {
+			JSONObject result = new JSONObject();
+			Method[] meethodArray = sourceClass.getMethods();
+			for (int i = 0; i < meethodArray.length; i++) {
+				Method method = meethodArray[i];
+				int modifiers = method.getModifiers();
+				String methodName = method.getName();
+				if (modifiers == 1 && methodName.startsWith("get")) {
+					Class<?>[] parameterTypes = method.getParameterTypes();
+					if (parameterTypes.length == 0) {
+						String fieldName = methodName.substring(3);
+						fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1);
+						Object value = method.invoke(source, new Object[] {});
+						Object put_value;
+						if (value == null) {
+							put_value = null;
+						} else {
+							String valueClassName = value.getClass().getName();
+							if (valueClassName.equals("java.lang.String")) {
+								put_value = value;
+							} else if (valueClassName.equals("java.util.Date")) {
+								SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+								put_value = sdf.format(value);
+							} else if (valueClassName.equals("java.lang.Long") || valueClassName.equals("long")) {
+								put_value = value;
+							} else if (valueClassName.equals("java.lang.Double") || valueClassName.equals("double")) {
+								put_value = value;
+							} else if (valueClassName.equals("java.lang.Boolean") || valueClassName.equals("boolean")) {
+								put_value = value;
+							} else {
+								put_value = To_JSON(value);
+							}
+						}
+						result.put(fieldName, put_value);
+					}
+				}
+			}
+			return result;
+		}
+	}
+
+	public static Object To_JavaObject(Object json, Class<?> entityClass) throws Exception {
+		if (json == null) {
+			return null;
+		}
+
+		String targetClassName = entityClass.getName();
+		if (json instanceof JSONArray && entityClass.isArray()) {
+			JSONArray sourceEntity = (JSONArray) json;
+			int sourceLength = sourceEntity.size();
+
+			Class<?> targetComponentType = entityClass.getComponentType();
+			Object targetObjectArray = Array.newInstance(targetComponentType, sourceLength);
+
+			for (int i = 0; i < sourceLength; i++) {
+				Object sourceObject = sourceEntity.get(i);
+
+				Object targetObject = To_JavaObject(sourceObject, targetComponentType);
+				Array.set(targetObjectArray, i, targetObject);
+			}
+
+			return targetObjectArray;
+		} else if (json instanceof JSONObject) {
+			JSONObject sourceEntity = (JSONObject) json;
+
+			Constructor<?> constructorMethod = entityClass.getConstructor(new Class<?>[] {});
+			Object targetObject = constructorMethod.newInstance(new Object[] {});
+			Method[] methodArray = entityClass.getMethods();
+			for (int i = 0; i < methodArray.length; i++) {
+				Method method = methodArray[i];
+				int modifiers = method.getModifiers();
+				String methodName = method.getName();
+				if (modifiers == 1 && methodName.startsWith("set")) {
+					Class<?>[] parameterTypes = method.getParameterTypes();
+					if (parameterTypes.length == 1) {
+						String fieldName = methodName.substring(3);
+						fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1);
+						Class<?> paramClass = parameterTypes[0];
+						if (sourceEntity.containsKey(fieldName)) {
+							Object sourceFieldValue = sourceEntity.get(fieldName);
+							Object targetFieldValue = To_JavaObject(sourceFieldValue, paramClass);
+
+							method.invoke(targetObject, new Object[] { targetFieldValue });
+						}
+					}
+				}
+			}
+
+			return targetObject;
+		} else if (json instanceof String && targetClassName.equals("java.lang.String")) {
+			return (String) json;
+		} else if (json instanceof String && targetClassName.equals("java.util.Date")) {
+			SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+			return sdf.parse((String) json);
+		} else if (targetClassName.equals("java.lang.Long") || targetClassName.equals("long")) {
+			if (json instanceof String) {
+				Long value = Long.parseLong((String) json);
+				return value;
+			} else if (json instanceof Integer) {
+				return ((Integer) json).longValue();
+			} else if (json instanceof Long) {
+				return ((Long) json).longValue();
+			} else if (json instanceof BigInteger) {
+				return ((BigInteger) json).longValue();
+			} else {
+				return null;
+			}
+		} else if (targetClassName.equals("java.lang.Double") || targetClassName.equals("double")) {
+			if (json instanceof String) {
+				Double value = Double.parseDouble((String) json);
+				return value;
+			} else if (json instanceof Integer) {
+				return ((Integer) json).doubleValue();
+			} else if (json instanceof Long) {
+				return ((Long) json).doubleValue();
+			} else if (json instanceof BigInteger) {
+				return ((BigInteger) json).doubleValue();
+			} else if (json instanceof Float) {
+				return ((Float) json).doubleValue();
+			} else if (json instanceof Double) {
+				return ((Double) json).doubleValue();
+			} else if (json instanceof BigDecimal) {
+				return ((BigDecimal) json).doubleValue();
+			} else {
+				return null;
+			}
+		} else if (targetClassName.equals("java.lang.Boolean") || targetClassName.equals("boolean")) {
+			if (json instanceof String) {
+				Boolean value = ((String) json).equalsIgnoreCase("true") ? true : false;
+				return value;
+			} else if (json instanceof Boolean) {
+				Boolean value = (Boolean) json;
+				return value;
+			} else {
+				return null;
+			}
+		} else {
+			return null;
+		}
+	}
+
+	public static void Normalize(Object source) {
+		if (source instanceof JSONObject) {
+			JSONObject sourceJSON = (JSONObject) source;
+			Map<String, Object> newMap = new HashMap<String, Object>();
+			Iterator<String> keyIter = sourceJSON.keySet().iterator();
+			while (keyIter.hasNext()) {
+				String key = keyIter.next();
+				Object value = sourceJSON.get(key);
+				if (value == null) {
+					continue;
+				}
+				if (value instanceof Integer) {
+					newMap.put(key, ((Integer) value).longValue());
+				} else if (value instanceof Long) {
+				} else if (value instanceof BigInteger) {
+					newMap.put(key, ((BigInteger) value).longValue());
+				} else if (value instanceof Float) {
+					newMap.put(key, ((Float) value).doubleValue());
+				} else if (value instanceof Double) {
+				} else if (value instanceof BigDecimal) {
+					newMap.put(key, ((BigDecimal) value).doubleValue());
+				} else if (value instanceof JSONObject || value instanceof JSONArray) {
+					Normalize(value);
+				}
+			}
+			Iterator<String> iter2 = newMap.keySet().iterator();
+			while (iter2.hasNext()) {
+				String key = iter2.next();
+				Object value = newMap.get(key);
+				sourceJSON.remove(key);
+				sourceJSON.put(key, value);
+			}
+		} else if (source instanceof JSONArray) {
+			JSONArray sourceJSON = (JSONArray) source;
+			for (int i = 0; i < sourceJSON.size(); i++) {
+				Object sourceItem = sourceJSON.get(i);
+				if (sourceItem != null && (sourceItem instanceof JSONObject || sourceItem instanceof JSONArray)) {
+					Normalize(sourceItem);
+				}
+			}
+		}
+	}
+
+	public static Object Clone_JSON(Object source) {
+		if (source instanceof JSONObject) {
+			JSONObject result = new JSONObject();
+			JSONObject sourceJSON = (JSONObject) source;
+			Iterator<String> keyIter = sourceJSON.keySet().iterator();
+			while (keyIter.hasNext()) {
+				String key = keyIter.next();
+				Object value = sourceJSON.get(key);
+				result.put(key, Clone_JSON(value));
+			}
+			return result;
+		} else if (source instanceof JSONArray) {
+			JSONArray result = new JSONArray();
+			JSONArray sourceJSON = (JSONArray) source;
+			for (int i = 0; i < sourceJSON.size(); i++) {
+				result.add(Clone_JSON(sourceJSON.get(i)));
+			}
+			return result;
+		} else if (source instanceof String) {
+			return source;
+		} else if (source instanceof Double) {
+			return source;
+		} else if (source instanceof Long) {
+			return source;
+		} else if (source instanceof Boolean) {
+			return source;
+		}
+
+		return null;
+	}
+}

+ 91 - 0
src/main/java/com/pbsage/util/HttpUtil.java

@@ -0,0 +1,91 @@
+package com.pbsage.util;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.message.BasicNameValuePair;
+
+public class HttpUtil {
+	private static HttpUtil instance = new HttpUtil();
+
+	private HttpUtil() {
+
+	}
+
+	public static HttpUtil Instance() {
+		return instance;
+	}
+
+	private HttpClient client = new DefaultHttpClient();
+
+	public String post(String url, Map<String, String> params) throws Exception {
+		HttpPost httpost = new HttpPost(url);
+		List<NameValuePair> nvps = new ArrayList<NameValuePair>();
+		Set<String> keySet = params.keySet();
+		for (String key : keySet) {
+			nvps.add(new BasicNameValuePair(key, params.get(key)));
+		}
+		httpost.setEntity(new UrlEncodedFormEntity(nvps, "utf-8"));
+		HttpResponse httpResponse = client.execute(httpost);
+		InputStream is = httpResponse.getEntity().getContent();
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		int b = -1;
+		while ((b = is.read()) != -1) {
+			baos.write(b);
+		}
+		baos.close();
+		is.close();
+
+		String result = baos.toString("UTF-8");
+		return result;
+	}
+
+	public String post(String url, String content) throws Exception {
+		HttpPost httpost = new HttpPost(url);
+		StringEntity entity = new StringEntity(content, "UTF-8");
+		httpost.setEntity(entity);
+		entity.setContentType("application/json");
+		HttpResponse httpResponse = client.execute(httpost);
+		InputStream is = httpResponse.getEntity().getContent();
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		int b = -1;
+		while ((b = is.read()) != -1) {
+			baos.write(b);
+		}
+		baos.close();
+		is.close();
+
+		String result = baos.toString("UTF-8");
+		return result;
+	}
+
+	public String get(String url) throws Exception {
+		HttpGet httpget = new HttpGet(url);
+		// httpget.setHeader(new BasicHeader("Content-type", "text/plain;charset=utf-8"));
+		// httpget.setHeader(new BasicHeader("Content-type", "application/json;charset=utf-8"));
+		HttpResponse response = client.execute(httpget);
+		InputStream is = response.getEntity().getContent();
+		ByteArrayOutputStream os = new ByteArrayOutputStream();
+		int i = -1;
+		while ((i = is.read()) != -1) {
+			os.write(i);
+		}
+		is.close();
+		os.close();
+
+		String result = os.toString("UTF-8");
+		return result;
+	}
+}

+ 65 - 0
src/main/java/com/pbsage/util/JSONReaderUtil.java

@@ -0,0 +1,65 @@
+package com.pbsage.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+public class JSONReaderUtil {
+	private static JSONReaderUtil instance = new JSONReaderUtil();
+
+	public static JSONReaderUtil Instance() {
+		return instance;
+	}
+
+	private JSONReaderUtil() {
+
+	}
+
+	public Object Read(File file) throws Exception {
+		Object result = null;
+
+		InputStream is = new FileInputStream(file);
+		Reader reader = new InputStreamReader(is);
+		result = JSON.parseObject(is, JSONObject.class);
+		reader.close();
+		is.close();
+
+		return result;
+	}
+
+	public void Write(Object result, String filepath) throws Exception {
+		if (result instanceof JSONObject) {
+			this.WriteObject((JSONObject) result, filepath);
+		} else if (result instanceof JSONArray) {
+			this.WriteArray((JSONArray) result, filepath);
+		} else {
+			throw new Exception("JSONWrite: " + "Object must be JSONObject/JSONArray");
+		}
+	}
+
+	public void WriteObject(JSONObject result, String filepath) throws Exception {
+		OutputStream os = new FileOutputStream(filepath);
+		Writer writer = new OutputStreamWriter(os);
+		result.writeJSONString(writer);
+		writer.close();
+		os.close();
+	}
+
+	public void WriteArray(JSONArray result, String filepath) throws Exception {
+		OutputStream os = new FileOutputStream(filepath);
+		Writer writer = new OutputStreamWriter(os);
+		result.writeJSONString(writer);
+		writer.close();
+		os.close();
+	}
+}

+ 85 - 0
src/main/java/com/persagy/data_dict_tool/DataDictQueryUtil.java

@@ -0,0 +1,85 @@
+package com.persagy.data_dict_tool;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+
+public class DataDictQueryUtil {
+
+	public static JSONArray get_infos(String classCode) throws Exception {
+		JSONObject criteria = new JSONObject();
+		criteria.put("type", "common");
+		criteria.put("classCode", classCode);
+		JSONObject param = new JSONObject();
+		param.put("criteria", criteria);
+		String paramString = JSON.toJSONString(param, SerializerFeature.WriteMapNullValue);
+		// Constant.warn(paramString);
+		String full_url_2 = DataDictToolMain.url + "dict/funcid/query" + DataDictToolMain.url_param;
+		JSONObject queryResult = JSON.parseObject(HttpUtil.Instance().post(full_url_2, paramString));
+		JSONArray infos = (JSONArray) queryResult.get("data");
+
+		return infos;
+	}
+
+	public static void insert_rel(String graphId, String rel, String from, String to) throws Exception {
+		JSONObject criteria = new JSONObject();
+		criteria.put("graphId", graphId);
+		criteria.put("rel", rel);
+		criteria.put("from", from);
+		criteria.put("to", to);
+		JSONArray paramArray = new JSONArray();
+		paramArray.add(criteria);
+		String paramString2 = JSON.toJSONString(paramArray, SerializerFeature.WriteMapNullValue);
+		// Constant.warn(paramString);
+		String full_url_2 = DataDictToolMain.url + "world/relation/save" + DataDictToolMain.url_param;
+		JSONObject queryResult2 = JSON.parseObject(HttpUtil.Instance().post(full_url_2, paramString2));
+		Constant.warn("insert_rel: " + JSON.toJSONString(queryResult2, SerializerFeature.WriteMapNullValue));
+		if (!queryResult2.get("result").equals("success")) {
+			throw new Exception(full_url_2 + "\n" + paramString2);
+		}
+	}
+
+	public static void insert_object(JSONObject object) throws Exception {
+		JSONArray paramArray = new JSONArray();
+		paramArray.add(object);
+		String paramString2 = JSON.toJSONString(paramArray, SerializerFeature.WriteMapNullValue);
+		String full_url_2 = DataDictToolMain.url + "world/object/create" + DataDictToolMain.url_param;
+		JSONObject queryResult2 = JSON.parseObject(HttpUtil.Instance().post(full_url_2, paramString2));
+		Constant.warn("insert_object: " + JSON.toJSONString(queryResult2, SerializerFeature.WriteMapNullValue));
+		if (!queryResult2.get("result").equals("success")) {
+			throw new Exception(full_url_2 + "\n" + paramString2);
+		}
+	}
+
+	public static String getIdByLocalId(String classCode, int sequenceNo) throws Exception {
+		JSONObject criteria = new JSONObject();
+		criteria.put("classCode", classCode);
+		criteria.put("localId", classCode + "_" + sequenceNo);
+		JSONObject param = new JSONObject();
+		param.put("criteria", criteria);
+		String paramString2 = JSON.toJSONString(param, SerializerFeature.WriteMapNullValue);
+		String full_url_2 = DataDictToolMain.url + "world/object/query" + DataDictToolMain.url_param;
+		JSONObject queryResult2 = JSON.parseObject(HttpUtil.Instance().post(full_url_2, paramString2));
+		JSONArray dataArray = (JSONArray) queryResult2.get("data");
+		// Constant.warn(JSON.toJSONString(queryResult2, SerializerFeature.WriteMapNullValue));
+		JSONObject data = (JSONObject) dataArray.get(0);
+		String id = (String) data.get("id");
+		return id;
+	}
+
+	public static JSONArray getObjects(String classCode) throws Exception {
+		JSONObject criteria = new JSONObject();
+		criteria.put("classCode", classCode);
+		JSONObject param = new JSONObject();
+		param.put("criteria", criteria);
+		String paramString2 = JSON.toJSONString(param, SerializerFeature.WriteMapNullValue);
+		String full_url_2 = DataDictToolMain.url + "world/object/query" + DataDictToolMain.url_param;
+		JSONObject queryResult2 = JSON.parseObject(HttpUtil.Instance().post(full_url_2, paramString2));
+		JSONArray dataArray = (JSONArray) queryResult2.get("data");
+		// Constant.warn(JSON.toJSONString(queryResult2, SerializerFeature.WriteMapNullValue));
+		return dataArray;
+	}
+}

+ 158 - 0
src/main/java/com/persagy/data_dict_tool/DataDictScanner.java

@@ -0,0 +1,158 @@
+package com.persagy.data_dict_tool;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+import com.persagy.util.DataDictUtil;
+import com.persagy.util.ExcelSheet;
+import com.persagy.util.ExcelUtil;
+
+public class DataDictScanner {
+	public static void main(String[] args) throws Exception {
+		Scan_object();
+	}
+
+	public static void Scan_object() throws Exception {
+		JSONObject classTree = JSON.parseObject(HttpUtil.Instance().get(DataDictToolMain.url + "dict/class"));
+		// Constant.warn(JSON.toJSONString(classTree, SerializerFeature.WriteMapNullValue));
+		// Constant.warn(FastJsonUtil.toFormatString(classTree));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+
+		List<String> titleColList = new ArrayList<String>();
+		titleColList.add("sign");
+		titleColList.add("funcid");
+		titleColList.add("dataType");
+		ExcelSheet report = new ExcelSheet();
+		report.titleColList = titleColList;
+		ExcelSheet set = new ExcelSheet();
+		set.titleColList = titleColList;
+		Scan_object_Array(dataArray, report, set);
+
+		Map<String, ExcelSheet> reportMap = new HashMap<String, ExcelSheet>();
+		reportMap.put(DataDictToolMain.projectId, report);
+		ExcelUtil.Write("report.xlsx", reportMap);
+
+		Map<String, ExcelSheet> SetMap = new HashMap<String, ExcelSheet>();
+		SetMap.put(DataDictToolMain.projectId, set);
+		ExcelUtil.Write("set.xlsx", SetMap);
+	}
+
+	public static void Scan_object_Array(JSONArray dataArray, ExcelSheet report, ExcelSheet set) throws Exception {
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			Scan_object_Object(data, report, set);
+		}
+	}
+
+	private static void Scan_object_Object(JSONObject data, ExcelSheet report, ExcelSheet set) throws Exception {
+		String classCode = (String) data.get("code");
+		if (!classCode.startsWith("system") && !classCode.startsWith("equipment")) {
+			Constant.warn(classCode);
+			JSONArray infos = DataDictQueryUtil.get_infos(classCode);
+			JSONArray objects = DataDictQueryUtil.getObjects(classCode);
+			if (objects != null) {
+				for (int index_o = 0; index_o < objects.size(); index_o++) {
+					JSONObject object = (JSONObject) objects.get(index_o);
+					String object_name = (String) object.get("localName");
+					Constant.warn(object_name);
+					for (int i = 0; i < infos.size(); i++) {
+						JSONObject info = (JSONObject) infos.get(i);
+						// Constant.warn(JSON.toJSONString(info, SerializerFeature.WriteMapNullValue));
+						String code = (String) info.get("code");
+						String dataType = (String) info.get("dataType");
+						Object infoValue = object.get(code);
+						if (infoValue == null || !(infoValue instanceof String)) {
+							continue;
+						}
+						String infoValueString = (String) infoValue;
+
+						List<String> columnList = new ArrayList<String>();
+						int index_ = infoValueString.lastIndexOf('-');
+						if (index_ != -1) {
+							String sign = infoValueString.substring(0, index_);
+							String funcid = infoValueString.substring(index_ + 1);
+							columnList.add(sign);
+							columnList.add(funcid);
+						}
+						columnList.add(dataType);
+						if (DataDictUtil.getInfoType(info) == 1) {
+							report.contentListList.add(columnList);
+						} else if (DataDictUtil.getInfoType(info) == 2) {
+							set.contentListList.add(columnList);
+
+						}
+					}
+				}
+			}
+		}
+
+		JSONArray children = (JSONArray) data.get("children");
+		if (children != null) {
+			Scan_object_Array(children, report, set);
+		}
+	}
+
+	public static void Scan_infos() throws Exception {
+		JSONObject classTree = JSON.parseObject(HttpUtil.Instance().get(DataDictToolMain.url + "dict/class"));
+		// Constant.warn(JSON.toJSONString(classTree, SerializerFeature.WriteMapNullValue));
+		// Constant.warn(FastJsonUtil.toFormatString(classTree));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+		Map<String, List<String>> map = new HashMap<String, List<String>>();
+		Scan_infos_Array(dataArray, map);
+
+		String[] keys = map.keySet().toArray(new String[0]);
+		Arrays.sort(keys);
+		for (String key : keys) {
+			List<String> codeList = map.get(key);
+			Constant.warn(key + "\t" + codeList.toString());
+		}
+	}
+
+	public static void Scan_infos_Array(JSONArray dataArray, Map<String, List<String>> map) throws Exception {
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			Scan_infos_Object(data, map);
+		}
+	}
+
+	private static void Scan_infos_Object(JSONObject data, Map<String, List<String>> map) throws Exception {
+		String code = (String) data.get("code");
+		if (!code.startsWith("system-") && !code.startsWith("equipment-")) {
+			JSONArray infos = DataDictQueryUtil.get_infos(code);
+
+			for (int i = 0; i < infos.size(); i++) {
+				JSONObject info = (JSONObject) infos.get(i);
+				// Constant.warn(JSON.toJSONString(info, SerializerFeature.WriteMapNullValue));
+				String firstTag = (String) info.get("firstTag");
+				String category = (String) info.get("category");
+				String key = category + "-" + firstTag;
+				if (!map.containsKey(key)) {
+					map.put(key, new ArrayList<String>());
+				}
+				boolean exist = false;
+				for (String codeInner : map.get(key)) {
+					if (codeInner.equals(code)) {
+						exist = true;
+						break;
+					}
+				}
+				if (!exist) {
+					map.get(key).add(code);
+				}
+			}
+		}
+
+		JSONArray children = (JSONArray) data.get("children");
+		if (children != null) {
+			Scan_infos_Array(children, map);
+		}
+	}
+}

+ 87 - 0
src/main/java/com/persagy/data_dict_tool/DataDictToolMain.java

@@ -0,0 +1,87 @@
+package com.persagy.data_dict_tool;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+import com.persagy.util.DataDictUtil;
+
+@SuppressWarnings("unused")
+public class DataDictToolMain {
+	public static String url = "http://192.168.3.203:8080/";
+	public static String projectId = "Pj1101050029";
+	public static String url_param = "?projectId=" + projectId + "&appId=datautils";
+	// "http://192.168.3.203:8080/dict/funcid/query?projectId=Pj1101080002&appId=datautils"
+	public static int floor_count = 2;
+	public static int equipment_count = 2;
+
+	public static void main(String[] args) throws Exception {
+		// Iterator<String> keyIter = infos.keySet().iterator();
+		// while (keyIter.hasNext()) {
+		// String key = keyIter.next();
+		// infos.get(key);
+		// }
+
+		// DataDictScanner.Scan();
+
+		JSONArray systemArray = null;
+		JSONArray equipmentArray = null;
+		JSONObject classTree = JSON.parseObject(HttpUtil.Instance().get(url + "dict/class"));
+		Constant.warn(JSON.toJSONString(classTree, SerializerFeature.WriteMapNullValue));
+		// Constant.warn(FastJsonUtil.toFormatString(classTree));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String code = (String) data.get("code");
+			if (code.equals("system")) {
+				systemArray = (JSONArray) data.get("children");
+			} else if (code.equals("equipment")) {
+				equipmentArray = (JSONArray) data.get("children");
+			}
+		}
+
+		JSONObject building = null;
+		{
+			String classCode = "building";
+			JSONObject object = DataDictUtil.createObject(classCode, "1ºÅÂ¥");
+			building = object;
+			// DataDictQueryUtil.insert_rel("Gt" + "ArchSubset" + "001", "Pj2Bd", projectId, (String) building.get("id"));
+		}
+		for (int index_floor = 0; index_floor < floor_count; index_floor++) {
+			String classCode = "floor";
+			String floor_name = (index_floor + 1) + "²ã";
+			JSONObject floor_object = DataDictUtil.createObject(classCode, floor_name);
+			DataDictQueryUtil.insert_rel("Gt" + "ArchSubset" + "001", "Bd2Fl", (String) building.get("id"), (String) floor_object.get("id"));
+
+			for (int i = 0; i < equipmentArray.size(); i++) {
+				JSONObject equipment_zy = (JSONObject) equipmentArray.get(i);
+				String space_name = floor_name + "-" + equipment_zy.get("name") + "-" + "»ú·¿";
+				JSONObject space_object = DataDictUtil.createObject("space", space_name);
+				DataDictQueryUtil.insert_rel("Gt" + "ArchSubset" + "001", "Fl2Sp", (String) floor_object.get("id"), (String) space_object.get("id"));
+				JSONArray syArray = (JSONArray) equipment_zy.get("children");
+				for (int ii = 0; ii < syArray.size(); ii++) {
+					JSONObject sy = (JSONObject) syArray.get(ii);
+					String code_sy = ((String) sy.get("code")).substring("equipment-".length());
+					String sy_name = floor_name + "-" + sy.get("name");
+					JSONObject object_sy = DataDictUtil.createObject(code_sy, sy_name);
+					DataDictQueryUtil.insert_rel("Gt" + "MechInArch" + "001", "Sy2Sp", (String) object_sy.get("id"), (String) space_object.get("id"));
+					JSONArray objectTypeArray = (JSONArray) sy.get("children");
+					for (int iii = 0; iii < objectTypeArray.size(); iii++) {
+						JSONObject objectType = (JSONObject) objectTypeArray.get(iii);
+						String code_eq = (String) objectType.get("code");
+						for (int iiii = 0; iiii < equipment_count; iiii++) {
+							String eq_name = sy_name + "-" + objectType.getString("name") + "-" + (iiii + 1);
+							JSONObject object_eq = DataDictUtil.createObject(code_eq, eq_name);
+							DataDictQueryUtil.insert_rel("Gt" + "MechSubset" + "001", "Sy2Eq", (String) object_sy.get("id"),
+									(String) object_eq.get("id"));
+							DataDictQueryUtil.insert_rel("Gt" + "MechInArch" + "001", "Eq2Sp", (String) object_eq.get("id"),
+									(String) space_object.get("id"));
+						}
+					}
+				}
+			}
+		}
+	}
+}

+ 233 - 0
src/main/java/com/persagy/data_dict_tool/v2/DataDictCheck.java

@@ -0,0 +1,233 @@
+package com.persagy.data_dict_tool.v2;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+import com.persagy.util.ExcelSheet;
+import com.persagy.util.ExcelUtil;
+
+public class DataDictCheck {
+	public static String mode = "check";
+	public static String projectId = "Pj4403070003";
+	public static String groupCode = "WD";
+
+	public static void main(String[] args) throws Exception {
+		int index = 0;
+		mode = args[index++];
+		projectId = args[index++];
+		groupCode = args[index++];
+
+		Scan_dict();
+	}
+
+	public static void Scan_dict() throws Exception {
+		JSONObject classParam = new JSONObject();
+		classParam.put("criteria", new JSONObject());
+		JSONObject classTree = JSON
+				.parseObject(HttpUtil.Instance().post(Constant.data_middle_url + "rwd/def/class?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+		Map<String, List<String>> system2objectMap = new HashMap<String, List<String>>();
+		Map<String, String> type2nameMap = new HashMap<String, String>();
+		Map<String, String> system2nameMap = new HashMap<String, String>();
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String objType = (String) data.get("objType");
+			if (objType == null || objType.length() == 0) {
+				continue;
+			}
+			String majorCode = (String) data.get("majorCode");
+			if (majorCode == null || majorCode.length() == 0) {
+				continue;
+			}
+			if (!objType.equals("system")) {
+				continue;
+			}
+			String classCode = (String) data.get("code");
+			String name = (String) data.get("name");
+			system2nameMap.put(classCode, name);
+		}
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String objType = (String) data.get("objType");
+			if (objType == null || objType.length() == 0) {
+				continue;
+			}
+			String majorCode = (String) data.get("majorCode");
+			if (majorCode == null || majorCode.length() == 0) {
+				continue;
+			}
+			if (!objType.equals("equipment")) {
+				continue;
+			}
+			// if (!objType.equals("system") && !objType.equals("equipment") && !objType.equals("space")) {
+			//
+			// }
+			// if (!classCode.equals("SETDLS")) {
+			// continue;
+			// }
+			String classCode = (String) data.get("code");
+			String name = (String) data.get("name");
+			type2nameMap.put(classCode, name);
+			String system = classCode.substring(0, 4);
+			system2objectMap.putIfAbsent(system, new ArrayList<String>());
+			system2objectMap.get(system).add(classCode);
+		}
+		for (String system : system2objectMap.keySet()) {
+			List<String> typeList = system2objectMap.get(system);
+			Map<String, ExcelSheet> dyMap = new HashMap<String, ExcelSheet>();
+			int total_count = 0;
+			for (String classCode : typeList) {
+				ExcelSheet report = Scan_classCode(classCode);
+				int count = report.contentListList.size() > 3 ? (report.contentListList.size() - 4) : 0;
+				String sheetName = type2nameMap.get(classCode) + "-" + (count > 0 ? classCode + "-" + count : classCode);
+				dyMap.put(sheetName, report);
+				Constant.info(classCode + "\t" + count);
+				total_count += count;
+			}
+			ExcelUtil.Write(projectId + "/" + groupCode + "-" + projectId + "-" + system2nameMap.get(system) + "-" + system
+					+ (total_count > 0 ? "-" + total_count : "") + ".xlsx", dyMap);
+		}
+	}
+
+	public static ExcelSheet Scan_classCode(String classCode) throws Exception {
+		Constant.warn(classCode);
+		JSONArray infoArray;
+		Map<String, JSONObject> infoMap = new HashMap<String, JSONObject>();
+		List<String> firstTagList = new ArrayList<String>();
+		Map<String, List<String>> firstTagMap = new HashMap<String, List<String>>();
+		Map<String, List<String>> tag2InfosMap = new HashMap<String, List<String>>();
+		Map<String, String> info2nameMap = new HashMap<String, String>();
+		{
+			JSONObject criteria = new JSONObject();
+			criteria.put("classCode", classCode);
+			JSONObject classParam = new JSONObject();
+			classParam.put("criteria", criteria);
+			JSONObject classTree = JSON.parseObject(
+					HttpUtil.Instance().post(Constant.data_middle_url + "rwd/def/funcid?projectId=" + projectId + "&groupCode=" + groupCode,
+							JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+			infoArray = (JSONArray) classTree.get("data");
+			for (int i = 0; i < infoArray.size(); i++) {
+				JSONObject info = (JSONObject) infoArray.get(i);
+				String code = (String) info.get("code");
+				String name = (String) info.get("name");
+				String firstTag = (String) info.get("firstTag");
+				String secondTag = (String) info.get("secondTag");
+				infoMap.put(code, info);
+				info2nameMap.put(code, name);
+				if (firstTag != null) {
+					if (!firstTagMap.containsKey(firstTag)) {
+						firstTagList.add(firstTag);
+						firstTagMap.put(firstTag, new ArrayList<String>());
+					}
+					if (secondTag != null) {
+						boolean exist = false;
+						for (String ttt : firstTagMap.get(firstTag)) {
+							if (ttt.equals(secondTag)) {
+								exist = true;
+								break;
+							}
+						}
+						if (!exist) {
+							firstTagMap.get(firstTag).add(secondTag);
+						}
+					}
+
+					if (!tag2InfosMap.containsKey(firstTag + ":" + secondTag)) {
+						tag2InfosMap.put(firstTag + ":" + secondTag, new ArrayList<String>());
+					}
+					tag2InfosMap.get(firstTag + ":" + secondTag).add(code);
+				}
+			}
+		}
+		JSONArray objectArray;
+		{
+			JSONObject criteria = new JSONObject();
+			criteria.put("classCode", classCode);
+			criteria.put("valid", 1);
+			JSONObject classParam = new JSONObject();
+			classParam.put("criteria", criteria);
+			JSONObject classTree = JSON.parseObject(HttpUtil.Instance().post(
+					Constant.data_middle_url + "rwd/instance/object/query?projectId=" + projectId + "&groupCode=" + groupCode,
+					JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+			objectArray = (JSONArray) classTree.get("data");
+			if (objectArray == null) {
+				objectArray = new JSONArray();
+			}
+		}
+
+		ExcelSheet report = new ExcelSheet();
+		List<String> titleList2 = new ArrayList<String>();
+		List<String> titleList3 = new ArrayList<String>();
+		List<String> titleList4 = new ArrayList<String>();
+		report.contentListList.add(titleList2);
+		report.contentListList.add(titleList4);
+		report.contentListList.add(titleList3);
+		report.titleColList.add("id");
+		report.titleColList.add("localId");
+		report.titleColList.add("localName");
+		titleList2.add("id");
+		titleList2.add("localId");
+		titleList2.add("localName");
+		titleList3.add("id");
+		titleList3.add("localId");
+		titleList3.add("localName");
+		titleList4.add("id");
+		titleList4.add("localId");
+		titleList4.add("localName");
+		for (String firstTag : firstTagList) {
+			List<String> secondTagList = firstTagMap.get(firstTag);
+			if (secondTagList == null || secondTagList.size() == 0) {
+				String secondTag = null;
+				List<String> infos = tag2InfosMap.get(firstTag + ":" + secondTag);
+				for (String info : infos) {
+					report.titleColList.add(firstTag);
+					titleList2.add(secondTag);
+					titleList3.add(info);
+				}
+			} else {
+				for (String secondTag : secondTagList) {
+					List<String> infos = tag2InfosMap.get(firstTag + ":" + secondTag);
+					for (String info : infos) {
+						report.titleColList.add(firstTag);
+						titleList2.add(secondTag);
+						titleList3.add(info);
+						titleList4.add(info2nameMap.get(info));
+					}
+				}
+			}
+		}
+		Map<String, IntWrapper> countMap = new HashMap<String, IntWrapper>();
+		for (String infoCode : titleList3) {
+			countMap.put(infoCode, new IntWrapper());
+		}
+		for (int index = 0; index < objectArray.size(); index++) {
+			JSONObject object = (JSONObject) objectArray.get(index);
+			List<String> contentList = new ArrayList<String>();
+			report.contentListList.add(contentList);
+			for (String infoCode : titleList3) {
+				Object infoValue = object.get(infoCode);
+				contentList.add(infoValue == null ? "  " : infoValue.toString());
+				countMap.get(infoCode).value = countMap.get(infoCode).value + (infoValue == null ? 0 : 1);
+			}
+		}
+
+		if (report.contentListList.size() > 3) {
+			List<String> titleList5 = new ArrayList<String>();
+			for (String infoCode : titleList3) {
+				titleList5.add(countMap.get(infoCode).value > 0 ? "" + countMap.get(infoCode).value : "  ");
+			}
+			report.contentListList.add(3, titleList5);
+		}
+
+		return report;
+	}
+}

+ 97 - 0
src/main/java/com/persagy/data_dict_tool/v2/DataDictCount.java

@@ -0,0 +1,97 @@
+package com.persagy.data_dict_tool.v2;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+
+//ͳ¼ÆÿÀàÉ豸µÄÊýÁ¿
+public class DataDictCount {
+	public static String projectId = "Pj4403070003";
+	public static String groupCode = "WD";
+	// public static String projectId = "Pj4403050019";
+	// public static String groupCode = "ZS";
+
+	public static void main(String[] args) throws Exception {
+		int index = 0;
+		projectId = args[index++];
+		groupCode = args[index++];
+
+		Scan_dict();
+	}
+
+	public static void Scan_dict() throws Exception {
+		JSONObject classParam = new JSONObject();
+		classParam.put("criteria", new JSONObject());
+		JSONObject classTree = JSON
+				.parseObject(HttpUtil.Instance().post(Constant.data_middle_url + "rwd/def/class?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+		// Constant.warn(JSON.toJSONString(classTree, SerializerFeature.WriteMapNullValue));
+		// Constant.warn(FastJsonUtil.toFormatString(classTree));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+
+		// print(dataArray, "objType");
+		// print(dataArray, "majorCode");
+		// print(dataArray, "systemCode");
+		// print(dataArray, "code");
+		// print(dataArray, "type");
+
+		print(dataArray);
+	}
+
+	@SuppressWarnings("unused")
+	public static void print(JSONArray dataArray) throws Exception {
+		Map<String, Long> objTypeMap = new HashMap<String, Long>();
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String objType = (String) data.get("objType");
+			if (objType == null || objType.length() == 0) {
+				continue;
+			}
+			String majorCode = (String) data.get("majorCode");
+			if (majorCode == null || majorCode.length() == 0) {
+				continue;
+			}
+			if (objType.equals("system") || objType.equals("equipment")) {
+				String systemCode = (String) data.get("systemCode");
+				String code = (String) data.get("code");
+				String full = objType + "\t" + majorCode + "\t" + (systemCode == null ? "" : systemCode + "\t") + code;
+				// if (code.equals("FFFSSN")) {
+				// continue;
+				// }
+				// if (!code.equals("OTSERH")) {
+				// continue;
+				// }
+				// if (!majorCode.equals("AC")) {
+				// continue;
+				// }
+
+				long count;
+				{
+					JSONObject criteria = new JSONObject();
+					criteria.put("classCode", code);
+					JSONObject classParam = new JSONObject();
+					classParam.put("criteria", criteria);
+					JSONObject classTree = JSON.parseObject(HttpUtil.Instance().post(
+							Constant.data_middle_url + "rwd/instance/object/query?projectId=" + projectId + "&groupCode=" + groupCode,
+							JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+					count = (Integer) classTree.get("count");
+				}
+				Constant.warn(code + "\t" + count);
+				objTypeMap.put(code, count);
+			}
+		}
+
+		Constant.warn("****************************************************************");
+		String[] keys = objTypeMap.keySet().toArray(new String[0]);
+		for (String key : keys) {
+			long count = objTypeMap.get(key);
+			Constant.warn(key + "\t" + count);
+		}
+	}
+}

+ 471 - 0
src/main/java/com/persagy/data_dict_tool/v2/DataDictExportAllPoint.java

@@ -0,0 +1,471 @@
+package com.persagy.data_dict_tool.v2;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+import com.persagy.util.DataDictUtil;
+import com.persagy.util.ExcelSheet;
+import com.persagy.util.ExcelUtil;
+
+public class DataDictExportAllPoint {
+	public static String projectId = "Pj4403070003";
+	public static String groupCode = "WD";
+	// public static String projectId = "Pj4403050019";
+	// public static String groupCode = "ZS";
+	public static String second_period = "5";
+	public static String collect_cycle = "5min";
+	public static boolean filter = false;
+	public static String filter_objType = null;
+	public static String filter_classCode = null;
+	public static boolean hbase = false;
+	public static String Database = "db_public";
+	public static String QueryType = "batch_insert";
+	public static boolean all_point = false;
+
+	public static Map<String, String[]> up_lowMap = null;
+
+	public static Map<String, Map<String, String[]>> objectMapMap = null;
+
+	public static void main(String[] args) throws Exception {
+		int index = 1;
+		projectId = args[index++];
+		groupCode = args[index++];
+		second_period = args[index++];
+		collect_cycle = args[index++];
+		while (index < args.length) {
+			if (args[index].equalsIgnoreCase("filter")) {
+				filter = true;
+			}
+			if (args[index].startsWith("-objType:")) {
+				filter_objType = args[index].substring("-objType:".length());
+			}
+			if (args[index].startsWith("-classCode:")) {
+				filter_classCode = args[index].substring("-classCode:".length());
+			}
+			if (args[index].startsWith("-db:")) {
+				Database = args[index].substring("-db:".length());
+			}
+			if (args[index].equalsIgnoreCase("hbase")) {
+				hbase = true;
+			}
+			if (args[index].startsWith("-db:")) {
+				Database = args[index].substring("-db:".length());
+			}
+			if (args[index].equalsIgnoreCase("override")) {
+				QueryType = "batch_put";
+			}
+			if (args[index].startsWith("-all:")) {
+				all_point = args[index].substring("-all:".length()).equalsIgnoreCase("true") ? true : false;
+			}
+			index++;
+		}
+
+		// objectMapMap
+		if (filter) {
+			objectMapMap = new HashMap<String, Map<String, String[]>>();
+			ExcelSheet ExcelSheet = ExcelUtil.ReadSheet(Constant.GetPath() + "/info_code-" + groupCode + ".xlsx", "Sheet1", true);
+			int index_1 = -1;
+			int index_2 = -1;
+			int index_3 = -1;
+			int index_4 = -1;
+			int index_5 = -1;
+			for (int i = 0; i < ExcelSheet.titleColList.size(); i++) {
+				String titleCol = ExcelSheet.titleColList.get(i);
+				if (titleCol == null) {
+					continue;
+				}
+				if (titleCol.equals("系统编码")) {
+					index_1 = i;
+				}
+				if (titleCol.equals("设备类型编码")) {
+					index_2 = i;
+				}
+				if (titleCol.equals("信息点编码")) {
+					index_3 = i;
+				}
+				if (titleCol.equals("下限")) {
+					index_4 = i;
+				}
+				if (titleCol.equals("上限")) {
+					index_5 = i;
+				}
+			}
+			for (int i = 0; i < ExcelSheet.contentListList.size(); i++) {
+				String content1 = ExcelUtil.getContentInner(ExcelSheet, index_1, i);
+				String content2 = ExcelUtil.getContentInner(ExcelSheet, index_2, i);
+				String content3 = ExcelUtil.getContentInner(ExcelSheet, index_3, i);
+				String content4 = ExcelUtil.getContentInner(ExcelSheet, index_4, i);
+				String content5 = ExcelUtil.getContentInner(ExcelSheet, index_5, i);
+				if (content1 == null && content3 == null) {
+					continue;
+				}
+				String[] low_high;
+				if (content4 == null || content4.trim().length() == 0 || content4.trim().equalsIgnoreCase("null") || content5 == null
+						|| content5.trim().length() == 0 || content5.trim().equalsIgnoreCase("null")) {
+					low_high = null;
+				} else {
+					low_high = new String[2];
+					low_high[0] = content4;
+					low_high[1] = content5;
+				}
+				if (content2 == null || content2.length() == 0) {
+					if (!objectMapMap.containsKey(content1)) {
+						objectMapMap.put(content1, new HashMap<String, String[]>());
+					}
+					objectMapMap.get(content1).put(content3.toLowerCase(), low_high);
+				} else {
+					if (!objectMapMap.containsKey(content2)) {
+						objectMapMap.put(content2, new HashMap<String, String[]>());
+					}
+					objectMapMap.get(content2).put(content3.toLowerCase(), low_high);
+				}
+			}
+		} else {
+			// up_lowMap
+			up_lowMap = new HashMap<String, String[]>();
+			ExcelSheet ExcelSheet = ExcelUtil.ReadSheet(Constant.GetPath() + "/info_code-all.xlsx", "Sheet1", true);
+			Map<String, List<String>> map = new HashMap<String, List<String>>();
+			for (int i = 0; i < ExcelSheet.contentListList.size(); i++) {
+				List<String> content = ExcelSheet.contentListList.get(i);
+				String content1 = ExcelUtil.getContentInner(ExcelSheet, 0, i);
+				if (!map.containsKey(content1)) {
+					map.put(content1, content);
+				}
+			}
+			{
+				String[] rows = map.keySet().toArray(new String[0]);
+				Arrays.sort(rows);
+				List<List<String>> contentListList = new ArrayList<List<String>>();
+				for (String row : rows) {
+					contentListList.add(map.get(row));
+				}
+				ExcelSheet es = new ExcelSheet();
+				es.titleRowList = ExcelSheet.titleRowList;
+				es.titleColList = ExcelSheet.titleColList;
+				es.contentListList = contentListList;
+				Map<String, ExcelSheet> reportMap = new HashMap<String, ExcelSheet>();
+				reportMap.put("Sheet1", es);
+				ExcelUtil.Write(Constant.GetPath() + "/info_code-all.xlsx", reportMap);
+
+				ExcelSheet = ExcelUtil.ReadSheet(Constant.GetPath() + "/info_code-all.xlsx", "Sheet1", true);
+				for (List<String> row : ExcelSheet.contentListList) {
+					String info = row.get(0);
+					if (row.size() > 2 && row.get(1) != null && row.get(1).length() > 0 && row.get(2) != null && row.get(2).length() > 0) {
+						String[] up_low = new String[2];
+						up_low[0] = row.get(1);
+						up_low[1] = row.get(2);
+						up_lowMap.put(info, up_low);
+					}
+				}
+			}
+		}
+
+		Scan_object();
+	}
+
+	public static void Scan_object() throws Exception {
+		ExcelSheet report = new ExcelSheet();
+		{
+			List<String> titleColList = new ArrayList<String>();
+			titleColList.add("sign");
+			titleColList.add("funcid");
+			titleColList.add("dataType");
+			titleColList.add("period_second");
+			titleColList.add("lower_limit");
+			titleColList.add("upper_limit");
+			titleColList.add("rel_set_sign");
+			titleColList.add("rel_set_funcid");
+			report.titleColList = titleColList;
+		}
+		ExcelSheet set = new ExcelSheet();
+		{
+			List<String> titleColList = new ArrayList<String>();
+			titleColList.add("sign");
+			titleColList.add("funcid");
+			titleColList.add("dataType");
+			titleColList.add("manual_sign");
+			titleColList.add("manual_funcid");
+			set.titleColList = titleColList;
+		}
+		ExcelSheet dy_pointlist = new ExcelSheet();
+		{
+			List<String> titleColList = new ArrayList<String>();
+			titleColList.add("building");
+			titleColList.add("meter");
+			titleColList.add("funcid");
+			titleColList.add("data_type");
+			titleColList.add("collect_cycle");
+			dy_pointlist.titleColList = titleColList;
+		}
+
+		JSONObject classParam = new JSONObject();
+		classParam.put("criteria", new JSONObject());
+		JSONObject classTree = JSON
+				.parseObject(HttpUtil.Instance().post(Constant.data_middle_url + "rwd/def/class?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+		// Constant.warn(JSON.toJSONString(classTree, SerializerFeature.WriteMapNullValue));
+		// Constant.warn(FastJsonUtil.toFormatString(classTree));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+
+		Map<String, List<List<String>>> classCode2HBasePointList = new HashMap<String, List<List<String>>>();
+		Scan_object_Array(dataArray, report, set, dy_pointlist, classCode2HBasePointList);
+		if (hbase) {
+			int totalCount = 0;
+			int totalBad = 0;
+			String[] classCodes = classCode2HBasePointList.keySet().toArray(new String[0]);
+			Arrays.sort(classCodes);
+			Constant.warn("****************************************************************");
+			for (String classCode : classCodes) {
+				List<List<String>> HBasePointList = classCode2HBasePointList.get(classCode);
+				if (HBasePointList.size() == 0) {
+					continue;
+				}
+				int bad = 0;
+				for (int i = 0; i < HBasePointList.size(); i = i + 100) {
+					JSONArray InsertObjects = new JSONArray();
+					for (int ii = i; ii < i + 100 && ii < HBasePointList.size(); ii++) {
+						List<String> point = HBasePointList.get(ii);
+						String building = point.get(0);
+						String meter = point.get(1);
+						long funcid = Long.parseLong(point.get(2));
+						String data_type = point.get(3);
+						String collect_cycle = point.get(4);
+						JSONObject InsertObject = new JSONObject();
+						InsertObject.put("building", building);
+						InsertObject.put("meter", meter);
+						InsertObject.put("funcid", funcid);
+						InsertObject.put("data_type", data_type);
+						InsertObject.put("collect_cycle", collect_cycle);
+						InsertObject.put("system", "IBMS");
+						InsertObjects.add(InsertObject);
+						Constant.warn(building + "\t\t" + meter + "\t\t" + funcid + "\t\t" + data_type + "\t\t" + collect_cycle);
+					}
+					JSONObject query = new JSONObject();
+					query.put("QueryType", QueryType);
+					query.put("Database", Database);
+					query.put("Datatable", "dy_pointlist");
+					query.put("InsertObjects", InsertObjects);
+					Map<String, String> params = new HashMap<String, String>();
+					params.put("param", query.toJSONString());
+					String postResult = HttpUtil.Instance().post(Constant.metadata_web_url + "services/Service1_POST/Query", params);
+					JSONObject resultJSON = JSON.parseObject(postResult);
+					if (resultJSON.containsKey("Count")) {
+						long Count_bad = resultJSON.getLong("Count");
+						bad += Count_bad;
+					}
+				}
+				Constant.warn(classCode + " scan count: " + HBasePointList.size() + "\t\t" + "insert: " + (HBasePointList.size() - bad) + "\t\t"
+						+ "exist: " + bad);
+				totalCount += HBasePointList.size();
+				totalBad += bad;
+			}
+			Constant.warn("****************************************************************");
+			Constant.warn("total count: " + totalCount + "\t\t" + "insert: " + (totalCount - totalBad) + "\t\t" + "exist: " + totalBad);
+			Constant.warn("****************************************************************");
+		}
+
+		Map<String, ExcelSheet> reportMap = new HashMap<String, ExcelSheet>();
+		reportMap.put(projectId, report);
+		ExcelUtil.Write(groupCode + "-" + projectId + "-" + "report.xlsx", reportMap);
+
+		Map<String, ExcelSheet> SetMap = new HashMap<String, ExcelSheet>();
+		SetMap.put(projectId, set);
+		ExcelUtil.Write(groupCode + "-" + projectId + "-" + "set.xlsx", SetMap);
+
+		Map<String, ExcelSheet> dyMap = new HashMap<String, ExcelSheet>();
+		dyMap.put("Sheet1", dy_pointlist);
+		ExcelUtil.Write(groupCode + "-" + projectId + "-" + "dy_pointlist.xlsx", dyMap);
+	}
+
+	public static void Scan_object_Array(JSONArray dataArray, ExcelSheet report, ExcelSheet set, ExcelSheet dy_pointlist,
+			Map<String, List<List<String>>> classCode2HBasePointList) throws Exception {
+		Map<String, JSONObject> classMap = new HashMap<String, JSONObject>();
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String objType = (String) data.get("objType");
+			if (objType == null || objType.length() == 0) {
+				continue;
+			}
+			// String majorCode = (String) data.get("majorCode");
+			// if (majorCode == null || majorCode.length() == 0) {
+			// continue;
+			// }
+			String classCode = (String) data.get("code");
+			classMap.put(classCode, data);
+		}
+		String[] codes = classMap.keySet().toArray(new String[0]);
+		Arrays.sort(codes);
+		for (String code : codes) {
+			JSONObject data = classMap.get(code);
+			Scan_object_Object(data, report, set, dy_pointlist, classCode2HBasePointList);
+		}
+	}
+
+	private static void Scan_object_Object(JSONObject data, ExcelSheet report, ExcelSheet set, ExcelSheet dy_pointlist,
+			Map<String, List<List<String>>> classCode2HBasePointList) throws Exception {
+		String objType = (String) data.get("objType");
+		if (objType == null || objType.length() == 0) {
+			return;
+		}
+		// String majorCode = (String) data.get("majorCode");
+		// if (majorCode == null || majorCode.length() == 0) {
+		// return;
+		// }
+		String classCode = (String) data.get("code");
+
+		if (filter && !objectMapMap.containsKey(classCode)) {
+			return;
+		}
+
+		if (filter_objType != null && !filter_objType.equalsIgnoreCase(objType)) {
+			return;
+		}
+		if (filter_classCode != null && !filter_classCode.equalsIgnoreCase(classCode)) {
+			return;
+		}
+
+		JSONArray objectArray = DataDictQueryUtil_v2.getObjects(classCode, projectId, groupCode);
+		Constant.warn(classCode + "\t" + objectArray.size());
+		if (objectArray == null || objectArray.size() == 0) {
+			return;
+		}
+
+		JSONArray infoArray = DataDictQueryUtil_v2.get_infos(classCode, projectId, groupCode);
+		if (infoArray != null && objectArray != null) {
+			List<List<String>> HBasePointList = new ArrayList<List<String>>();
+			classCode2HBasePointList.put(classCode, HBasePointList);
+			Map<String, String> status_set = DataDictUtil.status_set(infoArray);
+			Constant.warn(status_set.toString());
+			for (int index_o = 0; index_o < objectArray.size(); index_o++) {
+				JSONObject object = (JSONObject) objectArray.get(index_o);
+				String object_name = (String) object.get("localName");
+				Constant.info(object_name);
+				for (int i = 0; i < infoArray.size(); i++) {
+					JSONObject info = (JSONObject) infoArray.get(i);
+					String firstTag = (String) info.get("firstTag");
+					if (firstTag == null) {
+						continue;
+					}
+					if (firstTag.equals("运行参数") || firstTag.equals("设定参数") || firstTag.equals("事件记录")) {
+					} else {
+						continue;
+					}
+
+					// Constant.warn(JSON.toJSONString(info, SerializerFeature.WriteMapNullValue));
+					String code = (String) info.get("code");
+					String dataType = (String) info.get("dataType");
+
+					if (filter && !objectMapMap.get(classCode).containsKey(code.toLowerCase())) {
+						continue;
+					}
+
+					Object infoValue = object.get(code);
+					if (infoValue == null || !(infoValue instanceof String)) {
+						continue;
+					}
+					String infoValueString = (String) infoValue;
+					if (infoValueString.length() == 0) {
+						continue;
+					}
+					// Matcher matcher = pattern.matcher(infoValueString.toString());
+					// if (matcher.matches()) {
+					// continue;
+					// }
+
+					int index_ = infoValueString.lastIndexOf('-');
+					if (index_ == -1) {
+						continue;
+					}
+					String sign = infoValueString.substring(0, index_);
+					String funcid = infoValueString.substring(index_ + 1);
+					if (sign == null || sign.trim().length() == 0 || funcid == null || funcid.trim().length() == 0) {
+						continue;
+					}
+					// if (!sign.startsWith(classCode + "_") || !sign.endsWith("_" + code)) {
+					// continue;
+					// }
+
+					if (all_point) {
+					} else {
+						if (infoValueString.toString().startsWith(classCode + "_") && (infoValueString.toString().endsWith("_" + code + "-" + "901")
+								|| infoValueString.toString().endsWith("_" + code + "-" + "902")
+								|| infoValueString.toString().endsWith("_" + code + "-" + "903"))) {
+						} else {
+							continue;
+						}
+					}
+
+					List<String> columnList = new ArrayList<String>();
+					List<String> columnList_dy = new ArrayList<String>();
+					// columnList.add(code);
+					columnList.add(sign);
+					columnList.add(funcid);
+					columnList.add(dataType);
+					columnList_dy.add(projectId.substring(2));
+					columnList_dy.add(sign);
+					columnList_dy.add(funcid);
+					columnList_dy.add("Inst");
+					columnList_dy.add(collect_cycle);
+					if (DataDictUtil.getInfoType(info) == 1) {
+						columnList.add(second_period);
+						Map<String, String[]> up_lowMapInner;
+						if (filter) {
+							up_lowMapInner = objectMapMap.get(classCode);
+						} else {
+							up_lowMapInner = up_lowMap;
+						}
+						if (up_lowMapInner.containsKey(code)) {
+							String[] up_low = up_lowMapInner.get(code);
+							columnList.add(up_low[0].toString());
+							columnList.add(up_low[1].toString());
+						} else {
+							columnList.add(null);
+							columnList.add(null);
+						}
+						if (code.equals("runStatus")) {
+							String value_set = (String) object.get("equipSwitchSet");
+							if (value_set != null && value_set.length() > 0) {
+								int index_set = value_set.lastIndexOf('-');
+								columnList.add(value_set.substring(0, index_set));
+								columnList.add(value_set.substring(index_set + 1));
+							}
+						} else if (status_set.containsKey(code)) {
+							String info_set = status_set.get(code);
+							if (object.get(info_set) instanceof String) {
+								String value_set = (String) object.get(info_set);
+								if (value_set != null && value_set.length() > 0) {
+									int index_set = value_set.lastIndexOf('-');
+									columnList.add(value_set.substring(0, index_set));
+									columnList.add(value_set.substring(index_set + 1));
+								}
+							}
+						}
+						report.contentListList.add(columnList);
+						dy_pointlist.contentListList.add(columnList_dy);
+
+						HBasePointList.add(columnList_dy);
+					} else if (DataDictUtil.getInfoType(info) == 2) {
+						if (code.equals("equipSwitchSet")) {
+							String value_set = (String) object.get("manualAutoStatus");
+							if (value_set != null && value_set.length() > 0) {
+								int index_set = value_set.lastIndexOf('-');
+								columnList.add(value_set.substring(0, index_set));
+								columnList.add(value_set.substring(index_set + 1));
+							}
+						}
+						set.contentListList.add(columnList);
+					}
+				}
+			}
+		}
+	}
+}

+ 89 - 0
src/main/java/com/persagy/data_dict_tool/v2/DataDictPrintTree.java

@@ -0,0 +1,89 @@
+package com.persagy.data_dict_tool.v2;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+
+//´òÓ¡¶ÔÏóÀàÐͽṹ
+public class DataDictPrintTree {
+	public static String url = "http://39.102.54.110:8082/rwd/";
+
+	public static void main(String[] args) throws Exception {
+		Scan_dict();
+	}
+
+	public static void Scan_dict() throws Exception {
+		JSONObject classParam = new JSONObject();
+		classParam.put("criteria", new JSONObject());
+		JSONObject classTree = JSON
+				.parseObject(HttpUtil.Instance().post(url + "def/class", JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+		// Constant.warn(JSON.toJSONString(classTree, SerializerFeature.WriteMapNullValue));
+		// Constant.warn(FastJsonUtil.toFormatString(classTree));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+
+		print(dataArray);
+	}
+
+	public static void print(JSONArray dataArray) throws Exception {
+		JSONObject result = new JSONObject();
+
+		Map<String, String> systemNameMap = new HashMap<String, String>();
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String objType = (String) data.get("objType");
+			if (objType == null || (!objType.equals("equipment") && !objType.equals("system"))) {
+				continue;
+			}
+			String name = (String) data.get("name");
+			String code = (String) data.get("code");
+			String systemCode = (String) data.get("systemCode");
+			if (systemCode == null) {
+				systemNameMap.put(code, name);
+			}
+		}
+
+		String[] systemNames = systemNameMap.keySet().toArray(new String[0]);
+		Arrays.sort(systemNames);
+		for (String systemName : systemNames) {
+			Constant.warn(systemName + "," + systemNameMap.get(systemName));
+		}
+
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String objType = (String) data.get("objType");
+			if (objType == null || (!objType.equals("equipment") && !objType.equals("system"))) {
+				continue;
+			}
+
+			String name = (String) data.get("name");
+			String code = (String) data.get("code");
+			String majorCode = (String) data.get("majorCode");
+			String systemCode = (String) data.get("systemCode");
+			if (code == null || majorCode == null) {
+				continue;
+			}
+
+			if (!result.containsKey(majorCode)) {
+				result.put(majorCode, new JSONObject());
+			}
+			JSONObject resultItem = (JSONObject) result.get(majorCode);
+
+			if (systemCode != null) {
+				String systemName = systemNameMap.get(systemCode);
+				if (!resultItem.containsKey(systemCode + "-" + systemName)) {
+					resultItem.put(systemCode + "-" + systemName, new JSONObject());
+				}
+				JSONObject resultItemItem = (JSONObject) resultItem.get(systemCode + "-" + systemName);
+				resultItemItem.put(code + "-" + name, true);
+			}
+		}
+		Constant.warn(result.toJSONString());
+	}
+}

+ 43 - 0
src/main/java/com/persagy/data_dict_tool/v2/DataDictQueryUtil_v2.java

@@ -0,0 +1,43 @@
+package com.persagy.data_dict_tool.v2;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+
+public class DataDictQueryUtil_v2 {
+
+	public static JSONArray get_infos(String classCode, String projectId, String groupCode) throws Exception {
+		JSONObject criteria = new JSONObject();
+		criteria.put("classCode", classCode);
+		JSONObject classParam = new JSONObject();
+		classParam.put("criteria", criteria);
+		JSONObject classTree = JSON
+				.parseObject(HttpUtil.Instance().post(Constant.data_middle_url + "rwd/def/funcid?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+		// Constant.warn(JSON.toJSONString(classTree, SerializerFeature.WriteMapNullValue));
+		// Constant.warn(FastJsonUtil.toFormatString(classTree));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+		if (dataArray == null) {
+			dataArray = new JSONArray();
+		}
+		return dataArray;
+	}
+
+	public static JSONArray getObjects(String classCode, String projectId, String groupCode) throws Exception {
+		JSONObject criteria = new JSONObject();
+		criteria.put("classCode", classCode);
+		JSONObject classParam = new JSONObject();
+		classParam.put("criteria", criteria);
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/query?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+		JSONArray objectArray = (JSONArray) classTree.get("data");
+		if (objectArray == null) {
+			objectArray = new JSONArray();
+		}
+		return objectArray;
+	}
+}

+ 352 - 0
src/main/java/com/persagy/data_dict_tool/v2/DataDict_generate.java

@@ -0,0 +1,352 @@
+package com.persagy.data_dict_tool.v2;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+import com.persagy.util.DataDictUtil;
+import com.persagy.util.ExcelSheet;
+import com.persagy.util.ExcelUtil;
+
+public class DataDict_generate {
+	public static String mode = "generate";
+	public static String projectId = "Pj4403070003";
+	public static String groupCode = "WD";
+	// public static String projectId = "Pj4403050019";
+	// public static String groupCode = "ZS";
+	public static boolean only_print = true;
+	public static boolean force = false;
+	public static String filename = null;
+
+	public static boolean point_use_localId = false;
+
+	public static Map<String, Map<String, Boolean>> systemMapMap = new HashMap<String, Map<String, Boolean>>();
+	public static Map<String, Map<String, Boolean>> equipmentMapMap = new HashMap<String, Map<String, Boolean>>();
+	public static Map<String, Map<String, Boolean>> wdequipmentMapMap = new HashMap<String, Map<String, Boolean>>();
+
+	public static void main(String[] args) throws Exception {
+		int index = 0;
+		mode = args[index++];
+		projectId = args[index++];
+		groupCode = args[index++];
+		only_print = args[index++].equalsIgnoreCase("print") ? true : false;
+		while (index < args.length) {
+			if (args[index].equalsIgnoreCase("force")) {
+				force = true;
+			}
+			if (args[index].startsWith("-file:")) {
+				filename = args[index].substring("-file:".length());
+			}
+			index++;
+		}
+
+		File[] files;
+		if (filename == null) {
+			File dir = new File(Constant.GetPath() + "/info_code-" + groupCode);
+			if (!dir.exists()) {
+				Constant.warn(Constant.GetPath() + "/info_code-" + groupCode + "\t" + " dont exist");
+				return;
+			}
+			files = dir.listFiles();
+		} else {
+			files = new File[1];
+			File fileInner = new File(Constant.GetPath() + "/" + filename);
+			if (!fileInner.exists()) {
+				Constant.warn(Constant.GetPath() + "/" + filename + "\t" + " dont exist");
+				return;
+			}
+			files[0] = fileInner;
+		}
+
+		for (File file : files) {
+			if (!file.isFile()) {
+				continue;
+			}
+
+			Constant.warn(file.getName());
+			ExcelSheet ExcelSheet = ExcelUtil.ReadSheet_frist(file.getPath(), true);
+			int index_1 = -1;
+			int index_2 = -1;
+			int index_2_2 = -1;
+			int index_3 = -1;
+			for (int i = 0; i < ExcelSheet.titleColList.size(); i++) {
+				String titleCol = ExcelSheet.titleColList.get(i);
+				if (titleCol == null) {
+					continue;
+				}
+				if (titleCol.equals("系统编码")) {
+					index_1 = i;
+				}
+				if (titleCol.equals("设备类型编码")) {
+					index_2 = i;
+				}
+				if (titleCol.equals("万达设备类型编码")) {
+					index_2_2 = i;
+				}
+				if (titleCol.equals("信息点编码")) {
+					index_3 = i;
+				}
+			}
+			for (int i = 0; i < ExcelSheet.contentListList.size(); i++) {
+				String content_1 = ExcelUtil.getContentInner(ExcelSheet, index_1, i);
+				String content_2 = ExcelUtil.getContentInner(ExcelSheet, index_2, i);
+				String content_2_2 = ExcelUtil.getContentInner(ExcelSheet, index_2_2, i);
+				String content_5 = ExcelUtil.getContentInner(ExcelSheet, index_3, i);
+				if (content_1 == null && content_2 == null && content_2_2 == null || content_5 == null) {
+					continue;
+				}
+
+				if (content_2_2 != null && content_2_2.length() > 0) {
+					if (!wdequipmentMapMap.containsKey(content_2_2)) {
+						wdequipmentMapMap.put(content_2_2, new HashMap<String, Boolean>());
+					}
+					wdequipmentMapMap.get(content_2_2).put(content_5.toLowerCase(), true);
+				} else if (content_2 != null && content_2.length() > 0) {
+					if (!equipmentMapMap.containsKey(content_2)) {
+						equipmentMapMap.put(content_2, new HashMap<String, Boolean>());
+					}
+					equipmentMapMap.get(content_2).put(content_5.toLowerCase(), true);
+				} else {
+					if (!systemMapMap.containsKey(content_1)) {
+						systemMapMap.put(content_1, new HashMap<String, Boolean>());
+					}
+					systemMapMap.get(content_1).put(content_5.toLowerCase(), true);
+				}
+			}
+
+			String[] systemCodes = systemMapMap.keySet().toArray(new String[0]);
+			Arrays.sort(systemCodes);
+			for (String classCode : systemCodes) {
+				Scan(classCode, null);
+			}
+			String[] equipmentCodes = equipmentMapMap.keySet().toArray(new String[0]);
+			Arrays.sort(equipmentCodes);
+			for (String classCode : equipmentCodes) {
+				if (classCode.equals("equipment") || classCode.equals("system")) {
+					String objType = classCode;
+					JSONObject classParam = new JSONObject();
+					JSONObject criteria = new JSONObject();
+					criteria.put("objType", objType);
+					classParam.put("criteria", criteria);
+					JSONObject classTree = JSON.parseObject(
+							HttpUtil.Instance().post(Constant.data_middle_url + "rwd/def/class?projectId=" + projectId + "&groupCode=" + groupCode,
+									JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+					JSONArray dataArray = (JSONArray) classTree.get("data");
+					for (int i = 0; i < dataArray.size(); i++) {
+						JSONObject data = (JSONObject) dataArray.get(i);
+						String classCodeInner = (String) data.get("code");
+						if (classCodeInner.equals(objType)) {
+							continue;
+						}
+						Scan(classCodeInner, null);
+					}
+				} else {
+					Scan(classCode, null);
+				}
+			}
+			String[] wdequipmentCodes = wdequipmentMapMap.keySet().toArray(new String[0]);
+			Arrays.sort(wdequipmentCodes);
+			for (String classCode : wdequipmentCodes) {
+				Scan(null, classCode);
+			}
+		}
+	}
+
+	public static void Scan(String classCode_ori, String wdCode) throws Exception {
+		Pattern pattern = Pattern.compile("[0-9]{1,}[-][0-9]{1,}");
+		Map<String, Boolean> tagMap = new HashMap<String, Boolean>();
+
+		long count = -1;
+		JSONArray objectArray = null;
+		{
+			JSONObject criteria = new JSONObject();
+			if (wdCode != null) {
+				criteria.put("wdCode", wdCode);
+			} else {
+				criteria.put("classCode", classCode_ori);
+			}
+			JSONObject classParam = new JSONObject();
+			classParam.put("criteria", criteria);
+			JSONObject classTree = JSON.parseObject(HttpUtil.Instance().post(
+					Constant.data_middle_url + "rwd/instance/object/query?projectId=" + projectId + "&groupCode=" + groupCode,
+					JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+			count = (Integer) classTree.get("count");
+			Constant.warn(classCode_ori + "\t" + wdCode + "\t" + count);
+			objectArray = (JSONArray) classTree.get("data");
+		}
+
+		if (objectArray == null || objectArray.size() == 0) {
+			return;
+		}
+		String classCode;
+		{
+			JSONObject object_0 = (JSONObject) objectArray.get(0);
+			classCode = object_0.getString("classCode");
+		}
+		JSONArray infoArray;
+		{
+			JSONObject criteria = new JSONObject();
+			criteria.put("classCode", classCode);
+			JSONObject classParam = new JSONObject();
+			classParam.put("criteria", criteria);
+			JSONObject classTree = JSON.parseObject(
+					HttpUtil.Instance().post(Constant.data_middle_url + "rwd/def/funcid?projectId=" + projectId + "&groupCode=" + groupCode,
+							JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+			infoArray = (JSONArray) classTree.get("data");
+		}
+		if (infoArray != null && objectArray != null) {
+			JSONArray addInfoArray = new JSONArray();
+			for (int i = 0; i < objectArray.size(); i++) {
+				JSONObject object = (JSONObject) objectArray.get(i);
+				String id = (String) object.get("id");
+				String localId = (String) object.get("localId");
+				String localName = (String) object.get("localName");
+				JSONObject add_infos = new JSONObject();
+				for (int ii = 0; ii < infoArray.size(); ii++) {
+					JSONObject info = (JSONObject) infoArray.get(ii);
+					String firstTag = (String) info.get("firstTag");
+					String secondTag = (String) info.get("secondTag");
+					String info_code = (String) info.get("code");
+					if (!tagMap.containsKey(firstTag + "-" + secondTag)) {
+						tagMap.put(firstTag + "-" + secondTag, true);
+					}
+
+					boolean valid = false;
+					if (wdCode != null) {
+						if (wdequipmentMapMap.containsKey(wdCode) && wdequipmentMapMap.get(wdCode).containsKey(info_code.toLowerCase())
+								|| wdequipmentMapMap.containsKey(wdCode.substring(2))
+										&& wdequipmentMapMap.get(wdCode.substring(2)).containsKey(info_code.toLowerCase())) {
+							valid = true;
+						}
+					} else {
+						if (systemMapMap.containsKey(classCode) && systemMapMap.get(classCode).containsKey(info_code.toLowerCase())
+								|| systemMapMap.containsKey(classCode.substring(2))
+										&& systemMapMap.get(classCode.substring(2)).containsKey(info_code.toLowerCase())) {
+							valid = true;
+						}
+						if (equipmentMapMap.containsKey(classCode) && equipmentMapMap.get(classCode).containsKey(info_code.toLowerCase())
+								|| equipmentMapMap.containsKey(classCode.substring(2))
+										&& equipmentMapMap.get(classCode.substring(2)).containsKey(info_code.toLowerCase())) {
+							valid = true;
+						}
+					}
+					if (equipmentMapMap.containsKey("equipment") && equipmentMapMap.get("equipment").containsKey(info_code.toLowerCase())) {
+						valid = true;
+					}
+
+					if (valid) {
+						String infoValue = null;
+						String id_cut = id.substring(id.length() - 8);
+						if (DataDictUtil.getInfoType(info) == 1) {
+							infoValue = (point_use_localId ? classCode + "_" + localId + "_" + info_code + "-" + 901
+									: classCode + "_" + id_cut + "_" + info_code + "-" + 901);
+						} else if (DataDictUtil.getInfoType(info) == 2) {
+							infoValue = (point_use_localId ? classCode + "_" + localId + "_" + info_code + "-" + 903
+									: classCode + "_" + id_cut + "_" + info_code + "-" + 903);
+						}
+						if (infoValue != null) {
+							Object info_value = object.get(info_code);
+							if (info_value != null) {
+								if (force) {
+									Constant.info(infoValue);
+									add_infos.put(info_code, infoValue);
+								} else {
+									if (infoValue.equals(info_value)) {
+										Constant.info(infoValue + "\t\t\t\t" + "exist");
+									} else {
+										Matcher matcher = pattern.matcher(info_value.toString());
+										if (matcher.matches()) {
+											Constant.info(infoValue + "\t\t\t\t" + info_value);
+										} else {
+											Constant.info(infoValue + "\t\t\t\t" + info_value);
+										}
+									}
+								}
+							} else {
+								Constant.info(infoValue);
+								add_infos.put(info_code, infoValue);
+							}
+						}
+					}
+				}
+				if (add_infos.size() > 0) {
+					Constant.warn(classCode + "\t" + wdCode + "\t" + localId + "\t" + localName + "\t" + add_infos.toJSONString());
+					add_infos.put("id", id);
+					if (!only_print) {
+						addInfoArray.add(add_infos);
+						if (addInfoArray.size() >= 100) {
+							updateArray(addInfoArray);
+							addInfoArray.clear();
+						}
+					}
+				}
+			}
+			if (addInfoArray.size() > 0) {
+				updateArray(addInfoArray);
+				addInfoArray.clear();
+			}
+		}
+	}
+
+	public static void updateArray(JSONArray postJSON) throws Exception {
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/update?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(postJSON, SerializerFeature.WriteMapNullValue)));
+		String result = (String) classTree.get("result");
+		if (!result.equals("success")) {
+			Constant.warn(result + "\t" + JSON.toJSONString(postJSON, SerializerFeature.WriteMapNullValue));
+		}
+	}
+
+	public static void update(JSONObject param) throws Exception {
+		JSONArray postJSON = new JSONArray();
+		postJSON.add(param);
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/update?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(postJSON, SerializerFeature.WriteMapNullValue)));
+		String result = (String) classTree.get("result");
+		if (!result.equals("success")) {
+			Constant.warn(result + "\t" + JSON.toJSONString(param, SerializerFeature.WriteMapNullValue));
+		}
+	}
+
+	public static void update(String id, String infoCode, Object infoValue) throws Exception {
+		JSONArray param = new JSONArray();
+		JSONObject criteria = new JSONObject();
+		criteria.put("id", id);
+		criteria.put(infoCode, infoValue);
+		param.add(criteria);
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/update?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(param, SerializerFeature.WriteMapNullValue)));
+		String result = (String) classTree.get("result");
+		if (!result.equals("success")) {
+			Constant.warn(id + "\t" + infoCode + "\t" + infoValue + "\t" + result);
+		}
+	}
+
+	public static void print(JSONArray dataArray, String propertyName) {
+		Constant.warn(propertyName + " :");
+		Map<String, Boolean> objTypeMap = new HashMap<String, Boolean>();
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String objType = (String) data.get(propertyName);
+			if (objType == null || objType.length() == 0) {
+				continue;
+			}
+			if (!objTypeMap.containsKey(objType)) {
+				objTypeMap.put(objType, true);
+				Constant.warn(objType);
+			}
+		}
+	}
+}

+ 184 - 0
src/main/java/com/persagy/data_dict_tool/v2/DataDict_remove.java

@@ -0,0 +1,184 @@
+package com.persagy.data_dict_tool.v2;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+
+public class DataDict_remove {
+	public static String mode = "remove";
+	public static String projectId = "Pj4403070003";
+	public static String groupCode = "WD";
+	// public static String projectId = "Pj4403050019";
+	// public static String groupCode = "ZS";
+	public static boolean only_print = true;
+	public static boolean all_point = false;
+
+	public static boolean point_use_localId = false;
+
+	public static void main(String[] args) throws Exception {
+		int index = 0;
+		mode = args[index++];
+		projectId = args[index++];
+		groupCode = args[index++];
+		only_print = args[index++].equalsIgnoreCase("print") ? true : false;
+		while (index < args.length) {
+			if (args[index].startsWith("-all:")) {
+				all_point = args[index].substring("-all:".length()).equalsIgnoreCase("true") ? true : false;
+			}
+			index++;
+		}
+
+		Scan_dict();
+	}
+
+	public static void Scan_dict() throws Exception {
+		JSONObject classParam = new JSONObject();
+		classParam.put("criteria", new JSONObject());
+		JSONObject classTree = JSON
+				.parseObject(HttpUtil.Instance().post(Constant.data_middle_url + "rwd/def/class?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+		// Constant.warn(JSON.toJSONString(classTree, SerializerFeature.WriteMapNullValue));
+		// Constant.warn(FastJsonUtil.toFormatString(classTree));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+
+		// print(dataArray, "objType");
+		// print(dataArray, "majorCode");
+		// print(dataArray, "systemCode");
+		// print(dataArray, "code");
+		// print(dataArray, "type");
+
+		String[] classCodes = new String[dataArray.size()];
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String code = (String) data.get("code");
+			classCodes[i] = code;
+		}
+		Arrays.sort(classCodes);
+		for (String code : classCodes) {
+			Scan(code);
+		}
+	}
+
+	public static void Scan(String classCode) throws Exception {
+		JSONArray objectArray = DataDictQueryUtil_v2.getObjects(classCode, projectId, groupCode);
+		Constant.warn(classCode + "\t" + objectArray.size());
+		if (objectArray == null || objectArray.size() == 0) {
+			return;
+		}
+
+		JSONArray infoArray = DataDictQueryUtil_v2.get_infos(classCode, projectId, groupCode);
+		if (infoArray != null && objectArray != null) {
+			JSONArray addInfoArray = new JSONArray();
+			for (int i = 0; i < objectArray.size(); i++) {
+				JSONObject object = (JSONObject) objectArray.get(i);
+				String id = (String) object.get("id");
+				String localId = (String) object.get("localId");
+				String localName = (String) object.get("localName");
+				JSONArray remove_infos = new JSONArray();
+				JSONObject removeObj = new JSONObject();
+				for (int ii = 0; ii < infoArray.size(); ii++) {
+					JSONObject info = (JSONObject) infoArray.get(ii);
+					String firstTag = (String) info.get("firstTag");
+					String info_code = (String) info.get("code");
+					if (firstTag == null) {
+						continue;
+					}
+					if (firstTag.equals("运行参数") || firstTag.equals("设定参数") || firstTag.equals("事件记录")) {
+						Object info_value = object.get(info_code);
+						if (info_value != null) {
+							if (all_point) {
+								removeObj.put(info_code, info_value);
+								remove_infos.add(info_code);
+							} else {
+								if (info_value.toString().startsWith(classCode + "_")
+										&& (info_value.toString().endsWith("_" + info_code + "-" + "901")
+												|| info_value.toString().endsWith("_" + info_code + "-" + "902")
+												|| info_value.toString().endsWith("_" + info_code + "-" + "903"))) {
+									removeObj.put(info_code, info_value);
+									remove_infos.add(info_code);
+								}
+							}
+						}
+					}
+				}
+				if (remove_infos.size() > 0) {
+					Constant.warn(classCode + "\t" + id + "\t" + localId + "\t" + localName + "\t" + removeObj.toJSONString());
+					JSONObject update_param = new JSONObject();
+					update_param.put("id", id);
+					update_param.put("$remove", remove_infos);
+					if (!only_print) {
+						addInfoArray.add(update_param);
+						if (addInfoArray.size() >= 100) {
+							updateArray(addInfoArray);
+							addInfoArray.clear();
+						}
+					}
+				}
+			}
+			if (addInfoArray.size() > 0) {
+				updateArray(addInfoArray);
+				addInfoArray.clear();
+			}
+		}
+	}
+
+	public static void updateArray(JSONArray postJSON) throws Exception {
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/update?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(postJSON, SerializerFeature.WriteMapNullValue)));
+		String result = (String) classTree.get("result");
+		if (!result.equals("success")) {
+			Constant.warn(result + "\t" + JSON.toJSONString(postJSON, SerializerFeature.WriteMapNullValue));
+		}
+	}
+
+	public static void update1(JSONObject param) throws Exception {
+		JSONArray postJSON = new JSONArray();
+		postJSON.add(param);
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/update?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(postJSON, SerializerFeature.WriteMapNullValue)));
+		String result = (String) classTree.get("result");
+		if (!result.equals("success")) {
+			Constant.warn(result + "\t" + JSON.toJSONString(param, SerializerFeature.WriteMapNullValue));
+		}
+	}
+
+	public static void update1(String id, String infoCode, Object infoValue) throws Exception {
+		JSONArray param = new JSONArray();
+		JSONObject criteria = new JSONObject();
+		criteria.put("id", id);
+		criteria.put(infoCode, infoValue);
+		param.add(criteria);
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/update?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(param, SerializerFeature.WriteMapNullValue)));
+		String result = (String) classTree.get("result");
+		if (!result.equals("success")) {
+			Constant.warn(id + "\t" + infoCode + "\t" + infoValue + "\t" + result);
+		}
+	}
+
+	public static void print(JSONArray dataArray, String propertyName) {
+		Constant.warn(propertyName + " :");
+		Map<String, Boolean> objTypeMap = new HashMap<String, Boolean>();
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String objType = (String) data.get(propertyName);
+			if (objType == null || objType.length() == 0) {
+				continue;
+			}
+			if (!objTypeMap.containsKey(objType)) {
+				objTypeMap.put(objType, true);
+				Constant.warn(objType);
+			}
+		}
+	}
+}

+ 5 - 0
src/main/java/com/persagy/data_dict_tool/v2/IntWrapper.java

@@ -0,0 +1,5 @@
+package com.persagy.data_dict_tool.v2;
+
+public class IntWrapper {
+	public int value;
+}

+ 65 - 0
src/main/java/com/persagy/data_dict_tool/v2/TagMain.java

@@ -0,0 +1,65 @@
+package com.persagy.data_dict_tool.v2;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+
+//´òÓ¡ËùÓбêÇ©
+public class TagMain {
+	public static String projectId = "Pj4403070003";
+	public static String groupCode = "WD";
+	// public static String projectId = "Pj4403050019";
+	// public static String groupCode = "ZS";
+
+	public static void main(String[] args) throws Exception {
+		JSONObject classParam = new JSONObject();
+		classParam.put("criteria", new JSONObject());
+		JSONObject classTree = JSON
+				.parseObject(HttpUtil.Instance().post(Constant.data_middle_url + "rwd/def/class?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+		// Constant.warn(JSON.toJSONString(classTree, SerializerFeature.WriteMapNullValue));
+		// Constant.warn(FastJsonUtil.toFormatString(classTree));
+		Map<String, Boolean> firstTagMap = new HashMap<String, Boolean>();
+		Map<String, Boolean> secondTagMap = new HashMap<String, Boolean>();
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject item = (JSONObject) dataArray.get(i);
+			String classCode = (String) item.get("code");
+			if (classCode == null) {
+				continue;
+			}
+			JSONArray infos = DataDictQueryUtil_v2.get_infos(classCode, projectId, groupCode);
+			for (int ii = 0; ii < infos.size(); ii++) {
+				JSONObject info = (JSONObject) infos.get(ii);
+				String firstTag = (String) info.get("firstTag");
+				String secondTag = (String) info.get("secondTag");
+				if (firstTag != null) {
+					firstTagMap.put(firstTag, true);
+				}
+				if (secondTag != null) {
+					secondTagMap.put(secondTag, true);
+				}
+			}
+		}
+		String[] firstTags = firstTagMap.keySet().toArray(new String[0]);
+		Arrays.sort(firstTags);
+		for (String tag : firstTags) {
+			Constant.warn(tag);
+		}
+		Constant.warn("----");
+
+		String[] secondTags = secondTagMap.keySet().toArray(new String[0]);
+		Arrays.sort(secondTags);
+		for (String tag : secondTags) {
+			Constant.warn(tag);
+		}
+
+	}
+}

+ 14 - 0
src/main/java/com/persagy/data_dict_tool/v2/ToolMain.java

@@ -0,0 +1,14 @@
+package com.persagy.data_dict_tool.v2;
+
+public class ToolMain {
+
+	public static void main(String[] args) throws Exception {
+		if (args[0].equalsIgnoreCase("generate")) {
+			DataDict_generate.main(args);
+		} else if (args[0].equalsIgnoreCase("remove")) {
+			DataDict_remove.main(args);
+		} else if (args[0].equalsIgnoreCase("export")) {
+			DataDictExportAllPoint.main(args);
+		}
+	}
+}

+ 85 - 0
src/main/java/com/persagy/data_dict_tool/v2/UpdateInfo.java

@@ -0,0 +1,85 @@
+package com.persagy.data_dict_tool.v2;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+
+//½«heightµ¥Î»¸Ä³ÉÃ×
+public class UpdateInfo {
+	public static String mode = "generate";// generate/remove
+	public static String projectId = "Pj4403070003";
+	public static String groupCode = "WD";
+	// public static String projectId = "Pj4403050019";
+	// public static String groupCode = "ZS";
+	public static boolean only_print = true;
+
+	public static void main(String[] args) throws Exception {
+		int index = 0;
+		mode = args[index++];
+		projectId = args[index++];
+		groupCode = args[index++];
+		only_print = args[index++].equalsIgnoreCase("true") ? true : false;
+
+		Scan_dict();
+	}
+
+	public static void Scan_dict() throws Exception {
+		JSONObject classParam = new JSONObject();
+		JSONObject criteria = new JSONObject();
+		criteria.put("objType", "floor");
+		criteria.put("valid", 1);
+		classParam.put("criteria", criteria);
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/query?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+		JSONArray dataArray = (JSONArray) classTree.get("data");
+		for (int i = 0; i < dataArray.size(); i++) {
+			JSONObject data = (JSONObject) dataArray.get(i);
+			String id = data.getString("id");
+			Constant.warn(id);
+			if (data.containsKey("height")) {
+				String value = data.get("height").toString();
+				double value_new = Double.parseDouble(value) / 1000.0;
+				JSONObject add_infos = new JSONObject();
+				add_infos.put("height", value_new);
+				add_infos.put("id", id);
+				if (only_print) {
+					Constant.warn(add_infos.toJSONString());
+				} else {
+					Constant.warn(add_infos.toJSONString());
+					update(add_infos);
+				}
+			}
+		}
+	}
+
+	public static void update(JSONObject param) throws Exception {
+		JSONArray postJSON = new JSONArray();
+		postJSON.add(param);
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/update?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(postJSON, SerializerFeature.WriteMapNullValue)));
+		String result = (String) classTree.get("result");
+		if (!result.equals("success")) {
+			Constant.warn(result + "\t" + JSON.toJSONString(param, SerializerFeature.WriteMapNullValue));
+		}
+	}
+
+	public static void update(String id, String infoCode, Object infoValue) throws Exception {
+		JSONArray param = new JSONArray();
+		JSONObject criteria = new JSONObject();
+		criteria.put("id", id);
+		criteria.put(infoCode, infoValue);
+		param.add(criteria);
+		JSONObject classTree = JSON.parseObject(
+				HttpUtil.Instance().post(Constant.data_middle_url + "rwd/instance/object/update?projectId=" + projectId + "&groupCode=" + groupCode,
+						JSON.toJSONString(param, SerializerFeature.WriteMapNullValue)));
+		String result = (String) classTree.get("result");
+		if (!result.equals("success")) {
+			Constant.warn(id + "\t" + infoCode + "\t" + infoValue + "\t" + result);
+		}
+	}
+}

+ 173 - 0
src/main/java/com/persagy/util/DataDictUtil.java

@@ -0,0 +1,173 @@
+package com.persagy.util;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.data_dict_tool.DataDictQueryUtil;
+
+@SuppressWarnings("unused")
+public class DataDictUtil {
+	public static boolean point_use_localId = true;
+	public static int yunxing_index = 1;
+	public static int sheding_index = 1;
+
+	public static int getInfoType(JSONObject infoJSON) {
+		String firstTag = infoJSON.get("firstTag") == null ? null : (String) infoJSON.get("firstTag");
+		String secondTag = infoJSON.get("secondTag") == null ? null : (String) infoJSON.get("secondTag");
+		if (firstTag != null) {
+			if (firstTag.contains("运行参数")) {
+				return 1;
+			} else if (firstTag.contains("事件记录")) {
+				if (secondTag != null && secondTag.contains("报警消息")) {
+					return 1;
+				} else {
+					return 1;
+				}
+			} else if (firstTag.contains("设定参数")) {
+				if (secondTag != null && secondTag.contains("设定反馈值")) {
+					return 1;
+				} else {
+					return 2;
+				}
+			}
+		}
+		return 0;
+	}
+
+	public static Map<String, String> status_set(JSONArray infos) {
+		Map<String, Boolean> statusMap = new HashMap<String, Boolean>();
+		Map<String, Boolean> setMap = new HashMap<String, Boolean>();
+		for (int ii = 0; ii < infos.size(); ii++) {
+			JSONObject info = (JSONObject) infos.get(ii);
+			String category = (String) info.get("category");
+			String firstTag = (String) info.get("firstTag");
+			String secondTag = (String) info.get("secondTag");
+			String info_code = (String) info.get("code");
+			if (DataDictUtil.getInfoType(info) == 1) {
+				statusMap.put(info_code, true);
+			} else if (DataDictUtil.getInfoType(info) == 2) {
+				setMap.put(info_code, true);
+			}
+		}
+
+		Map<String, String> result = new HashMap<String, String>();
+		Iterator<String> keyIter = setMap.keySet().iterator();
+		while (keyIter.hasNext()) {
+			String key = keyIter.next();
+			if (key.endsWith("Set") && statusMap.containsKey(key.substring(0, key.length() - "Set".length()))) {
+				result.put(key.substring(0, key.length() - "Set".length()), key);
+			} else if (key.endsWith("Set") && statusMap.containsKey(key.substring(0, key.length() - "Set".length()) + "Status")) {
+				result.put(key.substring(0, key.length() - "Set".length()) + "Status", key);
+			} else if (statusMap.containsKey(key + "Status")) {
+				result.put(key + "Status", key);
+			} else if (statusMap.containsKey(key + "Feedback")) {
+				result.put(key + "Feedback", key);
+			}
+		}
+		return result;
+	}
+
+	public static Map<String, SequenceNo> sequenceMap = new HashMap<String, SequenceNo>();
+
+	public static int generateSequenceNo(String classCode) {
+		if (!sequenceMap.containsKey(classCode)) {
+			sequenceMap.put(classCode, new SequenceNo());
+		}
+		SequenceNo se = sequenceMap.get(classCode);
+		return se.index++;
+	}
+
+	public static JSONObject createObject(String classCode, String localName) throws Exception {
+		int sequenceNo = generateSequenceNo(classCode);
+		JSONArray infos = DataDictQueryUtil.get_infos(classCode);
+		JSONObject object = DataDictUtil.generateObject(classCode, sequenceNo, infos, localName);
+		DataDictQueryUtil.insert_object(object);
+		String id = DataDictQueryUtil.getIdByLocalId(classCode, sequenceNo);
+		object.put("id", id);
+		return object;
+	}
+
+	public static JSONObject generateObject(String classCode, int sequenceNo, JSONArray infos, String localName) throws Exception {
+		JSONObject result = new JSONObject();
+		result.put("classCode", classCode);
+		for (int i = 0; i < infos.size(); i++) {
+			JSONObject info = (JSONObject) infos.get(i);
+			String firstTag = (String) info.get("firstTag");
+			String category = (String) info.get("category");
+			String code = (String) info.get("code");
+			String name = (String) info.get("name");
+			String dataType = (String) info.get("dataType");
+
+			Object infoValue = null;
+			if (category.equals("STATIC")) {
+				if (firstTag == null) {
+					if (code.equals("id")) {
+						// infoValue = classCode + "_" + code + "_" + sequenceNo;
+					} else if (code.equals("name")) {
+						infoValue = classCode + "_" + sequenceNo;
+					} else if (code.equals("localId")) {
+						infoValue = classCode + "_" + sequenceNo;
+					} else if (code.equals("localName")) {
+						if (localName == null) {
+							infoValue = classCode + "_" + sequenceNo;
+						} else {
+							infoValue = localName;
+						}
+					} else if (code.endsWith("ID")) {
+						infoValue = classCode + "_" + sequenceNo;
+					} else if (code.endsWith("Name")) {
+						infoValue = classCode + "_" + sequenceNo;
+					} else {
+						// throw new Exception("firstTag: " + firstTag + "\t" + "code: " + code);
+					}
+				} else {
+					if (firstTag.equals("基本信息") || firstTag.equals("基本参数") || firstTag.equals("技术参数") || firstTag.equals("技术参数-通用")) {
+						infoValue = generateInfo(info, dataType);
+					}
+				}
+			} else if (DataDictUtil.getInfoType(info) == 1) {
+				infoValue = (point_use_localId ? classCode + "_" + sequenceNo : "" + yunxing_index++) + "_" + code + "-" + 901;
+			} else if (DataDictUtil.getInfoType(info) == 2) {
+				infoValue = (point_use_localId ? classCode + "_" + sequenceNo : "" + sheding_index++) + "_" + code + "-" + 903;
+			} else {
+				// throw new Exception("firstTag: " + firstTag + "\t" + "category: " + category);
+			}
+
+			if (infoValue != null) {
+				result.put(code, infoValue);
+			}
+		}
+		return result;
+	}
+
+	private static Object generateInfo(JSONObject info, String dataType) {
+		Object result = null;
+		Boolean isMultiple = (Boolean) info.get("isMultiple");
+		Boolean isRegion = (Boolean) info.get("isRegion");
+		if (!isMultiple && !isRegion) {
+			if (dataType.equals("INTEGER")) {
+				result = "" + 2;
+			} else if (dataType.equals("DOUBLE")) {
+				result = "" + 5.20;
+			} else if (dataType.equals("BOOLEAN")) {
+				result = "" + true;
+			} else if (dataType.equals("STRING")) {
+				result = "" + "a";
+			} else if (dataType.equals("ENUM")) {
+				// result = "" + 1;
+			} else if (dataType.equals("MENUM")) {
+				// result = "[1, 2]";
+			}
+		} else if (isRegion) {
+			// if (dataType.equals("INTEGER")) {
+			// result = "1, 2";
+			// } else if (dataType.equals("DOUBLE")) {
+			// result = "1.2, 3.4";
+			// }
+		}
+		return result;
+	}
+}

+ 10 - 0
src/main/java/com/persagy/util/ExcelSheet.java

@@ -0,0 +1,10 @@
+package com.persagy.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ExcelSheet {
+	public List<String> titleRowList = new ArrayList<String>();
+	public List<String> titleColList = new ArrayList<String>();
+	public List<List<String>> contentListList = new ArrayList<List<String>>();
+}

+ 316 - 0
src/main/java/com/persagy/util/ExcelUtil.java

@@ -0,0 +1,316 @@
+package com.persagy.util;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.WorkbookFactory;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+public class ExcelUtil {
+
+	public static String getContentInner(ExcelSheet sheetContent, int col, int row) {
+		String result = null;
+		if (sheetContent.contentListList != null) {
+			if (sheetContent.contentListList.size() > row) {
+				List<String> contentList = sheetContent.contentListList.get(row);
+				if (contentList.size() > col) {
+					result = contentList.get(col);
+				}
+			}
+		}
+		return result;
+	}
+
+	public static String getContentInner(ExcelSheet sheetContent, String col, String row) {
+		int buildingIndex = -1;
+		for (int i = 0; i < sheetContent.titleColList.size(); i++) {
+			String name = sheetContent.titleColList.get(i);
+			if (name.equals(col)) {
+				buildingIndex = i;
+				break;
+			}
+		}
+
+		int titleIndex = -1;
+		for (int i = 0; i < sheetContent.titleRowList.size(); i++) {
+			String name = sheetContent.titleRowList.get(i);
+			if (name.equals(row)) {
+				titleIndex = i;
+				break;
+			}
+		}
+
+		String content = null;
+		if (buildingIndex == -1 || titleIndex == -1) {
+		} else {
+			content = sheetContent.contentListList.get(titleIndex).get(buildingIndex);
+		}
+
+		return content;
+	}
+
+	public static void Write(String filepath, Map<String, ExcelSheet> sheetMap) throws Exception {
+		Workbook wb;
+		if (filepath.endsWith("xlsx")) {
+			wb = new XSSFWorkbook();
+		} else {
+			wb = new HSSFWorkbook();
+		}
+
+		String[] names = sheetMap.keySet().toArray(new String[0]);
+		Arrays.sort(names);
+		for (String name : names) {
+			ExcelSheet sheet = sheetMap.get(name);
+			Sheet st = wb.createSheet(name);
+			int index_row_start = 0;
+			if (sheet.titleColList != null && sheet.titleColList.size() > 0) {
+				Row row = st.createRow(0);
+				for (int i = 0; i < sheet.titleColList.size(); i++) {
+					String title = sheet.titleColList.get(i);
+					Cell cell = row.createCell(i);
+					cell.setCellValue(title);
+				}
+				index_row_start = 1;
+			}
+			int index_col_start = 0;
+			if (sheet.titleRowList != null && sheet.titleRowList.size() > 0) {
+				for (int i = 0; i < sheet.titleRowList.size(); i++) {
+					Row row = st.createRow(index_row_start + i);
+					String title = sheet.titleRowList.get(i);
+					Cell cell = row.createCell(0);
+					cell.setCellValue(title);
+				}
+				index_col_start = 1;
+			}
+			for (int index_row = 0; index_row < sheet.contentListList.size(); index_row++) {
+				List<String> contentList = sheet.contentListList.get(index_row);
+				Row row = st.getRow(index_row_start + index_row);
+				if (row == null) {
+					row = st.createRow(index_row_start + index_row);
+				}
+				for (int index_col = 0; index_col < contentList.size(); index_col++) {
+					String content = contentList.get(index_col);
+					Cell cell = row.createCell(index_col_start + index_col);
+					cell.setCellValue(content);
+				}
+			}
+		}
+
+		FileOutputStream os = new FileOutputStream(filepath);
+		wb.write(os);
+		os.close();
+	}
+
+	public static Map<String, ExcelSheet> Read(String filepath, boolean titleCol) throws Exception {
+		Map<String, ExcelSheet> result = new HashMap<String, ExcelSheet>();
+
+		Workbook workbook = WorkbookFactory.create(new File(filepath));
+		int numbers = workbook.getNumberOfSheets();
+		for (int i = 0; i < numbers; i++) {
+			Sheet sheet = workbook.getSheetAt(i);
+			String name = sheet.getSheetName();
+			ExcelSheet ExcelSheet;
+			if (titleCol) {
+				ExcelSheet = GetSheetContent_titleCol(sheet);
+			} else {
+				ExcelSheet = GetSheetContent(sheet);
+			}
+			result.put(name, ExcelSheet);
+		}
+
+		return result;
+	}
+
+	public static ExcelSheet ReadSheet_frist(String filepath, boolean titleCol) throws Exception {
+		Workbook workbook = WorkbookFactory.create(new File(filepath));
+		Sheet sheet = workbook.getSheetAt(0);
+		ExcelSheet ExcelSheet;
+		if (titleCol) {
+			ExcelSheet = GetSheetContent_titleCol(sheet);
+		} else {
+			ExcelSheet = GetSheetContent(sheet);
+		}
+
+		return ExcelSheet;
+	}
+
+	public static ExcelSheet ReadSheet(String filepath, String sheetName, boolean titleCol) throws Exception {
+		Workbook workbook = WorkbookFactory.create(new File(filepath));
+		Sheet sheet = workbook.getSheet(sheetName);
+		ExcelSheet ExcelSheet;
+		if (titleCol) {
+			ExcelSheet = GetSheetContent_titleCol(sheet);
+		} else {
+			ExcelSheet = GetSheetContent(sheet);
+		}
+
+		return ExcelSheet;
+	}
+
+	public static ExcelSheet GetSheetContent(Sheet sheet) {
+		ExcelSheet result = new ExcelSheet();
+
+		int row_from = 0;
+		int row_to = 0;
+
+		int row_tmp = row_from + 1;
+		while (true) {
+			Row row = sheet.getRow(row_tmp);
+			if (row == null) {
+				break;
+			}
+			Cell cell = row.getCell(0);
+			if (cell == null) {
+				break;
+			}
+			String cellValue = GetCellValue(cell);
+			if (cellValue != null && cellValue.trim().length() > 0) {
+				row_to = row_tmp;
+				result.titleRowList.add(cellValue.trim());
+				row_tmp++;
+			} else {
+				break;
+			}
+		}
+
+		Row rowBuildings = sheet.getRow(row_from);
+		int col_tmp = 1;
+		while (true) {
+			Cell cell = rowBuildings.getCell(col_tmp);
+			if (cell == null) {
+				break;
+			}
+			String cellValue = GetCellValue(cell);
+			if (cellValue != null && cellValue.trim().length() > 0) {
+				result.titleColList.add(cellValue.trim());
+				col_tmp++;
+			} else {
+				break;
+			}
+		}
+
+		for (int index_row = row_from + 1; index_row <= row_to; index_row++) {
+			Row row = sheet.getRow(index_row);
+			List<String> contentList = new ArrayList<String>();
+			for (int index_col = 1; index_col < result.titleColList.size() + 1; index_col++) {
+				Cell cell = row.getCell(index_col);
+				String content = null;
+				if (cell != null) {
+					String cellValue = GetCellValue(cell);
+					if (cellValue != null && cellValue.trim().length() > 0) {
+						content = cellValue.trim();
+					}
+				}
+				contentList.add(content);
+			}
+			result.contentListList.add(contentList);
+		}
+
+		return result;
+	}
+
+	public static ExcelSheet GetSheetContent_titleCol(Sheet sheet) {
+		ExcelSheet result = new ExcelSheet();
+
+		int row_from = 0;
+		int row_to = sheet.getLastRowNum();
+
+		Row rowBuildings = sheet.getRow(row_from);
+		int index_last = rowBuildings.getLastCellNum();
+		for (int col_tmp = 0; col_tmp <= index_last; col_tmp++) {
+			Cell cell = rowBuildings.getCell(col_tmp);
+			String value = null;
+			if (cell != null) {
+				String cellValue = GetCellValue(cell);
+				if (cellValue != null && cellValue.trim().length() > 0) {
+					value = cellValue.trim();
+				}
+			}
+			result.titleColList.add(value);
+		}
+
+		for (int index_row = row_from + 1; index_row <= row_to; index_row++) {
+			Row row = sheet.getRow(index_row);
+			List<String> contentList = new ArrayList<String>();
+			if (row != null) {
+				for (int index_col = 0; index_col < result.titleColList.size(); index_col++) {
+					Cell cell = row.getCell(index_col);
+					String content = null;
+					if (cell != null) {
+						String cellValue = GetCellValue(cell);
+						if (cellValue != null && cellValue.trim().length() > 0) {
+							content = cellValue.trim();
+						}
+					}
+					contentList.add(content);
+				}
+			}
+			result.contentListList.add(contentList);
+		}
+
+		return result;
+	}
+
+	static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+
+	public static String GetCellValue(Cell cell) {
+		if (cell == null) {
+			return null;
+		}
+
+		String cellText = null;
+
+		try {
+			switch (cell.getCellType()) {
+			case Cell.CELL_TYPE_NUMERIC:
+				short format = cell.getCellStyle().getDataFormat();
+				if (format == 14 || format == 22 || format == 31 || format == 57 || format == 58 || format == 176 || format == 177 || format == 178) {
+					Date date = cell.getDateCellValue();
+					long floor = date.getTime() / (1000L * 60) * (1000L * 60);
+					long ceiling = floor + (1000L * 60);
+					Date parseDate;
+					if (date.getTime() - floor > ceiling - date.getTime()) {
+						parseDate = new Date(ceiling);
+					} else {
+						parseDate = new Date(floor);
+					}
+					cellText = sdf.format(parseDate);
+				} else {
+					cellText = "" + cell.getNumericCellValue();
+				}
+				break;
+			case Cell.CELL_TYPE_STRING:
+				cellText = cell.getStringCellValue();
+				break;
+			case Cell.CELL_TYPE_FORMULA:
+				cell.setCellType(Cell.CELL_TYPE_NUMERIC);
+				cellText = "" + cell.getNumericCellValue();
+				break;
+			case Cell.CELL_TYPE_BLANK:
+				break;
+			case Cell.CELL_TYPE_BOOLEAN:
+				break;
+			case Cell.CELL_TYPE_ERROR:
+				break;
+			default:
+			}
+		} catch (Exception e) {
+			// e.printStackTrace();
+		}
+
+		return cellText;
+	}
+
+}

+ 93 - 0
src/main/java/com/persagy/util/FastJsonReaderUtil.java

@@ -0,0 +1,93 @@
+package com.persagy.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.JSONReader;
+import com.alibaba.fastjson.JSONWriter;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
+public class FastJsonReaderUtil {
+	private static FastJsonReaderUtil instance = new FastJsonReaderUtil();
+
+	public static FastJsonReaderUtil Instance() {
+		return instance;
+	}
+
+	private FastJsonReaderUtil() {
+
+	}
+
+	public Object parse(byte[] JSON_bytes) throws Exception {
+		return this.parse(new String(JSON_bytes, "UTF-8"));
+	}
+
+	public Object parse(String JSONString) throws Exception {
+		Object result = JSON.parse(JSONString);
+		FastJsonUtil.Normalize(result);
+		return result;
+	}
+
+	public JSONObject ReadJSONObject(File file) throws Exception {
+		Object result = this.ReadInner(file);
+		if (result == null) {
+			return null;
+		} else {
+			FastJsonUtil.Normalize(result);
+			return (JSONObject) result;
+		}
+	}
+
+	public JSONArray ReadJSONArray(File file) throws Exception {
+		Object result = this.ReadInner(file);
+		if (result == null) {
+			return null;
+		} else {
+			FastJsonUtil.Normalize(result);
+			return (JSONArray) result;
+		}
+	}
+
+	private Object ReadInner(File file) throws Exception {
+		Object result = null;
+
+		InputStream is = new FileInputStream(file);
+		Reader reader = new InputStreamReader(is);
+		JSONReader json_reader = new JSONReader(reader);
+		result = json_reader.readObject();
+		json_reader.close();
+		reader.close();
+		is.close();
+
+		return result;
+	}
+
+	public void Write(JSONObject result, String filepath) throws Exception {
+		this.WriteInner(result, filepath);
+	}
+
+	public void Write(JSONArray result, String filepath) throws Exception {
+		this.WriteInner(result, filepath);
+	}
+
+	private void WriteInner(Object result, String filepath) throws Exception {
+		OutputStream os = new FileOutputStream(filepath);
+		Writer writer = new OutputStreamWriter(os);
+		JSONWriter json_writer = new JSONWriter(writer);
+		json_writer.config(SerializerFeature.WriteMapNullValue, false);
+		json_writer.writeObject(result);
+		json_writer.close();
+		writer.close();
+		os.close();
+	}
+}

+ 566 - 0
src/main/java/com/persagy/util/FastJsonUtil.java

@@ -0,0 +1,566 @@
+package com.persagy.util;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+public class FastJsonUtil {
+	public static Set<Object> ValueArray2ValueSet(JSONArray valueArray) {
+		Set<Object> valueSet = new HashSet<Object>();
+		for (int index_va = 0; index_va < valueArray.size(); index_va++) {
+			Object valueItem = valueArray.get(index_va);
+			valueSet.add(valueItem);
+		}
+		return valueSet;
+	}
+
+	public static JSONArray ValueSet2ValueArray(Set<Object> valueSet) {
+		JSONArray valueArray = new JSONArray();
+		Iterator<Object> valueIter = valueSet.iterator();
+		while (valueIter.hasNext()) {
+			Object valueItem = valueIter.next();
+			valueArray.add(valueItem);
+		}
+		return valueArray;
+	}
+
+	public static Set<Object> ValueSet_or(List<Set<Object>> valueSetList) {
+		Set<Object> result = new HashSet<Object>();
+		for (int i = 0; i < valueSetList.size(); i++) {
+			Set<Object> valueSet = valueSetList.get(i);
+			result.addAll(valueSet);
+		}
+		return result;
+	}
+
+	public static Set<Object> ValueSet_and(List<Set<Object>> valueSetList) {
+		Set<Object> result = new HashSet<Object>();
+		Set<Object> first = valueSetList.get(0);
+		Iterator<Object> valueIter = first.iterator();
+		while (valueIter.hasNext()) {
+			Object valueItem = valueIter.next();
+			boolean all_in = true;
+			for (int i = 1; i < valueSetList.size(); i++) {
+				Set<Object> valueSet = valueSetList.get(i);
+				if (!valueSet.contains(valueItem)) {
+					all_in = false;
+					break;
+				}
+			}
+			if (all_in) {
+				result.add(valueItem);
+			}
+		}
+		return result;
+	}
+
+	public static Set<Object> ValueSet_sub(Set<Object> valueSet1, Set<Object> valueSet2) {
+		Set<Object> result = new HashSet<Object>();
+		Iterator<Object> valueIter = valueSet1.iterator();
+		while (valueIter.hasNext()) {
+			Object valueItem = valueIter.next();
+			if (!valueSet2.contains(valueItem)) {
+				result.add(valueItem);
+			}
+		}
+		return result;
+	}
+
+	public static String toFormatString(Object value) {
+		return toStringInner(value, true);
+	}
+
+	public static String toString(Object value) {
+		return toStringInner(value, false);
+	}
+
+	private static String toStringInner(Object value, boolean has_enter) {
+		if (value == null)
+			return "null";
+
+		if (value instanceof String) {
+			StringBuffer sb = new StringBuffer();
+			escape((String) value, sb);
+			return "\"" + sb.toString() + "\"";
+		}
+
+		if (value instanceof Double) {
+			if (((Double) value).isInfinite() || ((Double) value).isNaN())
+				return "null";
+			else
+				return value.toString();
+		}
+
+		if (value instanceof Float) {
+			if (((Float) value).isInfinite() || ((Float) value).isNaN())
+				return "null";
+			else
+				return value.toString();
+		}
+
+		if (value instanceof Number)
+			return value.toString();
+
+		if (value instanceof Boolean)
+			return value.toString();
+
+		if (value instanceof JSONObject) {
+			JSONObject valueJSON = (JSONObject) value;
+			StringBuffer sb = new StringBuffer();
+			boolean first = true;
+			Iterator<String> iter = valueJSON.keySet().iterator();
+
+			sb.append('{');
+			while (iter.hasNext()) {
+				String key = iter.next();
+
+				if (first)
+					first = false;
+				else
+					sb.append(',');
+
+				if (has_enter) {
+					sb.append("\r\n\t");
+				}
+
+				sb.append('\"');
+				escape(key, sb);
+				sb.append('\"').append(':');
+				String valueString = toStringInner(valueJSON.get(key), has_enter);
+				sb.append(valueString.replaceAll("\r\n", "\r\n\t"));
+			}
+			if (has_enter) {
+				sb.append("\r\n");
+			}
+			sb.append('}');
+			return sb.toString();
+		}
+
+		if (value instanceof JSONArray) {
+			JSONArray valueJSON = (JSONArray) value;
+			boolean first = true;
+			StringBuffer sb = new StringBuffer();
+
+			sb.append('[');
+			for (int i = 0; i < valueJSON.size(); i++) {
+				if (first)
+					first = false;
+				else
+					sb.append(',');
+
+				if (has_enter) {
+					sb.append("\r\n\t");
+				}
+
+				Object valueInner = valueJSON.get(i);
+				if (valueInner == null) {
+					sb.append("null");
+					continue;
+				}
+				String valueString = toStringInner(valueInner, has_enter);
+				sb.append(valueString.replaceAll("\r\n", "\r\n\t"));
+			}
+			if (has_enter) {
+				sb.append("\r\n");
+			}
+			sb.append(']');
+			return sb.toString();
+
+		}
+
+		return value.toString();
+	}
+
+	public static void escape(String s, StringBuffer sb) {
+		for (int i = 0; i < s.length(); i++) {
+			char ch = s.charAt(i);
+			switch (ch) {
+			case '"':
+				sb.append("\\\"");
+				break;
+			case '\\':
+				sb.append("\\\\");
+				break;
+			case '\b':
+				sb.append("\\b");
+				break;
+			case '\f':
+				sb.append("\\f");
+				break;
+			case '\n':
+				sb.append("\\n");
+				break;
+			case '\r':
+				sb.append("\\r");
+				break;
+			case '\t':
+				sb.append("\\t");
+				break;
+			case '/':
+				sb.append("\\/");
+				break;
+			default:
+				// Reference: http://www.unicode.org/versions/Unicode5.1.0/
+				if ((ch >= '\u0000' && ch <= '\u001F') || (ch >= '\u007F' && ch <= '\u009F') || (ch >= '\u2000' && ch <= '\u20FF')) {
+					String ss = Integer.toHexString(ch);
+					sb.append("\\u");
+					for (int k = 0; k < 4 - ss.length(); k++) {
+						sb.append('0');
+					}
+					sb.append(ss.toUpperCase());
+				} else {
+					sb.append(ch);
+				}
+			}
+		} // for
+	}
+
+	public static Long getLong(JSONObject json, String name) throws Exception {
+		if (json.containsKey(name)) {
+			Object item = json.get(name);
+			if (item instanceof Integer) {
+				return ((Integer) item).longValue();
+			} else if (item instanceof Long) {
+				return ((Long) item).longValue();
+			} else if (item instanceof BigInteger) {
+				return ((BigInteger) item).longValue();
+			} else {
+				throw new Exception("FastJsonUtil: " + "JSON property " + name + " cant Cast to Long:" + FastJsonUtil.toFormatString(json));
+			}
+		} else {
+			return null;
+		}
+	}
+
+	public static Long getDouble(JSONObject json, String name) throws Exception {
+		if (json.containsKey(name)) {
+			Object item = json.get(name);
+			if (item instanceof Integer) {
+				return ((Integer) item).longValue();
+			} else if (item instanceof Long) {
+				return ((Long) item).longValue();
+			} else if (item instanceof BigInteger) {
+				return ((BigInteger) item).longValue();
+			} else if (item instanceof Float) {
+				return ((Float) item).longValue();
+			} else if (item instanceof Double) {
+				return ((Double) item).longValue();
+			} else if (item instanceof BigDecimal) {
+				return ((BigDecimal) item).longValue();
+			} else {
+				throw new Exception("FastJsonUtil: " + "JSON property " + name + " cant Cast to Double:" + FastJsonUtil.toFormatString(json));
+			}
+		} else {
+			return null;
+		}
+	}
+
+	public static void Set_JSON(Object entity, JSONObject json) throws Exception {
+		Class<?> targetClass = entity.getClass();
+
+		Method[] targetMethodArray = targetClass.getMethods();
+		for (int i = 0; i < targetMethodArray.length; i++) {
+			Method method = targetMethodArray[i];
+			int modifiers = method.getModifiers();
+			String methodName = method.getName();
+			if (modifiers == 1 && methodName.startsWith("get")) {
+				Class<?>[] parameterTypes = method.getParameterTypes();
+				if (parameterTypes.length == 0) {
+					String fieldName = methodName.substring(3);
+					fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1);
+					if (json.containsKey(fieldName)) {
+						json.remove(fieldName);
+					}
+					Object value = method.invoke(entity, new Object[] {});
+					if (value != null) {
+						String valueClassName = value.getClass().getName();
+						Object put_value = null;
+						if (valueClassName.equals("java.lang.String")) {
+							put_value = value;
+						} else if (valueClassName.equals("java.util.Date")) {
+							SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+							put_value = sdf.format((Date) value);
+						} else if (valueClassName.equals("java.lang.Long") || valueClassName.equals("long")) {
+							put_value = value;
+						} else if (valueClassName.equals("java.lang.Double") || valueClassName.equals("double")) {
+							put_value = value;
+						} else if (valueClassName.equals("java.lang.Boolean") || valueClassName.equals("boolean")) {
+							put_value = value;
+						} else {
+							put_value = To_JSON(value);
+						}
+
+						json.put(fieldName, put_value);
+					}
+				}
+			}
+		}
+	}
+
+	public static void Set_JavaObject(JSONObject json, Object entity) throws Exception {
+		Class<?> targetClass = entity.getClass();
+
+		if (json == null) {
+			return;
+		}
+
+		Method[] targetMethodArray = targetClass.getMethods();
+		for (int i = 0; i < targetMethodArray.length; i++) {
+			Method method = targetMethodArray[i];
+			int modifiers = method.getModifiers();
+			String methodName = method.getName();
+			if (modifiers == 1 && methodName.startsWith("set")) {
+				Class<?>[] parameterTypes = method.getParameterTypes();
+				if (parameterTypes.length == 1) {
+					String fieldName = methodName.substring(3);
+					fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1);
+					Class<?> paramClass = parameterTypes[0];
+					if (json.containsKey(fieldName)) {
+						Object sourceFieldValue = json.get(fieldName);
+						Object targetFieldValue = To_JavaObject(sourceFieldValue, paramClass);
+
+						method.invoke(entity, new Object[] { targetFieldValue });
+					}
+				}
+			}
+		}
+	}
+
+	public static Object To_JSON(Object source) throws Exception {
+		Class<?> sourceClass = source.getClass();
+		if (sourceClass.isArray()) {
+			JSONArray result = new JSONArray();
+			int array_length = Array.getLength(source);
+			for (int i = 0; i < array_length; i++) {
+				Object item = Array.get(source, i);
+				result.add(To_JSON(item));
+			}
+			return result;
+		} else {
+			JSONObject result = new JSONObject();
+			Method[] meethodArray = sourceClass.getMethods();
+			for (int i = 0; i < meethodArray.length; i++) {
+				Method method = meethodArray[i];
+				int modifiers = method.getModifiers();
+				String methodName = method.getName();
+				if (modifiers == 1 && methodName.startsWith("get")) {
+					Class<?>[] parameterTypes = method.getParameterTypes();
+					if (parameterTypes.length == 0) {
+						String fieldName = methodName.substring(3);
+						fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1);
+						Object value = method.invoke(source, new Object[] {});
+						Object put_value;
+						if (value == null) {
+							put_value = null;
+						} else {
+							String valueClassName = value.getClass().getName();
+							if (valueClassName.equals("java.lang.String")) {
+								put_value = value;
+							} else if (valueClassName.equals("java.util.Date")) {
+								SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+								put_value = sdf.format(value);
+							} else if (valueClassName.equals("java.lang.Long") || valueClassName.equals("long")) {
+								put_value = value;
+							} else if (valueClassName.equals("java.lang.Double") || valueClassName.equals("double")) {
+								put_value = value;
+							} else if (valueClassName.equals("java.lang.Boolean") || valueClassName.equals("boolean")) {
+								put_value = value;
+							} else {
+								put_value = To_JSON(value);
+							}
+						}
+						result.put(fieldName, put_value);
+					}
+				}
+			}
+			return result;
+		}
+	}
+
+	public static Object To_JavaObject(Object json, Class<?> entityClass) throws Exception {
+		if (json == null) {
+			return null;
+		}
+
+		String targetClassName = entityClass.getName();
+		if (json instanceof JSONArray && entityClass.isArray()) {
+			JSONArray sourceEntity = (JSONArray) json;
+			int sourceLength = sourceEntity.size();
+
+			Class<?> targetComponentType = entityClass.getComponentType();
+			Object targetObjectArray = Array.newInstance(targetComponentType, sourceLength);
+
+			for (int i = 0; i < sourceLength; i++) {
+				Object sourceObject = sourceEntity.get(i);
+
+				Object targetObject = To_JavaObject(sourceObject, targetComponentType);
+				Array.set(targetObjectArray, i, targetObject);
+			}
+
+			return targetObjectArray;
+		} else if (json instanceof JSONObject) {
+			JSONObject sourceEntity = (JSONObject) json;
+
+			Constructor<?> constructorMethod = entityClass.getConstructor(new Class<?>[] {});
+			Object targetObject = constructorMethod.newInstance(new Object[] {});
+			Method[] methodArray = entityClass.getMethods();
+			for (int i = 0; i < methodArray.length; i++) {
+				Method method = methodArray[i];
+				int modifiers = method.getModifiers();
+				String methodName = method.getName();
+				if (modifiers == 1 && methodName.startsWith("set")) {
+					Class<?>[] parameterTypes = method.getParameterTypes();
+					if (parameterTypes.length == 1) {
+						String fieldName = methodName.substring(3);
+						fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1);
+						Class<?> paramClass = parameterTypes[0];
+						if (sourceEntity.containsKey(fieldName)) {
+							Object sourceFieldValue = sourceEntity.get(fieldName);
+							Object targetFieldValue = To_JavaObject(sourceFieldValue, paramClass);
+
+							method.invoke(targetObject, new Object[] { targetFieldValue });
+						}
+					}
+				}
+			}
+
+			return targetObject;
+		} else if (json instanceof String && targetClassName.equals("java.lang.String")) {
+			return (String) json;
+		} else if (json instanceof String && targetClassName.equals("java.util.Date")) {
+			SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+			return sdf.parse((String) json);
+		} else if (targetClassName.equals("java.lang.Long") || targetClassName.equals("long")) {
+			if (json instanceof String) {
+				Long value = Long.parseLong((String) json);
+				return value;
+			} else if (json instanceof Integer) {
+				return ((Integer) json).longValue();
+			} else if (json instanceof Long) {
+				return ((Long) json).longValue();
+			} else if (json instanceof BigInteger) {
+				return ((BigInteger) json).longValue();
+			} else {
+				return null;
+			}
+		} else if (targetClassName.equals("java.lang.Double") || targetClassName.equals("double")) {
+			if (json instanceof String) {
+				Double value = Double.parseDouble((String) json);
+				return value;
+			} else if (json instanceof Integer) {
+				return ((Integer) json).doubleValue();
+			} else if (json instanceof Long) {
+				return ((Long) json).doubleValue();
+			} else if (json instanceof BigInteger) {
+				return ((BigInteger) json).doubleValue();
+			} else if (json instanceof Float) {
+				return ((Float) json).doubleValue();
+			} else if (json instanceof Double) {
+				return ((Double) json).doubleValue();
+			} else if (json instanceof BigDecimal) {
+				return ((BigDecimal) json).doubleValue();
+			} else {
+				return null;
+			}
+		} else if (targetClassName.equals("java.lang.Boolean") || targetClassName.equals("boolean")) {
+			if (json instanceof String) {
+				Boolean value = ((String) json).equalsIgnoreCase("true") ? true : false;
+				return value;
+			} else if (json instanceof Boolean) {
+				Boolean value = (Boolean) json;
+				return value;
+			} else {
+				return null;
+			}
+		} else {
+			return null;
+		}
+	}
+
+	public static void Normalize(Object source) {
+		if (source instanceof JSONObject) {
+			JSONObject sourceJSON = (JSONObject) source;
+			Map<String, Object> newMap = new HashMap<String, Object>();
+			Iterator<String> keyIter = sourceJSON.keySet().iterator();
+			while (keyIter.hasNext()) {
+				String key = keyIter.next();
+				Object value = sourceJSON.get(key);
+				if (value == null) {
+					continue;
+				}
+				if (value instanceof Integer) {
+					newMap.put(key, ((Integer) value).longValue());
+				} else if (value instanceof Long) {
+				} else if (value instanceof BigInteger) {
+					newMap.put(key, ((BigInteger) value).longValue());
+				} else if (value instanceof Float) {
+					newMap.put(key, ((Float) value).doubleValue());
+				} else if (value instanceof Double) {
+				} else if (value instanceof BigDecimal) {
+					newMap.put(key, ((BigDecimal) value).doubleValue());
+				} else if (value instanceof JSONObject || value instanceof JSONArray) {
+					Normalize(value);
+				}
+			}
+			Iterator<String> iter2 = newMap.keySet().iterator();
+			while (iter2.hasNext()) {
+				String key = iter2.next();
+				Object value = newMap.get(key);
+				sourceJSON.remove(key);
+				sourceJSON.put(key, value);
+			}
+		} else if (source instanceof JSONArray) {
+			JSONArray sourceJSON = (JSONArray) source;
+			for (int i = 0; i < sourceJSON.size(); i++) {
+				Object sourceItem = sourceJSON.get(i);
+				if (sourceItem != null && (sourceItem instanceof JSONObject || sourceItem instanceof JSONArray)) {
+					Normalize(sourceItem);
+				}
+			}
+		}
+	}
+
+	public static Object Clone_JSON(Object source) {
+		if (source instanceof JSONObject) {
+			JSONObject result = new JSONObject();
+			JSONObject sourceJSON = (JSONObject) source;
+			Iterator<String> keyIter = sourceJSON.keySet().iterator();
+			while (keyIter.hasNext()) {
+				String key = keyIter.next();
+				Object value = sourceJSON.get(key);
+				result.put(key, Clone_JSON(value));
+			}
+			return result;
+		} else if (source instanceof JSONArray) {
+			JSONArray result = new JSONArray();
+			JSONArray sourceJSON = (JSONArray) source;
+			for (int i = 0; i < sourceJSON.size(); i++) {
+				result.add(Clone_JSON(sourceJSON.get(i)));
+			}
+			return result;
+		} else if (source instanceof String) {
+			return source;
+		} else if (source instanceof Double) {
+			return source;
+		} else if (source instanceof Long) {
+			return source;
+		} else if (source instanceof Boolean) {
+			return source;
+		}
+
+		return null;
+	}
+}

+ 8 - 0
src/main/java/com/persagy/util/SequenceNo.java

@@ -0,0 +1,8 @@
+package com.persagy.util;
+
+import java.sql.Date;
+
+public class SequenceNo {
+	public Date time;
+	public int index = 1;
+}

+ 227 - 0
src/main/java/com/persagy/zkt_tool/ZKTAlarmMain.java

@@ -0,0 +1,227 @@
+package com.persagy.zkt_tool;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+import com.persagy.util.DataDictUtil;
+import com.persagy.util.ExcelSheet;
+import com.persagy.util.ExcelUtil;
+
+public class ZKTAlarmMain {
+	public static String url_dict = "http://39.102.54.110:8082/";
+	public static String url = "http://39.102.43.179:9983/";
+	public static String url_alarm = "http://39.102.54.110:8083/";
+	public static String appId = "zkt";
+	public static String projectId = "Pj4403070003";
+	public static String groupCode = "WD";
+	// public static String projectId = "Pj4403050019";
+	// public static String groupCode = "ZS";
+
+	public static Map<String, Map<String, Boolean>> systemMapMap = new HashMap<String, Map<String, Boolean>>();
+	public static Map<String, Map<String, Boolean>> equipmentMapMap = new HashMap<String, Map<String, Boolean>>();
+
+	public static String[] codeNames = { "掉线报警", "运行报警", "故障报警", "可燃气体报警", "防火门门磁开关故障", "防火门电动闭门器故障", "防火门电动开门器故障", "高温报警", "低温报警", "超高温报警", "超低温报警",
+			"供水压力偏高", "供水压力偏低", "供回水压差偏低", "回风温度偏高", "回风温度偏低" };
+	public static String[] alarm_categorys = { "掉线报警", "运行报警", "故障报警", "可燃气体报警", "防火门门磁开关故障", "防火门电动闭门器故障", "防火门电动开门器故障", "高温报警", "低温报警", "超高温报警",
+			"超低温报警", "供水压力偏高", "供水压力偏低", "供回水压差偏低", "回风温度偏高", "回风温度偏低" };
+	public static String[] item_codes = { "1005", "1007", "1008", "1040", "1041", "1042", "1043", "1044", "1045", "1046", "1047", "1048", "1049",
+			"1050", "1051", "1052" };
+	public static String[] infos = { "onlineStatus", "runStatus", "faultStatus", "indoorAirH", "indoorAirCO2", "outdoorAirH", "freshAirValveOpening",
+			"returnAirTemp", "returnAirRH", "returnAirValveOpening", "chillWaterOutTemp", "waterInOutDetaPress", "chillWaterValveOpening",
+			"supplyAirTemp", "fanFreq", "insulationValveStatus" };
+	public static int[] triggerUpholds = { 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 };
+	public static int[] endUpholds = { 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 };
+	public static Map<String, Integer> infoIndexMap = new HashMap<String, Integer>();
+
+	@SuppressWarnings("unused")
+	public static void main(String[] args) throws Exception {
+		ExcelSheet ExcelSheet = ExcelUtil.ReadSheet(Constant.GetPath() + "/info_code.xlsx", "Sheet1", true);
+		for (int i = 0; i < ExcelSheet.contentListList.size(); i++) {
+			String content1 = ExcelUtil.getContentInner(ExcelSheet, 5, i);
+			String content3 = ExcelUtil.getContentInner(ExcelSheet, 7, i);
+			String content5 = ExcelUtil.getContentInner(ExcelSheet, 10, i);
+			if (content1 == null || content5 == null) {
+				continue;
+			}
+			if (content3 == null || content3.length() == 0) {
+				if (!systemMapMap.containsKey(content1)) {
+					systemMapMap.put(content1, new HashMap<String, Boolean>());
+				}
+				systemMapMap.get(content1).put(content5.toLowerCase(), true);
+			} else {
+				if (!equipmentMapMap.containsKey(content3)) {
+					equipmentMapMap.put(content3, new HashMap<String, Boolean>());
+				}
+				equipmentMapMap.get(content3).put(content5.toLowerCase(), true);
+			}
+		}
+		{
+			for (int i = 0; i < infos.length; i++) {
+				infoIndexMap.put(infos[i], i);
+			}
+		}
+		{
+			JSONArray dataArray;
+			{
+				JSONObject classParam = new JSONObject();
+				classParam.put("criteria", new JSONObject());
+				JSONObject classTree = JSON
+						.parseObject(HttpUtil.Instance().post(url_dict + "rwd/def/class?projectId=" + projectId + "&groupCode=" + groupCode,
+								JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+				dataArray = (JSONArray) classTree.get("data");
+			}
+
+			for (int i = 0; i < dataArray.size(); i++) {
+				JSONObject data = (JSONObject) dataArray.get(i);
+				String objType = (String) data.get("objType");
+				if (objType == null || objType.length() == 0) {
+					continue;
+				}
+				String majorCode = (String) data.get("majorCode");
+				if (majorCode == null || majorCode.length() == 0) {
+					continue;
+				}
+				if (objType.equals("system") || objType.equals("equipment")) {
+					String code = (String) data.get("code");
+					if (code.equals("FFFSSN")) {
+						continue;
+					}
+					// if (!majorCode.equals("AC")) {
+					// continue;
+					// }
+
+					JSONArray objectArray = null;
+					{
+						JSONObject criteria = new JSONObject();
+						criteria.put("classCode", code);
+						JSONObject classParam = new JSONObject();
+						classParam.put("criteria", criteria);
+						JSONObject classTree = JSON.parseObject(
+								HttpUtil.Instance().post(url_dict + "rwd/instance/object/query?projectId=" + projectId + "&groupCode=" + groupCode,
+										JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+						objectArray = (JSONArray) classTree.get("data");
+						if (objectArray == null) {
+							objectArray = new JSONArray();
+						}
+					}
+
+					{
+						JSONObject criteria = new JSONObject();
+						criteria.put("classCode", code);
+						JSONObject classParam = new JSONObject();
+						classParam.put("criteria", criteria);
+						JSONObject classTree = JSON
+								.parseObject(HttpUtil.Instance().post(url_dict + "rwd/def/funcid?projectId=" + projectId + "&groupCode=" + groupCode,
+										JSON.toJSONString(classParam, SerializerFeature.WriteMapNullValue)));
+						JSONArray dataArrayInner = (JSONArray) classTree.get("data");
+						if (dataArrayInner != null && objectArray != null) {
+							String classCode = code;
+							for (int ii = 0; ii < dataArrayInner.size(); ii++) {
+								JSONObject info = (JSONObject) dataArrayInner.get(ii);
+								String info_code = (String) info.get("code");
+
+								boolean valid = false;
+								if (classCode.length() == 4) {
+									if (systemMapMap.containsKey(classCode.substring(2))
+											&& systemMapMap.get(classCode.substring(2)).containsKey(info_code.toLowerCase())) {
+										valid = true;
+									}
+								} else if (classCode.length() == 6) {
+									if (equipmentMapMap.containsKey(classCode.substring(2))
+											&& equipmentMapMap.get(classCode.substring(2)).containsKey(info_code.toLowerCase())) {
+										valid = true;
+									}
+								}
+								if (!valid) {
+									continue;
+								}
+
+								boolean is_run_param = false;
+								if (DataDictUtil.getInfoType(info) == 1) {
+									is_run_param = true;
+								} else if (DataDictUtil.getInfoType(info) == 2) {
+								}
+								if (!is_run_param) {
+									continue;
+								}
+
+								if (!infoIndexMap.containsKey(info_code)) {
+									continue;
+								}
+
+								String item_code = item_codes[infoIndexMap.get(info_code)];
+								String alarm_category = alarm_categorys[infoIndexMap.get(info_code)];
+								int triggerUphold = triggerUpholds[infoIndexMap.get(info_code)];
+								int endUphold = endUpholds[infoIndexMap.get(info_code)];
+								// alarm_target
+								if (true) {
+									JSONObject criteriaInner = new JSONObject();
+									criteriaInner.put("itemCode", item_code);
+									criteriaInner.put("classCode", code);
+									criteriaInner.put("concern", 0);
+									criteriaInner.put("open", 0);
+									criteriaInner.put("condition", condition(info_code, triggerUphold, endUphold));
+									JSONObject result = JSON
+											.parseObject(HttpUtil.Instance()
+													.post(url_alarm + "alarm/target/create?userId=System&groupCode=" + groupCode + "&projectId="
+															+ projectId + "&appId=" + appId,
+															JSON.toJSONString(criteriaInner, SerializerFeature.WriteMapNullValue)));
+									Constant.warn(result.toJSONString());
+								}
+
+								for (int index = 0; index < objectArray.size(); index++) {
+									JSONObject object = (JSONObject) objectArray.get(index);
+									String id = (String) object.get("id");
+
+									Object info_value = object.get(info_code);
+									if (false && info_value != null) {
+										JSONObject criteriaInner = new JSONObject();
+										criteriaInner.put("appId", appId);
+										criteriaInner.put("projectId", projectId);
+										criteriaInner.put("userId", "System");
+										criteriaInner.put("groupCode", groupCode);
+										criteriaInner.put("userDefined", "0");
+										criteriaInner.put("objId", id);
+										criteriaInner.put("itemCode", item_code);
+										criteriaInner.put("category", alarm_category);
+										criteriaInner.put("level", "S");
+										criteriaInner.put("open", 0);
+										criteriaInner.put("condition", condition(info_code, triggerUphold, endUphold));
+										JSONObject result = JSON.parseObject(HttpUtil.Instance().post(url + "alarm/updateConfig",
+												JSON.toJSONString(criteriaInner, SerializerFeature.WriteMapNullValue)));
+										Constant.warn(result.toJSONString());
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+
+	public static JSONObject condition(String info, int triggerUphold, int endUphold) {
+		JSONObject result = new JSONObject();
+		JSONArray infoCode = new JSONArray();
+		infoCode.add(info);
+		result.put("infoCode", infoCode);
+		result.put("trigger", info + ">" + 0.5);
+		result.put("end", info + "<" + 0.5);
+		result.put("triggerUphold", triggerUphold);
+		result.put("endUphold", endUphold);
+		JSONObject time = new JSONObject();
+		time.put("type", "period");
+		JSONObject period = new JSONObject();
+		period.put("$gt", "090000");
+		period.put("$lt", "210000");
+		time.put("period", period);
+		result.put("time", time);
+		return result;
+	}
+}

+ 288 - 0
src/main/java/com/persagy/zkt_tool/ZKTControlMain.java

@@ -0,0 +1,288 @@
+package com.persagy.zkt_tool;
+
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.pbsage.util.Constant;
+import com.pbsage.util.HttpUtil;
+
+public class ZKTControlMain {
+	public static String url_dict = "http://39.102.54.110:8082/";
+	public static String url = "http://39.102.43.179:9980/";
+	public static String appId = "zkt-control";
+	// public static String projectId = "Pj4403070003";
+	// public static String groupCode = "WD";
+	public static String projectId = "Pj4403050019";
+	public static String groupCode = "ZS";
+
+	public static Map<Integer, JSONObject> tabMap = new HashMap<Integer, JSONObject>();
+	public static Map<Integer, Map<String, JSONObject>> tab2ObjTypeMap = new HashMap<Integer, Map<String, JSONObject>>();
+	public static Map<String, Map<String, JSONObject>> ObjType2Infos = new HashMap<String, Map<String, JSONObject>>();
+
+	public static void main(String[] args) throws Exception {
+		{
+			JSONObject criteria = new JSONObject();
+			criteria.put("appId", appId);
+			criteria.put("projectId", projectId);
+			JSONObject result = JSON.parseObject(
+					HttpUtil.Instance().post(url + "control_tab/query", JSON.toJSONString(criteria, SerializerFeature.WriteMapNullValue)));
+			JSONArray Content = (JSONArray) result.get("Content");
+			for (int i = 0; i < Content.size(); i++) {
+				JSONObject tab = (JSONObject) Content.get(i);
+				int tabId = (Integer) tab.get("tabId");
+				tabMap.put(tabId, tab);
+
+				JSONObject criteriaInner = new JSONObject();
+				criteriaInner.put("appId", appId);
+				criteriaInner.put("projectId", projectId);
+				criteriaInner.put("tabId", tabId);
+				JSONObject resultInner = JSON.parseObject(HttpUtil.Instance().post(url + "model/equip_type/query",
+						JSON.toJSONString(criteriaInner, SerializerFeature.WriteMapNullValue)));
+				JSONArray ContentInner = (JSONArray) resultInner.get("Content");
+				Map<String, JSONObject> eqtype = new HashMap<String, JSONObject>();
+				for (int ii = 0; ii < ContentInner.size(); ii++) {
+					JSONObject itemInner = (JSONObject) ContentInner.get(ii);
+					String equipTypeId = (String) itemInner.get("equipTypeId");
+					eqtype.put(equipTypeId, itemInner);
+
+					if (!ObjType2Infos.containsKey(equipTypeId)) {
+						JSONObject criteriaInner2 = new JSONObject();
+						criteriaInner2.put("appId", appId);
+						criteriaInner2.put("projectId", projectId);
+						criteriaInner2.put("equipTypeId", equipTypeId);
+						JSONObject resultInner2 = JSON.parseObject(
+								HttpUtil.Instance().post(url + "info/query", JSON.toJSONString(criteriaInner2, SerializerFeature.WriteMapNullValue)));
+						JSONArray ContentInner2 = (JSONArray) resultInner2.get("Content");
+						Map<String, JSONObject> infos = new HashMap<String, JSONObject>();
+						for (int iii = 0; iii < ContentInner2.size(); iii++) {
+							JSONObject itemInner2 = (JSONObject) ContentInner2.get(iii);
+							String infoId = (String) itemInner2.get("infoId");
+							infos.put(infoId, itemInner2);
+						}
+						ObjType2Infos.put(equipTypeId, infos);
+					}
+				}
+				tab2ObjTypeMap.put(tabId, eqtype);
+			}
+		}
+
+		Create_mode();
+
+		Create_plan();
+
+		Bind_equip();
+
+		Bind_calendar("20201101", "20201130");
+	}
+
+	public static void Create_mode() throws Exception {
+		int index_color = 1;
+		Integer[] tabIds = tabMap.keySet().toArray(new Integer[0]);
+		for (Integer tabId : tabIds) {
+			for (int i = 0; i < 1; i++) {
+				JSONObject criteria = new JSONObject();
+				criteria.put("appId", appId);
+				criteria.put("projectId", projectId);
+				criteria.put("tabId", tabId);
+				criteria.put("name", "name" + "-" + tabId + "-" + (i + 1));
+				criteria.put("color", "color" + "-" + (index_color++));
+				criteria.put("modelOrder", i);
+				JSONObject result = JSON.parseObject(
+						HttpUtil.Instance().post(url + "model/create", JSON.toJSONString(criteria, SerializerFeature.WriteMapNullValue)));
+				Constant.warn(result.toJSONString());
+			}
+		}
+	}
+
+	public static void Create_plan() throws Exception {
+		DecimalFormat df = new DecimalFormat("00");
+		Integer[] tabIds = tabMap.keySet().toArray(new Integer[0]);
+		for (Integer tabId : tabIds) {
+			Map<String, JSONObject> ObjTypeMap = tab2ObjTypeMap.get(tabId);
+			JSONObject criteria = new JSONObject();
+			criteria.put("appId", appId);
+			criteria.put("projectId", projectId);
+			criteria.put("tabId", tabId);
+			JSONObject result = JSON
+					.parseObject(HttpUtil.Instance().post(url + "model/query", JSON.toJSONString(criteria, SerializerFeature.WriteMapNullValue)));
+			JSONArray Content = (JSONArray) result.get("Content");
+			if (Content == null) {
+				Content = new JSONArray();
+			}
+			for (int i = 0; i < Content.size(); i++) {
+				JSONObject tab = (JSONObject) Content.get(i);
+				String id = (String) tab.get("id");
+				String name = (String) tab.get("name");
+				if (!name.startsWith("name" + "-")) {
+					continue;
+				}
+
+				for (String ObjType : ObjTypeMap.keySet().toArray(new String[0])) {
+					String[] infos = ObjType2Infos.get(ObjType).keySet().toArray(new String[0]);
+					JSONObject criteria_plan = new JSONObject();
+					criteria_plan.put("appId", appId);
+					criteria_plan.put("projectId", projectId);
+					criteria_plan.put("modelId", id);
+					criteria_plan.put("equipType", ObjType);
+					criteria_plan.put("tabGroup", 0);
+					criteria_plan.put("name", ObjType);
+					criteria_plan.put("planOrder", 0);
+					JSONArray detail = new JSONArray();
+					int value = 1;
+					for (int index_time = 600; index_time < 1320; index_time += 60) {
+						int minute = index_time % 60;
+						int hour = index_time / 60;
+						String time = df.format(hour) + df.format(minute) + "00";
+						JSONObject detailItem = new JSONObject();
+						detailItem.put("timeType", 1);
+						detailItem.put("name", time);
+						detailItem.put("absoluteTime", time);
+						detailItem.put("offset", 0);
+						detailItem.put("detailOrder", 0);
+						JSONArray actions = new JSONArray();
+						for (String info : infos) {
+							JSONObject action = new JSONObject();
+							action.put("code", info);
+							action.put("name", info);
+							action.put("value", value);
+							actions.add(action);
+						}
+						detailItem.put("actions", actions);
+						detail.add(detailItem);
+						value++;
+						value %= 2;
+					}
+					criteria_plan.put("detail", detail);
+
+					JSONObject resultInner = JSON.parseObject(
+							HttpUtil.Instance().post(url + "plan/create", JSON.toJSONString(criteria_plan, SerializerFeature.WriteMapNullValue)));
+					Constant.warn(resultInner.toJSONString());
+				}
+			}
+		}
+	}
+
+	public static void Bind_equip() throws Exception {
+		Integer[] tabIds = tabMap.keySet().toArray(new Integer[0]);
+		for (Integer tabId : tabIds) {
+			Map<String, JSONObject> ObjTypeMap = tab2ObjTypeMap.get(tabId);
+			JSONObject criteria = new JSONObject();
+			criteria.put("appId", appId);
+			criteria.put("projectId", projectId);
+			criteria.put("tabId", tabId);
+			JSONObject result = JSON
+					.parseObject(HttpUtil.Instance().post(url + "model/query", JSON.toJSONString(criteria, SerializerFeature.WriteMapNullValue)));
+			JSONArray Content = (JSONArray) result.get("Content");
+			if (Content == null) {
+				Content = new JSONArray();
+			}
+			for (int i = 0; i < Content.size(); i++) {
+				JSONObject tab = (JSONObject) Content.get(i);
+				String id = (String) tab.get("id");
+				String name = (String) tab.get("name");
+				if (!name.startsWith("name" + "-")) {
+					continue;
+				}
+
+				for (String ObjType : ObjTypeMap.keySet().toArray(new String[0])) {
+					JSONObject criteriaInner = new JSONObject();
+					criteriaInner.put("classCode", ObjType);
+					JSONObject paramInner = new JSONObject();
+					paramInner.put("criteria", criteriaInner);
+					JSONObject equipmentsResult = JSON.parseObject(
+							HttpUtil.Instance().post(url_dict + "rwd/instance/object/query?projectId=" + projectId + "&groupCode=" + groupCode,
+									JSON.toJSONString(paramInner, SerializerFeature.WriteMapNullValue)));
+					JSONArray equipments = (JSONArray) equipmentsResult.get("data");
+					if (equipments == null) {
+						equipments = new JSONArray();
+					}
+
+					JSONObject criteria_plan = new JSONObject();
+					criteria_plan.put("appId", appId);
+					criteria_plan.put("projectId", projectId);
+					criteria_plan.put("modelId", id);
+					criteria_plan.put("equipType", ObjType);
+					JSONObject resultInner = JSON.parseObject(
+							HttpUtil.Instance().post(url + "plan/query", JSON.toJSONString(criteria_plan, SerializerFeature.WriteMapNullValue)));
+					JSONArray ContentInner = (JSONArray) resultInner.get("Content");
+					for (int ii = 0; ii < ContentInner.size(); ii++) {
+						JSONObject plan = (JSONObject) ContentInner.get(ii);
+						String planId = (String) plan.get("id");
+						JSONArray binding = new JSONArray();
+						for (int iii = 0; iii < equipments.size(); iii++) {
+							JSONObject equipment = (JSONObject) equipments.get(iii);
+							String equipId = (String) equipment.get("id");
+							JSONObject bindingItem = new JSONObject();
+							bindingItem.put("planId", planId);
+							bindingItem.put("equipId", equipId);
+							binding.add(bindingItem);
+						}
+						JSONObject paramBinding = new JSONObject();
+						paramBinding.put("appId", appId);
+						paramBinding.put("projectId", projectId);
+						paramBinding.put("modelId", id);
+						paramBinding.put("binding", binding);
+						JSONObject bindingResult = JSON.parseObject(HttpUtil.Instance().post(url + "plan/equip/binding",
+								JSON.toJSONString(paramBinding, SerializerFeature.WriteMapNullValue)));
+						Constant.warn(bindingResult.toJSONString());
+					}
+				}
+			}
+		}
+	}
+
+	public static void Bind_calendar(String string_from, String string_to) throws Exception {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+		Date date_from = sdf.parse(string_from);
+		Date date_to = sdf.parse(string_to);
+		JSONArray date = new JSONArray();
+		for (Date tmp = date_from; tmp.getTime() <= date_to.getTime(); tmp = new Date(tmp.getTime() + 1000L * 60 * 60 * 24)) {
+			date.add(sdf.format(tmp));
+		}
+		Integer[] tabIds = tabMap.keySet().toArray(new Integer[0]);
+		for (Integer tabId : tabIds) {
+			JSONObject criteria = new JSONObject();
+			criteria.put("appId", appId);
+			criteria.put("projectId", projectId);
+			criteria.put("tabId", tabId);
+			JSONObject result = JSON
+					.parseObject(HttpUtil.Instance().post(url + "model/query", JSON.toJSONString(criteria, SerializerFeature.WriteMapNullValue)));
+			JSONArray Content = (JSONArray) result.get("Content");
+			if (Content == null) {
+				Content = new JSONArray();
+			}
+			String first_id = null;
+			for (int i = 0; i < Content.size(); i++) {
+				JSONObject tab = (JSONObject) Content.get(i);
+				String id = (String) tab.get("id");
+				String name = (String) tab.get("name");
+				if (!name.startsWith("name" + "-")) {
+					continue;
+				}
+				first_id = id;
+				break;
+			}
+
+			JSONObject criteriaInner = new JSONObject();
+			criteriaInner.put("appId", appId);
+			criteriaInner.put("projectId", projectId);
+			criteriaInner.put("date", date);
+			JSONArray model = new JSONArray();
+			JSONObject modelItem = new JSONObject();
+			modelItem.put("tabId", tabId);
+			modelItem.put("modelId", first_id);
+			model.add(modelItem);
+			criteriaInner.put("model", model);
+			JSONObject resultInner = JSON.parseObject(
+					HttpUtil.Instance().post(url + "calendar/model/binding", JSON.toJSONString(criteriaInner, SerializerFeature.WriteMapNullValue)));
+			Constant.warn(resultInner.toJSONString());
+		}
+	}
+}

+ 9 - 0
src/main/resources/config.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+	<data_middle url="http://192.168.100.33:9909/dmp-rwd/" />
+	<!--<data_middle url="http://39.102.54.110:8082/" /> -->
+	<!--<data_middle url="http://183.230.167.120:30000/dmp-rwd/"/> -->
+	<!-- http://183.230.167.120:30000/ -->
+
+	<metadata_web url="http://192.168.100.33:9909/metadata-web/" />
+</root>

二進制
src/main/resources/info_code-WD.xlsx


二進制
src/main/resources/info_code-WD/6.18室外传感器.xlsx


二進制
src/main/resources/info_code-XG.xlsx


二進制
src/main/resources/info_code-XG/info_code-XG.xlsx


二進制
src/main/resources/info_code-ZS.xlsx


二進制
src/main/resources/info_code-all.xlsx


二進制
src/main/resources/info_code-old.xlsx


二進制
src/main/resources/info_code-system.xlsx


+ 17 - 0
src/main/resources/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=%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=%m%n

+ 139 - 0
src/main/resources/scene-equipment-overview.json

@@ -0,0 +1,139 @@
+{
+	"Name": "设备总览",
+	"Properties": [
+		{
+			"Name": "我的工作台",
+			"Variables": [
+				{
+					"Name": "alarms",
+					"Value": "Brother_设备`alarms"
+				}
+			],
+			"Properties": [
+				{
+					"Name": "未处理",
+					"Variables": [
+						{
+							"Name": "alarms",
+							"Value": "select * from Parent`alarms where status=`unprocessed`"
+						}
+					],
+					"Properties": [
+						{
+							"Name": "数量",
+							"Value": "alarms`count"
+						},
+						{
+							"Name": "条目",
+							"ValueSource": "alarms"
+						}
+					]
+				},
+				{
+					"Name": "已处理",
+					"Variables": [
+						{
+							"Name": "alarms",
+							"Value": "select * from Parent`alarms where status=`processed`"
+						}
+					],
+					"Properties": [
+						{
+							"Name": "数量",
+							"Value": "alarms`count"
+						},
+						{
+							"Name": "条目",
+							"Value": "alarms"
+						}
+					]
+				}
+			]
+		},
+		{
+			"Name": "设备",
+			"Properties": [
+				{
+					"Name": "暖通空调设备",
+					"Params": [
+						{
+							"Name": "classCode",
+							"Value": "ACCCCC"
+						}
+					],
+					"Variables": [
+						{
+							"Name": "alarms",
+							"Value": "children`items`alarms"
+						}
+					],
+					"Properties": [
+						{
+							"Name": "alarm_count",
+							"Value": "@alarms`Count"
+						},
+						{
+							"Name": "children",
+							"Properties": [
+								{
+									"Name": "冷机",
+									"Variables": [
+										{
+											"Name": "objects",
+											"ValueType": "array",
+											"Value": "select * from object where classCode=@Parent`Param`classCode"
+										},
+										{
+											"Name": "alarms",
+											"Value": "Properties`items`alarms"
+										}
+									],
+									"Properties": [
+										{
+											"Name": "run_count",
+											"Value": "select count(*) from items where runStatus=1"
+										},
+										{
+											"Name": "total_count",
+											"Value": "select count(*) from items"
+										},
+										{
+											"Name": "alarm_count",
+											"Value": "select count(*) from items where alarms`Count>0"
+										},
+										{
+											"Name": "items",
+											"ValueType": "array",
+											"ItemSource": "Var`objects",
+											"ItemIncludeFilter": [
+												"id",
+												"bimId"
+											],
+											"ItemExcludeFilter": [
+												"bimId"
+											],
+											"ItemAdditionalProperties": [
+												{
+													"Name": "name",
+													"Value": "@object`localName"
+												},
+												{
+													"Name": "runStatus",
+													"Value": "@object`runStatus"
+												},
+												{
+													"Name": "alarms",
+													"Value": "select * from alarm where id=@object`id"
+												}
+											]
+										}
+									]
+								}
+							]
+						}
+					]
+				}
+			]
+		}
+	]
+}

+ 22 - 0
src/test/java/com/persagy/data_dict_tool/TestDict.java

@@ -0,0 +1,22 @@
+package com.persagy.data_dict_tool;
+
+public class TestDict {
+
+	public static void main(String[] args) throws Exception {
+		// JSONObject json = (JSONObject) JSONReaderUtil.Instance().Read(new File("D:\\Test\\gg.json"));
+		// Constant.warn(json.toJSONString());
+		//
+		// String classTree = HttpUtil.Instance().get("http://192.168.3.203:8080/dict/class");
+		// Constant.warn(classTree);
+		//
+		// JSONObject param = new JSONObject();
+		// JSONObject criteria = new JSONObject();
+		// criteria.put("classCode", "ACCCOT");
+		// param.put("criteria", criteria);
+		// String objectArray = HttpUtil.Instance().post(
+		// "http://192.168.3.203:8080/world/object/query?projectId=Pj1101050029&appId=datautils",
+		// param.toJSONString());
+		// Constant.warn(objectArray);
+	}
+
+}