Browse Source

init project

zhangqiankun 2 years ago
commit
1f74099e57
100 changed files with 9623 additions and 0 deletions
  1. 296 0
      .gitignore
  2. 373 0
      pom.xml
  3. 17 0
      src/main/java/com/persagy/common/criteria/CriteriaExpressionParser.java
  4. 472 0
      src/main/java/com/persagy/common/criteria/CriteriaUtils.java
  5. 514 0
      src/main/java/com/persagy/common/criteria/JacksonCriteria.java
  6. 261 0
      src/main/java/com/persagy/common/date/DateUtils.java
  7. 222 0
      src/main/java/com/persagy/common/json/JacksonMapper.java
  8. 49 0
      src/main/java/com/persagy/common/web/BaseResponse.java
  9. 28 0
      src/main/java/com/persagy/common/web/ListResponse.java
  10. 42 0
      src/main/java/com/persagy/common/web/MapResponse.java
  11. 27 0
      src/main/java/com/persagy/common/web/PagedResponse.java
  12. 80 0
      src/main/java/com/persagy/common/web/ServletUtils.java
  13. 38 0
      src/main/java/com/persagy/dmp/AutoConfiguration.java
  14. 20 0
      src/main/java/com/persagy/dmp/annotation/EnableRedisCache.java
  15. 151 0
      src/main/java/com/persagy/dmp/aspect/FeignClientAspect.java
  16. 12 0
      src/main/java/com/persagy/dmp/auth/Anonymous.java
  17. 34 0
      src/main/java/com/persagy/dmp/auth/AuthManager.java
  18. 88 0
      src/main/java/com/persagy/dmp/auth/AuthenticationInterceptor.java
  19. 134 0
      src/main/java/com/persagy/dmp/auth/JwtHelper.java
  20. 77 0
      src/main/java/com/persagy/dmp/cache/DataDictCache.java
  21. 228 0
      src/main/java/com/persagy/dmp/cache/LocationCache.java
  22. 118 0
      src/main/java/com/persagy/dmp/cache/MeterFuncCache.java
  23. 178 0
      src/main/java/com/persagy/dmp/cache/ObjectCache.java
  24. 83 0
      src/main/java/com/persagy/dmp/cache/RedisCache.java
  25. 98 0
      src/main/java/com/persagy/dmp/cache/RelationCache.java
  26. 91 0
      src/main/java/com/persagy/dmp/client/AlarmNewServerClient.java
  27. 38 0
      src/main/java/com/persagy/dmp/client/DicServerClient.java
  28. 74 0
      src/main/java/com/persagy/dmp/client/EmsCollectClient.java
  29. 113 0
      src/main/java/com/persagy/dmp/client/EmsControlClient.java
  30. 66 0
      src/main/java/com/persagy/dmp/client/GroupServerClient.java
  31. 66 0
      src/main/java/com/persagy/dmp/client/OrgServerClient.java
  32. 49 0
      src/main/java/com/persagy/dmp/client/PersonCenterClient.java
  33. 192 0
      src/main/java/com/persagy/dmp/client/RwdServerClient.java
  34. 28 0
      src/main/java/com/persagy/dmp/client/RwdServerClientNew.java
  35. 37 0
      src/main/java/com/persagy/dmp/common/DmpResult.java
  36. 49 0
      src/main/java/com/persagy/dmp/common/IntegratedResponseResult.java
  37. 74 0
      src/main/java/com/persagy/dmp/common/IntegratedResponseResultUtil.java
  38. 60 0
      src/main/java/com/persagy/dmp/common/PageResult.java
  39. 35 0
      src/main/java/com/persagy/dmp/common/VideoResult.java
  40. 46 0
      src/main/java/com/persagy/dmp/common/url/AlarmUrlParam.java
  41. 47 0
      src/main/java/com/persagy/dmp/common/url/ClassUrParam.java
  42. 47 0
      src/main/java/com/persagy/dmp/common/url/DicUrlParam.java
  43. 46 0
      src/main/java/com/persagy/dmp/common/url/FuncIdUrParam.java
  44. 37 0
      src/main/java/com/persagy/dmp/common/url/IOTUrlParam.java
  45. 46 0
      src/main/java/com/persagy/dmp/common/url/InstanceUrlParam.java
  46. 36 0
      src/main/java/com/persagy/dmp/config/AlarmJsonResult.java
  47. 72 0
      src/main/java/com/persagy/dmp/config/CacheConfiguration.java
  48. 71 0
      src/main/java/com/persagy/dmp/config/CrossOriginFilter.java
  49. 32 0
      src/main/java/com/persagy/dmp/config/DmpProperties.java
  50. 177 0
      src/main/java/com/persagy/dmp/config/DmpRwdReceiver.java
  51. 35 0
      src/main/java/com/persagy/dmp/config/FeignInterceptorConfig.java
  52. 62 0
      src/main/java/com/persagy/dmp/config/FeignLogger.java
  53. 55 0
      src/main/java/com/persagy/dmp/config/HttpFilterConfig.java
  54. 36 0
      src/main/java/com/persagy/dmp/config/RabbitMQConfig.java
  55. 166 0
      src/main/java/com/persagy/dmp/config/WebConfig.java
  56. 80 0
      src/main/java/com/persagy/dmp/constant/CommonConstant.java
  57. 113 0
      src/main/java/com/persagy/dmp/constant/DmpConstant.java
  58. 40 0
      src/main/java/com/persagy/dmp/constant/GeneralDictionaryConstant.java
  59. 45 0
      src/main/java/com/persagy/dmp/constant/LogConstant.java
  60. 17 0
      src/main/java/com/persagy/dmp/constant/RabbitMQConstant.java
  61. 100 0
      src/main/java/com/persagy/dmp/constant/RedisConstant.java
  62. 295 0
      src/main/java/com/persagy/dmp/constant/RequestUrlConstant.java
  63. 92 0
      src/main/java/com/persagy/dmp/constant/ResponseCode.java
  64. 42 0
      src/main/java/com/persagy/dmp/constant/ResponseMsg.java
  65. 40 0
      src/main/java/com/persagy/dmp/constant/UserConstant.java
  66. 65 0
      src/main/java/com/persagy/dmp/dao/CollectDao.java
  67. 100 0
      src/main/java/com/persagy/dmp/dao/ControlDao.java
  68. 63 0
      src/main/java/com/persagy/dmp/dao/DefDao.java
  69. 44 0
      src/main/java/com/persagy/dmp/dao/DicDao.java
  70. 30 0
      src/main/java/com/persagy/dmp/dao/FireAlarmDao.java
  71. 20 0
      src/main/java/com/persagy/dmp/dao/GeneralDictionaryDao.java
  72. 19 0
      src/main/java/com/persagy/dmp/dao/GroupProjectRelDao.java
  73. 150 0
      src/main/java/com/persagy/dmp/dao/IOTDao.java
  74. 470 0
      src/main/java/com/persagy/dmp/dao/InstanceDao.java
  75. 15 0
      src/main/java/com/persagy/dmp/dao/ObjectClassConfigBlackDao.java
  76. 15 0
      src/main/java/com/persagy/dmp/dao/ObjectClassConfigDao.java
  77. 16 0
      src/main/java/com/persagy/dmp/dao/ObjectClassFuncRelDao.java
  78. 15 0
      src/main/java/com/persagy/dmp/dao/ObjectGroupConfigDao.java
  79. 15 0
      src/main/java/com/persagy/dmp/dao/ObjectGroupRelConfigDao.java
  80. 19 0
      src/main/java/com/persagy/dmp/dao/ObjectMeterFunctionDao.java
  81. 20 0
      src/main/java/com/persagy/dmp/dao/OperationLogDao.java
  82. 16 0
      src/main/java/com/persagy/dmp/dao/OrgDao.java
  83. 18 0
      src/main/java/com/persagy/dmp/dao/ZktJarRoleDao.java
  84. 10 0
      src/main/java/com/persagy/dmp/dao/ZktModuleDao.java
  85. 44 0
      src/main/java/com/persagy/dmp/dao/impl/CollectDaoImpl.java
  86. 59 0
      src/main/java/com/persagy/dmp/dao/impl/ControlDaoImpl.java
  87. 107 0
      src/main/java/com/persagy/dmp/dao/impl/DefDaoImpl.java
  88. 60 0
      src/main/java/com/persagy/dmp/dao/impl/DicDaoImpl.java
  89. 335 0
      src/main/java/com/persagy/dmp/dao/impl/IOTDaoImpl.java
  90. 972 0
      src/main/java/com/persagy/dmp/dao/impl/InstanceDaoImpl.java
  91. 102 0
      src/main/java/com/persagy/dmp/dao/impl/OrgDaoImpl.java
  92. 38 0
      src/main/java/com/persagy/dmp/dto/CategoryDTO.java
  93. 40 0
      src/main/java/com/persagy/dmp/dto/ClassInfo.java
  94. 58 0
      src/main/java/com/persagy/dmp/dto/CurrentDataDTO.java
  95. 25 0
      src/main/java/com/persagy/dmp/dto/DataQueryDTO.java
  96. 29 0
      src/main/java/com/persagy/dmp/dto/DataTimeDTO.java
  97. 32 0
      src/main/java/com/persagy/dmp/dto/DeptJobId.java
  98. 58 0
      src/main/java/com/persagy/dmp/dto/EquipBelongModularDTO.java
  99. 57 0
      src/main/java/com/persagy/dmp/dto/EquipLocationDTO.java
  100. 0 0
      src/main/java/com/persagy/dmp/dto/FuncIdQueryDTO.java

+ 296 - 0
.gitignore

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

+ 373 - 0
pom.xml

@@ -0,0 +1,373 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.persagy</groupId>
+	<artifactId>bdos-common</artifactId>
+	<version>2.0.0</version>
+    <description>BDOS通用类</description>
+	
+	<properties>
+		<!-- java版本 -->
+		<java.version>8</java.version>
+		<java.encoding>UTF-8</java.encoding>
+		<java.source.version>1.8</java.source.version>
+		<java.target.version>1.8</java.target.version>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		
+		<!-- 三方jar -->
+		<integrated-platform.version>1.0.0</integrated-platform.version>
+        <mybatis-plus.version>3.3.0</mybatis-plus.version>
+        <java.version>1.8</java.version>
+        <poi.version>4.1.2</poi.version>
+        <jwt.version>0.9.1</jwt.version>
+        <transmittable.version>2.11.5</transmittable.version>
+		
+		<!-- maven依赖 -->
+		<maven.compiler.version>3.8.0</maven.compiler.version>
+		<maven.surefire.version>2.22.1</maven.surefire.version>
+		<maven.source.version>3.0.1</maven.source.version>
+		<maven.javadoc.version>3.0.1</maven.javadoc.version>
+		<maven.gpg.version>1.6</maven.gpg.version>
+		<maven.jacoco.version>0.8.3</maven.jacoco.version>
+		<maven.jar.version>3.1.0</maven.jar.version>
+		<maven.pmd.version>3.8</maven.pmd.version>
+	</properties>
+	
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>com.persagy.alibaba</groupId>
+				<artifactId>integrated-platform</artifactId>
+				<version>${integrated-platform.version}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+    <dependencies>
+    	<dependency>
+	    	<groupId>com.thoughtworks.xstream</groupId>
+	      	<artifactId>xstream</artifactId>
+	      	<version>1.4.18</version>
+		</dependency>
+		
+		<!-- integrated -->
+		<dependency>
+		    <groupId>com.persagy.alibaba</groupId>
+		    <artifactId>integrated-loadbalancer-spring-boot-starter</artifactId>
+		</dependency>
+		
+		<dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-bootstrap</artifactId>
+        </dependency>
+		<dependency>
+            <groupId>com.querydsl</groupId>
+            <artifactId>querydsl-jpa</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-logging</artifactId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>hibernate-validator</artifactId>
+                    <groupId>org.hibernate.validator</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+            <version>${jwt.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatis-plus.version}</version>
+            <exclusions>
+            	<exclusion>
+            		<groupId>com.zaxxer</groupId>
+   					<artifactId>HikariCP</artifactId>
+            	</exclusion>
+            </exclusions>
+        </dependency>
+
+        <!-- swagger -->
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+            <!--在引用时请在maven中央仓库搜索最新版本号 -->
+            <version>2.0.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-cache</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.ben-manes.caffeine</groupId>
+            <artifactId>caffeine</artifactId>
+            <version>2.8.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.data</groupId>
+            <artifactId>spring-data-commons</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mapstruct</groupId>
+            <!-- jdk8以下就使用mapstruct -->
+            <artifactId>mapstruct-jdk8</artifactId>
+            <version>1.2.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mapstruct</groupId>
+            <artifactId>mapstruct-processor</artifactId>
+            <version>1.2.0.Final</version>
+        </dependency>
+        <!-- spring boot redis依赖 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <!-- RabbitMQ -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+        <!-- poi 解析excel -->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>${poi.version}</version>
+        </dependency>
+    </dependencies>
+
+
+	<build>
+		<finalName>${project.artifactId}</finalName>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+				<executions>
+					<execution>
+						<goals>
+							<goal>repackage</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-pmd-plugin</artifactId>
+				<version>${maven.pmd.version}</version>
+				<configuration>
+					<sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
+					<minimumPriority>1</minimumPriority>
+					<excludeRoots>
+						<excludeRoot>com/alibaba/csp/sentinel/benchmark</excludeRoot>
+					</excludeRoots>
+					<excludes>
+						<exclude>**/*_jmhTest.java</exclude>
+					</excludes>
+					<printFailingErrors>true</printFailingErrors>
+					<rulesets>
+						<ruleset>rulesets/java/ali-comment.xml</ruleset>
+						<!-- <ruleset>rulesets/java/ali-concurrent.xml</ruleset> -->
+						<ruleset>rulesets/java/ali-constant.xml</ruleset>
+						<ruleset>rulesets/java/ali-exception.xml</ruleset>
+						<ruleset>rulesets/java/ali-flowcontrol.xml</ruleset>
+						<ruleset>rulesets/java/ali-naming.xml</ruleset>
+						<ruleset>rulesets/java/ali-oop.xml</ruleset>
+						<ruleset>rulesets/java/ali-orm.xml</ruleset>
+						<ruleset>rulesets/java/ali-other.xml</ruleset>
+						<ruleset>rulesets/java/ali-set.xml</ruleset>
+					</rulesets>
+				</configuration>
+				<executions>
+					<execution>
+						<phase>verify</phase>
+						<goals>
+							<goal>check</goal>
+						</goals>
+					</execution>
+				</executions>
+				<dependencies>
+					<dependency>
+						<groupId>com.alibaba.p3c</groupId>
+						<artifactId>p3c-pmd</artifactId>
+						<version>1.3.6</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>${maven.compiler.version}</version>
+				<configuration>
+					<source>${java.source.version}</source>
+					<target>${java.target.version}</target>
+					<encoding>${java.encoding}</encoding>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<!-- CircleCI build workaround -->
+					<argLine>@{argLine} -Xms1024m -Xmx2048m</argLine>
+					<argLine>-Dfile.encoding=UTF-8</argLine>
+					<useSystemClassLoader>false</useSystemClassLoader>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.jacoco</groupId>
+				<artifactId>jacoco-maven-plugin</artifactId>
+				<version>${maven.jacoco.version}</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>prepare-agent</goal>
+						</goals>
+					</execution>
+					<execution>
+						<id>report</id>
+						<phase>test</phase>
+						<goals>
+							<goal>report</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-surefire-plugin</artifactId>
+					<version>${maven.surefire.version}</version>
+				</plugin>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-jar-plugin</artifactId>
+					<version>${maven.jar.version}</version>
+				</plugin>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-gpg-plugin</artifactId>
+					<version>${maven.gpg.version}</version>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+
+	<profiles>
+		<profile>
+			<build>
+				<plugins>
+					<!-- Source -->
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-source-plugin</artifactId>
+						<version>${maven.source.version}</version>
+						<executions>
+							<execution>
+								<phase>package</phase>
+								<goals>
+									<goal>jar-no-fork</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+					<!-- Javadoc -->
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-javadoc-plugin</artifactId>
+						<version>${maven.javadoc.version}</version>
+						<executions>
+							<execution>
+								<phase>package</phase>
+								<goals>
+									<goal>jar</goal>
+								</goals>
+								<configuration>
+									<locale>en_US</locale>
+									<encoding>UTF-8</encoding>
+									<charset>UTF-8</charset>
+									<doclint>none</doclint>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+					<!-- GPG -->
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-gpg-plugin</artifactId>
+						<version>${maven.gpg.version}</version>
+						<executions>
+							<execution>
+								<phase>verify</phase>
+								<goals>
+									<goal>sign</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+
+		</profile>
+	</profiles>
+
+	<repositories>
+		<repository>
+			<id>persagy</id>
+			<name>releases Repository</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/persagy/</url>
+		</repository>
+
+		<repository>
+			<id>integrated</id>
+			<name>releases Repository</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/integrated/</url>
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+		</repository>
+		<repository>
+			<id>aliyun</id>
+			<name>releases Repository</name>
+			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
+		</repository>
+	</repositories>
+
+	<distributionManagement>
+		<repository>
+			<id>integrated</id>
+			<name>releases Repository</name>
+			<url>http://47.93.132.139:8081/nexus/content/repositories/integrated/</url>
+		</repository>
+	</distributionManagement>
+	
+	<pluginRepositories>
+		<pluginRepository>
+			<id>central</id>
+			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
+		</pluginRepository>
+	</pluginRepositories>
+
+</project>

+ 17 - 0
src/main/java/com/persagy/common/criteria/CriteriaExpressionParser.java

@@ -0,0 +1,17 @@
+package com.persagy.common.criteria;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.querydsl.core.types.dsl.BooleanExpression;
+
+import java.util.List;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ */
+public interface CriteriaExpressionParser {
+
+	List<BooleanExpression> parse(ObjectNode criteria);
+
+}

+ 472 - 0
src/main/java/com/persagy/common/criteria/CriteriaUtils.java

@@ -0,0 +1,472 @@
+package com.persagy.common.criteria;
+
+import java.lang.reflect.Field;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.DoubleNode;
+import com.fasterxml.jackson.databind.node.IntNode;
+import com.fasterxml.jackson.databind.node.JsonNodeType;
+import com.fasterxml.jackson.databind.node.LongNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.fasterxml.jackson.databind.node.TextNode;
+import com.persagy.common.date.DateUtils;
+import com.persagy.common.web.PagedResponse;
+import com.querydsl.core.types.OrderSpecifier;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import com.querydsl.core.types.dsl.DateTimeExpression;
+import com.querydsl.core.types.dsl.DateTimePath;
+import com.querydsl.core.types.dsl.EntityPathBase;
+import com.querydsl.core.types.dsl.EnumExpression;
+import com.querydsl.core.types.dsl.NumberExpression;
+import com.querydsl.core.types.dsl.NumberPath;
+import com.querydsl.core.types.dsl.StringExpression;
+import com.querydsl.core.types.dsl.StringPath;
+import com.querydsl.jpa.impl.JPAQuery;
+import com.querydsl.jpa.impl.JPAQueryFactory;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ */
+public class CriteriaUtils {
+
+	private static final Integer DEFAULT_SIZE = 50;
+
+	private JPAQueryFactory queryFactory;
+
+	public CriteriaUtils(JPAQueryFactory queryFactory) {
+		this.queryFactory = queryFactory;
+	}
+
+	private <T, Q extends EntityPathBase<T>> List<BooleanExpression> parseNode(Q q, ObjectNode object) {
+		List<BooleanExpression> exps = new LinkedList<>();
+		if (object == null || object.isEmpty()) {
+			return exps;
+		}
+
+		Field[] fields = q.getClass().getFields();
+		for (Field field : fields) {
+			Class<?> type = field.getType();
+			if (type != NumberPath.class && type != DateTimePath.class && type != StringPath.class) {
+				continue;
+			}
+			String name = field.getName();
+			if (!object.has(name)) {
+				continue;
+			}
+			JsonNode jsonNode = object.get(name);
+			try {
+				if (type == NumberPath.class) {
+					NumberPath path = (NumberPath) field.get(q);
+					exps.addAll(parse(path, jsonNode));
+				}
+				if (type == DateTimePath.class) {
+					DateTimePath path = (DateTimePath) field.get(q);
+					exps.addAll(parse(path, jsonNode));
+				}
+				if (type == StringPath.class) {
+					StringPath path = (StringPath) field.get(q);
+					exps.addAll(parse(path, jsonNode));
+				}
+				// Boolean Enum
+			} catch (IllegalAccessException e) {
+			}
+		}
+		return exps;
+	}
+
+	private <T, Q extends EntityPathBase<T>> List<BooleanExpression> parseNode(Q q, CriteriaExpressionParser parser, ObjectNode objectNode) {
+		List<BooleanExpression> expressions = new LinkedList<>();
+		if (objectNode == null || objectNode.isEmpty()) {
+			return expressions;
+		}
+		if (parser != null) {
+			List<BooleanExpression> parseExps = parser.parse(objectNode);
+			if (parseExps != null && parseExps.size() > 0) {
+				expressions.addAll(parseExps);
+			}
+		}
+		List<BooleanExpression> exps = parseNode(q, objectNode);
+		if (exps != null && exps.size() > 0) {
+			expressions.addAll(exps);
+		}
+		return expressions;
+	}
+
+	public <T, Q extends EntityPathBase<T>> PagedResponse<T> query(Q q, CriteriaExpressionParser parser, JacksonCriteria request) {
+		PagedResponse<T> resp = new PagedResponse<>();
+
+		// 解析查询条件
+		ObjectNode criteria = request.getCriteria();
+		List<BooleanExpression> expressions = parseNode(q, parser, criteria);
+
+		// 处理or
+		JsonNode or = criteria.get("$or");
+		if (or != null && or.getNodeType() == JsonNodeType.ARRAY) {
+			ArrayNode arr = (ArrayNode) or;
+
+			BooleanExpression orExp = null;
+			for (JsonNode jsonNode : arr) {
+				if (jsonNode.getNodeType() != JsonNodeType.OBJECT) {
+					continue;
+				}
+				List<BooleanExpression> subExpressions = parseNode(q, parser, (ObjectNode) jsonNode);
+				if (orExp == null) {
+					orExp = and(subExpressions);
+				} else {
+					orExp = orExp.or(and(subExpressions));
+				}
+			}
+			if (orExp != null) {
+				expressions.add(orExp);
+			}
+		}
+
+		JPAQuery<T> query = queryFactory.selectFrom(q).where(expressions.toArray(new BooleanExpression[0]));
+
+		// 统计总数
+		if (!request.isWithoutCount()) {
+			long count = query.fetchCount();
+			resp.setCount(count);
+		}
+
+		if (request.isOnlyCount()) {
+			return resp;
+		}
+
+		// 排序
+		OrderSpecifier[] specifiers = parseOrders(q, request);
+		if (specifiers != null) {
+			query = query.orderBy(specifiers);
+		}
+
+		// 分页
+		Integer page = request.getPage();
+		Integer size = request.getSize();
+		if (page != null) {
+			if (size == null) {
+				size = DEFAULT_SIZE; // 默认每页50
+			}
+			int offset = (page - 1) * size;
+			if (offset < 0) {
+				offset = 0;
+			}
+			query = query.offset(offset).limit(size);
+		}
+		List<T> data = query.fetch();
+		resp.setData(data);
+		return resp;
+	}
+
+	private <T, Q extends EntityPathBase<T>> OrderSpecifier[] parseOrders(Q q, JacksonCriteria criteria) {
+		List<JacksonCriteria.Order> orders = criteria.getOrders();
+		if (orders == null || orders.size() == 0) {
+			return null;
+		}
+		List<OrderSpecifier> specifiers = new LinkedList<>();
+		Field[] fields = q.getClass().getFields();
+		for (JacksonCriteria.Order order : orders) {
+			String column = order.getColumn();
+			try {
+				for (Field field : fields) {
+					String name = field.getName();
+					if (!column.equals(name)) {
+						continue;
+					}
+					Class<?> type = field.getType();
+					if (type == NumberPath.class) {
+						NumberPath o = (NumberPath) field.get(q);
+						specifiers.add(order.isAsc() ? o.asc() : o.desc());
+					}
+					if (type == DateTimePath.class) {
+						DateTimePath o = (DateTimePath) field.get(q);
+						specifiers.add(order.isAsc() ? o.asc() : o.desc());
+					}
+					if (type == StringPath.class) {
+						StringPath o = (StringPath) field.get(q);
+						specifiers.add(order.isAsc() ? o.asc() : o.desc());
+					}
+				}
+			} catch (IllegalAccessException e) {
+
+			}
+		}
+
+		if (specifiers.size() == 0) {
+			return null;
+		} else {
+			return specifiers.toArray(new OrderSpecifier[0]);
+		}
+	}
+
+	private BooleanExpression and(List<BooleanExpression> exps) {
+		if (exps == null || exps.size() == 0) {
+			return null;
+		}
+		BooleanExpression result = exps.get(0);
+		for (int i = 1; i < exps.size(); i++) {
+			result = result.and(exps.get(i));
+		}
+		return result;
+	}
+
+
+	public static List<BooleanExpression> parse(NumberExpression path, JsonNode node) {
+		return parse(path, node, null);
+	}
+
+	public static List<BooleanExpression> parse(NumberExpression path, JsonNode node, Integer defaultValue) {
+		List<BooleanExpression> result = new LinkedList<>();
+		if (node == null) {
+			if (defaultValue != null) {
+				result.add(path.eq(defaultValue));
+			}
+			return result;
+		}
+		JsonNodeType nodeType = node.getNodeType();
+		if (nodeType == JsonNodeType.STRING) {
+			result.add(path.eq(parseNumber(node)));
+		} else if (nodeType == JsonNodeType.NUMBER) {
+			result.add(path.eq(parseNumber(node)));
+		} else if (nodeType == JsonNodeType.ARRAY) {
+			ArrayNode arr = (ArrayNode) node;
+			result.add(path.in(parseNumberArr(arr)));
+		} else if (nodeType == JsonNodeType.OBJECT) {
+			if (node.has("$gt")) {
+				result.add(path.gt(parseNumber(node.get("$gt"))));
+			}
+			if (node.has("$gte")) {
+				result.add(path.goe(parseNumber(node.get("$gte"))));
+			}
+			if (node.has("$lt")) {
+				result.add(path.lt(parseNumber(node.get("$lt"))));
+			}
+			if (node.has("$lte")) {
+				result.add(path.loe(parseNumber(node.get("$lte"))));
+			}
+			if (node.has("$in")) {
+				ArrayNode arr = (ArrayNode) node.get("$in");
+				result.add(path.in(parseNumberArr(arr)));
+			}
+			if (node.has("$ne")) {
+				result.add(path.ne(parseNumber(node.get("$ne"))));
+			}
+			if (node.has("$null")) {
+				Boolean isNull = Boolean.valueOf(node.get("$null").asText());
+				if (isNull) {
+					result.add(path.isNull());
+				} else {
+					result.add(path.isNotNull());
+				}
+			}
+		}
+		return result;
+	}
+
+	private static Number parseNumber(JsonNode node) {
+		if (node instanceof IntNode) {
+			return node.asInt();
+		} else if (node instanceof LongNode) {
+			return node.asLong();
+		} else if (node instanceof DoubleNode) {
+			return node.doubleValue();
+		} else if (node instanceof TextNode) {
+			String n = node.asText();
+			if (n.indexOf(".") > -1) {
+				return node.asDouble();
+			} else {
+				return node.asLong();
+			}
+		}
+		return 0;
+	}
+
+	public static List<Number> parseNumberArr(ArrayNode arr) {
+		List<Number> values = new ArrayList<>(arr.size());
+		Iterator<JsonNode> elements = arr.elements();
+		while (elements.hasNext()) {
+			values.add(parseNumber(elements.next()));
+		}
+		return values;
+	}
+
+	public static List<BooleanExpression> parse(StringExpression path, JsonNode node) {
+		return parse(path, node, null);
+	}
+
+	public static List<BooleanExpression> parse(StringExpression path, JsonNode node, String defaultValue) {
+		List<BooleanExpression> result = new LinkedList<>();
+		if (node == null) {
+			if (defaultValue != null) {
+				result.add(path.eq(defaultValue));
+			}
+			return result;
+		}
+		JsonNodeType nodeType = node.getNodeType();
+		if (nodeType == JsonNodeType.STRING) {
+			result.add(path.eq(node.asText()));
+		} else if (nodeType == JsonNodeType.ARRAY) {
+			ArrayNode arr = (ArrayNode) node;
+			result.add(path.in(parseStringArr(arr)));
+		} else if (nodeType == JsonNodeType.OBJECT) {
+			if (node.has("$gt")) {
+				result.add(path.gt(node.get("$gt").asText()));
+			}
+			if (node.has("$gte")) {
+				result.add(path.goe(node.get("$gte").asText()));
+			}
+			if (node.has("$lt")) {
+				result.add(path.lt(node.get("$lt").asText()));
+			}
+			if (node.has("$lte")) {
+				result.add(path.loe(node.get("$lte").asText()));
+			}
+			if (node.has("$in")) {
+				ArrayNode arr = (ArrayNode) node.get("$in");
+				result.add(path.in(parseStringArr(arr)));
+			}
+			if (node.has("$ne")) {
+				result.add(path.ne(node.get("$ne").asText()));
+			}
+			if (node.has("$like")) {
+				result.add(path.like(node.get("$like").asText()));
+			}
+			if (node.has("$notLike")) {
+				result.add(path.notLike(node.get("$notLike").asText()));
+			}
+			if (node.has("$null")) {
+				Boolean isNull = Boolean.valueOf(node.get("$null").asText());
+				if (isNull) {
+					result.add(path.isNull());
+				} else {
+					result.add(path.isNotNull());
+				}
+			}
+		}
+		return result;
+	}
+
+	private static List<String> parseStringArr(ArrayNode arr) {
+		List<String> values = new ArrayList<>(arr.size());
+		Iterator<JsonNode> elements = arr.elements();
+		while (elements.hasNext()) {
+			values.add(elements.next().asText());
+		}
+		return values;
+	}
+
+	public static List<BooleanExpression> parse(DateTimeExpression path, JsonNode node) {
+		return parse(path, node, (Date) null);
+	}
+
+	/**
+	 * @param path
+	 * @param node
+	 * @param time yyyyMMddHHmmss
+	 * @return
+	 */
+	public static List<BooleanExpression> parse(DateTimeExpression path, JsonNode node, String time) {
+		if (time != null) {
+			return parse(path, node, DateUtils.parse(time));
+		} else {
+			return parse(path, node, (Date) null);
+		}
+	}
+
+	public static List<BooleanExpression> parse(DateTimeExpression path, JsonNode node, Date time) {
+		List<BooleanExpression> result = new LinkedList<>();
+		if (node == null) {
+			if (time != null) {
+				result.add(path.eq(time));
+			}
+			return result;
+		}
+		SimpleDateFormat format = new SimpleDateFormat(DateUtils.PATTERN_yyyyMMddHHmmss);
+		JsonNodeType nodeType = node.getNodeType();
+		if (nodeType == JsonNodeType.STRING) {
+			try {
+				result.add(path.eq(format.parse(node.asText())));
+			} catch (ParseException e) {
+				e.printStackTrace();
+				throw new RuntimeException(e);
+			}
+		} else if (nodeType == JsonNodeType.OBJECT) {
+			if (node.has("$gt")) {
+				result.add(path.gt(parse(format, node, "$gt")));
+			}
+			if (node.has("$gte")) {
+				result.add(path.goe(parse(format, node, "$gte")));
+			}
+			if (node.has("$lt")) {
+				result.add(path.lt(parse(format, node, "$lt")));
+			}
+			if (node.has("$lte")) {
+				result.add(path.loe(parse(format, node, "$lte")));
+			}
+			if (node.has("$null")) {
+				Boolean isNull = Boolean.valueOf(node.get("$null").asText());
+				if (isNull) {
+					result.add(path.isNull());
+				} else {
+					result.add(path.isNotNull());
+				}
+			}
+		}
+		return result;
+	}
+
+	private static Date parse(SimpleDateFormat format, JsonNode node, String name) {
+		try {
+			return format.parse(node.get(name).asText());
+		} catch (ParseException e) {
+			e.printStackTrace();
+			throw new RuntimeException(e);
+		}
+	}
+
+	public static <T extends Enum> List<BooleanExpression> parse(EnumExpression path, JsonNode node, Class<T> clazz) {
+		return parse(path, node, clazz, null);
+	}
+
+	public static <T extends Enum> List<BooleanExpression> parse(EnumExpression path, JsonNode node, Class<T> clazz, T defaultValue) {
+		List<BooleanExpression> result = new LinkedList<>();
+		if (node == null) {
+			if (defaultValue != null) {
+				result.add(path.eq(defaultValue));
+			}
+			return result;
+		}
+		JsonNodeType nodeType = node.getNodeType();
+		if (nodeType == JsonNodeType.STRING) {
+			result.add(path.eq(T.valueOf(clazz, node.asText())));
+		} else if (nodeType == JsonNodeType.ARRAY) {
+			ArrayNode arr = (ArrayNode) node;
+			result.add(path.in(parseEnumArr(arr, clazz)));
+		} else if (nodeType == JsonNodeType.OBJECT) {
+			ArrayNode arr = (ArrayNode) node.get("$in");
+			if (arr != null) {
+				result.add(path.in(parseEnumArr(arr, clazz)));
+			}
+		}
+		return result;
+	}
+
+	private static <T extends Enum> List parseEnumArr(ArrayNode arr, Class<T> clazz) {
+		List<Enum> values = new ArrayList<>(arr.size());
+		Iterator<JsonNode> elements = arr.elements();
+		while (elements.hasNext()) {
+			Enum anEnum = T.valueOf(clazz, elements.next().asText());
+			values.add(anEnum);
+		}
+		return values;
+	}
+}

+ 514 - 0
src/main/java/com/persagy/common/criteria/JacksonCriteria.java

@@ -0,0 +1,514 @@
+package com.persagy.common.criteria;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.common.date.DateUtils;
+
+import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ *
+ * <pre>
+ * {
+ *     "page": 1,
+ *     "size": 10,
+ *     "onlyCount": false,
+ *     "criteria": {
+ *         "name": "zhangsan",
+ *         "name": [ "zhangsan", "lisi" ],
+ *         "age": {
+ *             "$gt": 18,
+ *             "$lt": 35
+ *         },
+ *         "gender": {
+ *             "$null": false
+ *         }
+ *     },
+ *     "orders": [
+ *            {
+ *     		 	"column": "name",
+ *     		 	"asc": false
+ *            }
+ *     ],
+ *     "withColumns": [
+ *     		"name", "age"
+ *     ]
+ * }
+ * </pre>
+ */
+public class JacksonCriteria {
+
+	@Getter
+	@Setter
+	private Integer page;
+
+	@Getter
+	@Setter
+	private Integer size;
+
+	/**
+	 * 是否只统计数量
+	 */
+	@Getter
+	@Setter
+	private boolean onlyCount = false;
+
+	@Getter
+	@Setter
+	private boolean withoutCount = false;
+
+	@Getter
+	@Setter
+	private ObjectNode criteria;
+
+	@Getter
+	@Setter
+	private List<Order> orders;
+
+	@Getter
+	@Setter
+	private Set<String> withColumns;
+
+	public boolean withColumn(String column) {
+		return withColumns != null && withColumns.contains(column);
+	}
+
+	public JacksonCriteria addWithColumn(String column) {
+		if (withColumns == null) {
+			withColumns = new HashSet<>();
+		}
+		withColumns.add(column);
+		return this;
+	}
+
+	public JacksonCriteria addOrder(String column) {
+		return addOrder(column, true);
+	}
+
+	public JacksonCriteria addOrder(String column, boolean asc) {
+		if (orders == null) {
+			orders = new LinkedList<>();
+		}
+		orders.add(new Order(column, asc));
+		return this;
+	}
+
+	public JacksonCriteria setLimit(int page, int size) {
+		this.page = page;
+		this.size = size;
+		return this;
+	}
+
+	private JacksonCriteria() {
+		super();
+		this.criteria = JsonNodeFactory.instance.objectNode();
+	}
+
+	public static JacksonCriteria newInstance() {
+		return new JacksonCriteria();
+	}
+
+	public String getString(String nodeName) {
+		return getString(nodeName, null);
+	}
+
+	public String getString(String nodeName, String defaultValue) {
+		if (criteria.has(nodeName)) {
+			JsonNode node = criteria.get(nodeName);
+			return node.asText();
+		}
+		return defaultValue;
+	}
+
+	public Integer getInteger(String nodeName) {
+		return getInteger(nodeName, null);
+	}
+
+	public Integer getInteger(String nodeName, Integer defaultValue) {
+		if (criteria.has(nodeName)) {
+			JsonNode jsonNode = criteria.get(nodeName);
+			return Integer.valueOf(jsonNode.asText());
+		}
+		return defaultValue;
+	}
+
+	public Double getDouble(String nodeName) {
+		return getDouble(nodeName, null);
+	}
+
+	public Double getDouble(String nodeName, Double defaultValue) {
+		if (criteria.has(nodeName)) {
+			JsonNode jsonNode = criteria.get(nodeName);
+			return Double.valueOf(jsonNode.asText());
+		}
+		return defaultValue;
+	}
+
+	public Boolean getBoolean(String nodeName) {
+		return getBoolean(nodeName, null);
+	}
+
+	public Boolean getBoolean(String nodeName, Boolean defaultValue) {
+		if (criteria.has(nodeName)) {
+			JsonNode jsonNode = criteria.get(nodeName);
+			return Boolean.valueOf(jsonNode.asText());
+		}
+		return defaultValue;
+	}
+
+	/**
+	 * 添加查询key,重复添加时后添加的会覆盖前面添加的
+	 *
+	 * @param key
+	 * @param value
+	 * @return
+	 */
+	public void add(String key, String value) {
+		criteria.put(key, value);
+	}
+
+	public void add(String key, byte value) {
+		criteria.put(key, value);
+	}
+
+	public void add(String key, short value) {
+		criteria.put(key, value);
+	}
+
+	public void add(String key, int value) {
+		criteria.put(key, value);
+	}
+
+	public void add(String key, long value) {
+		criteria.put(key, value);
+	}
+
+	public void add(String key, float value) {
+		criteria.put(key, value);
+	}
+
+	public void add(String key, double value) {
+		criteria.put(key, value);
+	}
+
+	public void add(String key, BigDecimal value) {
+		criteria.put(key, value);
+	}
+
+	public void add(String key, boolean value) {
+		criteria.put(key, value);
+	}
+
+	public void add(String key, byte[] value) {
+		criteria.put(key, value);
+	}
+
+	public <T> void add(String string, List<T> value) {
+		if (value != null) {
+			ArrayNode jsonNodes = criteria.putArray(string);
+			toArrayNode(jsonNodes, value);
+		}
+	}
+
+	public void add(String string, Enum value) {
+		if (value != null) {
+			criteria.put(string, value.name());
+		}
+	}
+
+	@JsonIgnore
+	private ObjectNode current;
+
+	/**
+	 * 添加查询key,重复添加时后添加的会覆盖前面添加的
+	 *
+	 * @param key
+	 * @return
+	 */
+	public JacksonCriteria add(String key) {
+		current = criteria.putObject(key);
+		return this;
+	}
+
+	public JacksonCriteria isNull(boolean value) {
+		current.put("$null", value);
+		return this;
+	}
+
+	public JacksonCriteria gt(byte value) {
+		current.put("$gt", value);
+		return this;
+	}
+
+	public JacksonCriteria gt(short value) {
+		current.put("$gt", value);
+		return this;
+	}
+
+	public JacksonCriteria gt(int value) {
+		current.put("$gt", value);
+		return this;
+	}
+
+	public JacksonCriteria gt(long value) {
+		current.put("$gt", value);
+		return this;
+	}
+
+	public JacksonCriteria gt(float value) {
+		current.put("$gt", value);
+		return this;
+	}
+
+	public JacksonCriteria gt(double value) {
+		current.put("$gt", value);
+		return this;
+	}
+
+	public JacksonCriteria gt(String value) {
+		current.put("$gt", value);
+		return this;
+	}
+
+	public JacksonCriteria gt(Date value) {
+		current.put("$gt", DateUtils.format(value));
+		return this;
+	}
+
+	public JacksonCriteria gte(byte value) {
+		current.put("$gte", value);
+		return this;
+	}
+
+	public JacksonCriteria gte(short value) {
+		current.put("$gte", value);
+		return this;
+	}
+
+	public JacksonCriteria gte(int value) {
+		current.put("$gte", value);
+		return this;
+	}
+
+	public JacksonCriteria gte(long value) {
+		current.put("$gte", value);
+		return this;
+	}
+
+	public JacksonCriteria gte(float value) {
+		current.put("$gte", value);
+		return this;
+	}
+
+	public JacksonCriteria gte(double value) {
+		current.put("$gte", value);
+		return this;
+	}
+
+	public JacksonCriteria gte(String value) {
+		current.put("$gte", value);
+		return this;
+	}
+
+	public JacksonCriteria gte(Date value) {
+		current.put("$gte", DateUtils.format(value));
+		return this;
+	}
+
+	public JacksonCriteria lt(byte value) {
+		current.put("$lt", value);
+		return this;
+	}
+
+	public JacksonCriteria lt(short value) {
+		current.put("$lt", value);
+		return this;
+	}
+
+	public JacksonCriteria lt(int value) {
+		current.put("$lt", value);
+		return this;
+	}
+
+	public JacksonCriteria lt(long value) {
+		current.put("$lt", value);
+		return this;
+	}
+
+	public JacksonCriteria lt(float value) {
+		current.put("$lt", value);
+		return this;
+	}
+
+	public JacksonCriteria lt(double value) {
+		current.put("$lt", value);
+		return this;
+	}
+
+	public JacksonCriteria lt(String value) {
+		current.put("$lt", value);
+		return this;
+	}
+
+	public JacksonCriteria lt(Date value) {
+		current.put("$lt", DateUtils.format(value));
+		return this;
+	}
+
+	public JacksonCriteria lte(byte value) {
+		current.put("$lte", value);
+		return this;
+	}
+
+	public JacksonCriteria lte(short value) {
+		current.put("$lte", value);
+		return this;
+	}
+
+	public JacksonCriteria lte(int value) {
+		current.put("$lte", value);
+		return this;
+	}
+
+	public JacksonCriteria lte(long value) {
+		current.put("$lte", value);
+		return this;
+	}
+
+	public JacksonCriteria lte(float value) {
+		current.put("$lte", value);
+		return this;
+	}
+
+	public JacksonCriteria lte(double value) {
+		current.put("$lte", value);
+		return this;
+	}
+
+	public JacksonCriteria lte(String value) {
+		current.put("$lte", value);
+		return this;
+	}
+
+	public JacksonCriteria lte(Date value) {
+		current.put("$lte", DateUtils.format(value));
+		return this;
+	}
+
+	public JacksonCriteria ne(byte value) {
+		current.put("$ne", value);
+		return this;
+	}
+
+	public JacksonCriteria ne(short value) {
+		current.put("$ne", value);
+		return this;
+	}
+
+	public JacksonCriteria ne(int value) {
+		current.put("$ne", value);
+		return this;
+	}
+
+	public JacksonCriteria ne(long value) {
+		current.put("$ne", value);
+		return this;
+	}
+
+	public JacksonCriteria ne(float value) {
+		current.put("$ne", value);
+		return this;
+	}
+
+	public JacksonCriteria ne(double value) {
+		current.put("$ne", value);
+		return this;
+	}
+
+	public JacksonCriteria ne(String value) {
+		current.put("$ne", value);
+		return this;
+	}
+
+	public JacksonCriteria ne(Date value) {
+		current.put("$ne", DateUtils.format(value));
+		return this;
+	}
+
+	public JacksonCriteria like(String value) {
+		current.put("$like", value);
+		return this;
+	}
+
+	public JacksonCriteria notLike(String value) {
+		current.put("$notLike", value);
+		return this;
+	}
+
+	public <T> JacksonCriteria in(List<T> value) {
+		if (value != null) {
+			ArrayNode inNode = current.putArray("$in");
+			toArrayNode(inNode, value);
+		}
+		return this;
+	}
+
+	private <T> void toArrayNode(ArrayNode arrayNode, List<T> value) {
+		value.forEach(o -> {
+			if (o instanceof String) {
+				arrayNode.add((String) o);
+			} else if (o instanceof Byte) {
+				arrayNode.add((Byte) o);
+			} else if (o instanceof Short) {
+				arrayNode.add((Short) o);
+			} else if (o instanceof Integer) {
+				arrayNode.add((Integer) o);
+			} else if (o instanceof Long) {
+				arrayNode.add((Long) o);
+			} else if (o instanceof Float) {
+				arrayNode.add((Float) o);
+			} else if (o instanceof Double) {
+				arrayNode.add((Double) o);
+			} else if (o instanceof Boolean) {
+				arrayNode.add((Boolean) o);
+			} else if (o instanceof byte[]) {
+				arrayNode.add((byte[]) o);
+			} else if (o instanceof Enum) {
+				arrayNode.add(((Enum) o).name());
+			}
+		});
+	}
+
+	@Data
+	public static class Order {
+		private String column;
+		private boolean asc = true;
+
+		public Order() {
+		}
+
+		public Order(String column) {
+			this.column = column;
+		}
+
+		public Order(String column, boolean asc) {
+			this.column = column;
+			this.asc = asc;
+		}
+	}
+}

+ 261 - 0
src/main/java/com/persagy/common/date/DateUtils.java

@@ -0,0 +1,261 @@
+package com.persagy.common.date;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ */
+public class DateUtils {
+
+	public static final String PATTERN_yyyyMMddHHmmss = "yyyyMMddHHmmss";
+	public static final String PATTERN_yyyyMMddHHmmss2 = "yyyy-MM-dd HH:mm:ss";
+	public static final String PATTERN_yyyyMMdd = "yyyyMMdd";
+	public static final String PATTERN_HHmmss = "HHmmss";
+	public static final String PATTERN_HHmm = "HHmm";
+	public static final String PATTERN_MM = "MM";
+	public static final String PATTERN_yyyy = "yyyy";
+	public static final String PATTERN_yyyyMM = "yyyyMM";
+
+	public static Date add(Date now, int field, int amount) {
+		Calendar c = Calendar.getInstance();
+		c.setTime(now);
+		c.add(field, amount);
+		return c.getTime();
+	}
+
+	public static String format(Date date) {
+		return format(date, PATTERN_yyyyMMddHHmmss);
+	}
+
+	public static Date parse(String date) {
+		return parse(date, PATTERN_yyyyMMddHHmmss);
+	}
+
+	public static String format(Date date, String pattern) {
+		DateFormat format = new SimpleDateFormat(pattern);
+		return format.format(date);
+	}
+
+	public static Date parse(String date, String pattern) {
+		DateFormat format = new SimpleDateFormat(pattern);
+		try {
+			return format.parse(date);
+		} catch (ParseException e) {
+			e.printStackTrace();
+			throw new RuntimeException("pattern[" + pattern + "] and date[" + date + "] not match");
+		}
+	}
+
+	/**
+	 * 时间字符串转化成分钟数
+	 *
+	 * @param time yyyyMMddHHmmss or HHmmss
+	 * @return
+	 */
+	public static int toInt(String time) {
+		String temp = time;
+		if (time.length() == 14) {
+			temp = time.substring(8);
+		}
+		int minute = Integer.parseInt(temp.substring(0, 2)) * 60 + Integer.parseInt(temp.substring(2, 4));
+		if (minute >= 1440) {
+			minute = minute - 1440;
+		}
+		return minute;
+	}
+
+	/**
+	 * 分钟数转化为时间字符串
+	 *
+	 * @param minite
+	 * @return string HHmmss
+	 */
+	public static String toString(int minite) {
+		int tmp = minite;
+		if (tmp >= 1440) {
+			tmp = tmp - 1440;
+		}
+		return String.format("%02d", tmp / 60) + String.format("%02d", tmp % 60) + "00";
+	}
+
+	/**
+	 * 下一个服务定制时间点
+	 *
+	 * @param thisTime
+	 * @param targetPeirod
+	 * @return
+	 */
+	public static String nextTargetPoint(String thisTime, Integer targetPeirod) {
+		int minute = toInt(thisTime);
+		minute = minute - (minute % targetPeirod) + targetPeirod;
+		return toString(minute);
+	}
+
+	public static String thisOrNextTargetPoint(String thisTime, Integer targetPeirod) {
+		int minute = toInt(thisTime);
+		if (minute % targetPeirod != 0) {
+			minute = minute - (minute % targetPeirod) + targetPeirod;
+		}
+		return toString(minute);
+	}
+
+	public static String thisOrLastTargetPoint(String thisTime, Integer targetPeirod) {
+		int minute = toInt(thisTime);
+		minute = minute - (minute % targetPeirod);
+		return toString(minute);
+	}
+
+	/**
+	 * 计算begin和end之间的定制时间点
+	 *
+	 * @param begin  包含
+	 * @param end    包含
+	 * @param period 时间间隔,单位分钟
+	 * @return
+	 */
+	public static List<String> getTimePoints(String begin, String end, int period) {
+		return getTimePoints(begin, end, period, false);
+	}
+
+	/**
+	 * 不支持跨天,计算begin和end之间的定制时间点
+	 *
+	 * @param begin
+	 * @param end
+	 * @param period
+	 * @param containEnd 是否包含结束时间
+	 * @return
+	 */
+	public static List<String> getTimePoints(String begin, String end, int period, boolean containEnd) {
+		List<String> list = new LinkedList<>();
+		int beginInt = toInt(begin);
+		int endInt = toInt(end);
+		int point = beginInt - (beginInt % period);
+		while (true) {
+			if ((containEnd && point <= endInt) || (!containEnd && point < endInt)) {
+				list.add(toString(point));
+				point += period;
+			} else {
+				break;
+			}
+		}
+		return list;
+	}
+
+	/**
+	 * 历史分精度数据时间点, 支持跨天
+	 *
+	 * @param begin  包含
+	 * @param end    包含
+	 * @param period
+	 * @return
+	 */
+	public static List<String> getHisdataTimePoints(String begin, String end, int period) {
+		SimpleDateFormat format = new SimpleDateFormat(DateUtils.PATTERN_yyyyMMddHHmmss);
+		List<String> list = new LinkedList<>();
+		String start = begin.substring(0, 8) + thisOrNextTargetPoint(begin, period);
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(DateUtils.parse(start));
+		while (true) {
+			String tp = format.format(calendar.getTime());
+			if (tp.compareTo(end) <= 0) {
+				list.add(tp);
+				calendar.add(Calendar.MINUTE, period);
+			} else {
+				break;
+			}
+		}
+		return list;
+	}
+
+	/**
+	 * 判断两个时间段是否是分隔开的(没有交叉重叠包含或覆盖)
+	 *
+	 * @param a1 HHmmss
+	 * @param a2
+	 * @param b1
+	 * @param b2
+	 * @return 注:该方法没有判断相等的情况,如:a1=b1 a2=b2 仍返回为true
+	 */
+	public static boolean isSeparate(String a1, String a2, String b1, String b2) {
+		if (a1.compareTo(b1) < 0 && a2.compareTo(b1) > 0) {
+			return false;
+		}
+		if (a1.compareTo(b2) < 0 && a2.compareTo(b2) > 0) {
+			return false;
+		}
+		if (a1.compareTo(b1) < 0 && a2.compareTo(b2) > 0) {
+			return false;
+		}
+		if (a1.compareTo(b1) > 0 && a2.compareTo(b2) < 0) {
+			return false;
+		}
+		return true;
+	}
+
+
+	/**
+	 * 判断两个时间段是否是包含或覆盖的
+	 *
+	 * @param a1
+	 * @param a2
+	 * @param b1
+	 * @param b2
+	 * @return
+	 */
+	public static boolean isNotSeparate(String a1, String a2, String b1, String b2) {
+		if (a1.compareTo(b1) > 0 && a1.compareTo(b2) > 0) {
+			return false;
+		}
+		if (a2.compareTo(b1) < 0 && a2.compareTo(b2) < 0) {
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * date2比date1多的天数
+	 *
+	 * @param date1
+	 * @param date2
+	 * @return
+	 */
+	public static int differentDays(Date date1, Date date2) {
+		Calendar cal1 = Calendar.getInstance();
+		cal1.setTime(date1);
+
+		Calendar cal2 = Calendar.getInstance();
+		cal2.setTime(date2);
+		int day1 = cal1.get(Calendar.DAY_OF_YEAR);
+		int day2 = cal2.get(Calendar.DAY_OF_YEAR);
+
+		int year1 = cal1.get(Calendar.YEAR);
+		int year2 = cal2.get(Calendar.YEAR);
+		if (year1 != year2)   //同一年
+		{
+			int timeDistance = 0;
+			for (int i = year1; i < year2; i++) {
+				if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0)    //闰年
+				{
+					timeDistance += 366;
+				} else    //不是闰年
+				{
+					timeDistance += 365;
+				}
+			}
+
+			return timeDistance + (day2 - day1);
+		} else    //不同年
+		{
+			return day2 - day1;
+		}
+	}
+}

+ 222 - 0
src/main/java/com/persagy/common/json/JacksonMapper.java

@@ -0,0 +1,222 @@
+package com.persagy.common.json;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.JsonNodeType;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ */
+public class JacksonMapper {
+
+	private static Logger logger = LoggerFactory.getLogger(JacksonMapper.class);
+
+	public static final ObjectMapper nonEmptyMapper;
+	public static final ObjectMapper nonDefaultMapper;
+	public static final ObjectMapper nonEmptyFormatMapper;
+
+	static {
+		nonEmptyMapper = new ObjectMapper();
+		nonEmptyMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
+		nonEmptyMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+		nonEmptyMapper.disable(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES);
+
+		nonDefaultMapper = new ObjectMapper();
+		nonDefaultMapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
+		nonDefaultMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+		nonDefaultMapper.disable(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES);
+
+		nonEmptyFormatMapper = new ObjectMapper();
+		nonEmptyFormatMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
+		nonEmptyFormatMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+		nonEmptyFormatMapper.disable(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES);
+		nonEmptyFormatMapper.enable(SerializationFeature.INDENT_OUTPUT);
+	}
+
+	private static boolean isEmpty(final CharSequence cs) {
+		return cs == null || cs.length() == 0;
+	}
+
+	public static <T> T toObject(String jsonString, Class<T> clazz) {
+		if (!isEmpty(jsonString)) {
+			try {
+				return nonEmptyMapper.readValue(jsonString, clazz);
+			} catch (IOException e) {
+				logger.warn("parse json string to {} error: {}", clazz.getName(), jsonString, e);
+			}
+		}
+		return null;
+	}
+
+	public static <T> T toObject(String jsonString, TypeReference<T> typeRef) {
+		if (!isEmpty(jsonString)) {
+			try {
+				return nonEmptyMapper.readValue(jsonString, typeRef);
+			} catch (IOException e) {
+				logger.warn("parse json string to {} error: {}", typeRef.toString(), jsonString, e);
+			}
+		}
+		return null;
+	}
+
+	public static <T> T toObject(String jsonString, JavaType javaType) {
+		if (!isEmpty(jsonString)) {
+			try {
+				return (T) nonEmptyMapper.readValue(jsonString, javaType);
+			} catch (IOException e) {
+				logger.warn("parse json string to {} error: {}", javaType.toString(), jsonString, e);
+			}
+		}
+		return null;
+	}
+
+	public static <T> T toObject(String jsonString, Class cla, Class... clb) {
+		if (!isEmpty(jsonString)) {
+			try {
+				JavaType javaType = nonEmptyMapper.getTypeFactory().constructParametricType(cla, clb);
+				return (T) nonEmptyMapper.readValue(jsonString, javaType);
+			} catch (IOException e) {
+				logger.warn("parse json string to {} error: {}", cla.getName(), jsonString, e);
+			}
+		}
+		return null;
+	}
+
+	public static JavaType constructParametricType(Class<?> parametrized, Class<?>... parameterClasses) {
+		return nonEmptyMapper.getTypeFactory().constructParametricType(parametrized, parameterClasses);
+	}
+
+	public static JavaType constructParametricType(Class<?> rawType, JavaType... parameterTypes) {
+		return nonEmptyMapper.getTypeFactory().constructParametricType(rawType, parameterTypes);
+	}
+
+	public static String toSimpleJson(Object object) {
+		try {
+			return nonEmptyMapper.writeValueAsString(object);
+		} catch (JsonProcessingException e) {
+			logger.error("write to json string error:" + object, e);
+		}
+		return null;
+	}
+
+	public static String toFormatJson(Object object) {
+		try {
+			return nonEmptyFormatMapper.writeValueAsString(object);
+		} catch (JsonProcessingException e) {
+			logger.error("write to json string error:" + object, e);
+		}
+		return null;
+	}
+
+	public static final String getString(ObjectNode obj, String key) {
+		return getString(obj, key, null);
+	}
+
+	public static final String getString(ObjectNode obj, String key, String defaultValue) {
+		if (obj == null) {
+			return defaultValue;
+		}
+		if (!obj.has(key)) {
+			return defaultValue;
+		}
+		return obj.get(key).asText();
+	}
+
+	public static final Integer getInteger(ObjectNode obj, String key) {
+		return getInteger(obj, key, null);
+	}
+
+	public static final Integer getInteger(ObjectNode obj, String key, Integer defaultValue) {
+		if (obj == null) {
+			return defaultValue;
+		}
+		if (!obj.has(key)) {
+			return defaultValue;
+		}
+		JsonNode jsonNode = obj.get(key);
+
+		return Integer.valueOf(jsonNode.asText());
+	}
+
+	public static final Double getDouble(ObjectNode obj, String key) {
+		return getDouble(obj, key, null);
+	}
+
+	public static final Double getDouble(ObjectNode obj, String key, Double defaultValue) {
+		if (obj == null) {
+			return defaultValue;
+		}
+		if (!obj.has(key)) {
+			return defaultValue;
+		}
+		return Double.valueOf(obj.get(key).asText());
+	}
+
+	public static final Boolean getBoolean(ObjectNode obj, String key) {
+		return getBoolean(obj, key, null);
+	}
+
+	public static final Boolean getBoolean(ObjectNode obj, String key, Boolean defaultValue) {
+		if (obj == null) {
+			return defaultValue;
+		}
+		if (!obj.has(key)) {
+			return defaultValue;
+		}
+		return Boolean.valueOf(obj.get(key).toString());
+	}
+
+	public static final ObjectNode getObject(ObjectNode obj, String key) {
+		return getObject(obj, key, null);
+	}
+
+	public static final ObjectNode getObject(ObjectNode obj, String key, ObjectNode defaultValue) {
+		if (obj == null) {
+			return defaultValue;
+		}
+		if (!obj.has(key)) {
+			return defaultValue;
+		}
+		JsonNode jsonNode = obj.get(key);
+		JsonNodeType nodeType = jsonNode.getNodeType();
+		if (nodeType == JsonNodeType.STRING) {
+			return toObject(jsonNode.asText(), ObjectNode.class);
+		} else if (nodeType == JsonNodeType.OBJECT) {
+			return (ObjectNode) jsonNode;
+		}
+		return defaultValue;
+	}
+
+
+	public static final ArrayNode getArray(ObjectNode obj, String key) {
+		return getArray(obj, key, null);
+	}
+
+	public static final ArrayNode getArray(ObjectNode obj, String key, ArrayNode defaultValue) {
+		if (obj == null) {
+			return defaultValue;
+		}
+		if (!obj.has(key)) {
+			return defaultValue;
+		}
+		JsonNode jsonNode = obj.get(key);
+		JsonNodeType nodeType = jsonNode.getNodeType();
+		if (nodeType == JsonNodeType.STRING) {
+			return toObject(jsonNode.asText(), ArrayNode.class);
+		} else if (nodeType == JsonNodeType.ARRAY) {
+			return (ArrayNode) jsonNode;
+		}
+		return defaultValue;
+	}
+
+}

+ 49 - 0
src/main/java/com/persagy/common/web/BaseResponse.java

@@ -0,0 +1,49 @@
+package com.persagy.common.web;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ */
+public class BaseResponse<T> {
+
+	public static final String SUCCESS = "success";
+	public static final String FAIL = "fail";
+	public static final String EXCEPTION = "exception";
+
+	@Getter
+	@Setter
+	private String result;
+
+	@Getter
+	@Setter
+	private String message;
+
+	@Getter
+	@Setter
+	protected T data;
+
+	public void setFail(String message) {
+		setResult(FAIL);
+		setMessage(message);
+	}
+
+	public BaseResponse() {
+		super();
+		this.result = SUCCESS;
+	}
+
+	public BaseResponse(String result, String message) {
+		super();
+		this.result = result;
+		this.message = message;
+	}
+
+	public boolean success() {
+		return SUCCESS.equals(this.result);
+	}
+
+}

+ 28 - 0
src/main/java/com/persagy/common/web/ListResponse.java

@@ -0,0 +1,28 @@
+package com.persagy.common.web;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ */
+public class ListResponse<T> extends BaseResponse<List<T>> {
+
+	public void add(T t) {
+		if (data == null) {
+			data = new LinkedList<>();
+		}
+		data.add(t);
+	}
+
+	@Override
+	public List<T> getData() {
+		List<T> data = super.getData();
+		if (data == null) {
+			data = new LinkedList<>();
+		}
+		return data;
+	}
+}

+ 42 - 0
src/main/java/com/persagy/common/web/MapResponse.java

@@ -0,0 +1,42 @@
+package com.persagy.common.web;
+
+import org.apache.commons.collections4.MapUtils;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ */
+public class MapResponse extends BaseResponse<Map<String, Object>> {
+
+	public MapResponse() {
+		super();
+		super.setResult(SUCCESS);
+	}
+
+	//	@JsonAnySetter
+	public void add(String name, Object value) {
+		if (data == null) {
+			data = new HashMap<String, Object>();
+		}
+		data.put(name, value);
+	}
+
+	//	@JsonAnyGetter
+	@Override
+	public Map<String, Object> getData() {
+		return data;
+	}
+
+	public String getString(String key) {
+		return MapUtils.getString(data, key);
+	}
+
+	public Integer getInteger(String key) {
+		return MapUtils.getInteger(data, key);
+	}
+
+}

+ 27 - 0
src/main/java/com/persagy/common/web/PagedResponse.java

@@ -0,0 +1,27 @@
+package com.persagy.common.web;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ */
+public class PagedResponse<T> extends ListResponse<T> {
+
+	@Getter
+	@Setter
+	private Long count;
+
+	public List<T> getData() {
+		if (data == null) {
+			return Collections.EMPTY_LIST;
+		} else {
+			return data;
+		}
+	}
+}

+ 80 - 0
src/main/java/com/persagy/common/web/ServletUtils.java

@@ -0,0 +1,80 @@
+package com.persagy.common.web;
+
+import com.persagy.common.json.JacksonMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Enumeration;
+
+/**
+ * @author: yaoll
+ * @date: 2020-09-04
+ * @verison: 1.0
+ */
+public class ServletUtils {
+
+    private static final Logger logger = LoggerFactory.getLogger(ServletUtils.class);
+
+    public static void writeJson(HttpServletResponse response, Object obj) {
+        writeJson(response, JacksonMapper.toSimpleJson(obj));
+    }
+
+    public static void writeJson(HttpServletResponse response, String json) {
+        response.setContentType("application/json;charset=UTF-8");
+        PrintWriter out = null;
+        try {
+            out = response.getWriter();
+            out.print(json);
+            out.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if (out != null) {
+                out.close();
+            }
+        }
+    }
+
+    public static Cookie getCookie(HttpServletRequest request, String name) {
+        Cookie[] cookies = request.getCookies();
+        if (cookies != null) {
+            for (Cookie cookie : cookies) {
+                if (name.equals(cookie.getName())) {
+                    return cookie;
+                }
+            }
+        }
+        return null;
+    }
+
+    public static String getCookieValue(HttpServletRequest request, String name) {
+        Cookie cookie = getCookie(request, name);
+        return cookie == null ? null : cookie.getValue();
+    }
+
+
+    public static void showCookies(HttpServletRequest request) {
+        Cookie[] cookies = request.getCookies();
+        if (cookies != null) {
+            for (Cookie cookie : cookies) {
+                logger.info("cookie: {} {} {} {}", cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain());
+            }
+        }
+    }
+
+    public static void showHeaders(HttpServletRequest request) {
+        Enumeration<String> headerNames = request.getHeaderNames();
+        if (headerNames != null) {
+            while (headerNames.hasMoreElements()) {
+                String name = headerNames.nextElement();
+                logger.info("header: {} {}", name, request.getHeader(name));
+            }
+        }
+    }
+
+}

+ 38 - 0
src/main/java/com/persagy/dmp/AutoConfiguration.java

@@ -0,0 +1,38 @@
+package com.persagy.dmp;
+
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import com.persagy.dmp.config.DmpProperties;
+import com.persagy.dmp.config.FeignInterceptorConfig;
+
+/**
+ * @description: 配置类
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/9/21 17:44
+ * @version: V1.0
+ **/
+
+@Configuration
+/*
+ * 当classpath中出现了Jedis这个类时,才会进行相应的配置。
+ * conditional 是有条件的 意思
+
+ */
+/*
+ * @ConfigurationProperties注解主要用来把properties配置文件转化为bean来使用的,
+ * 而@EnableConfigurationProperties注解的作用是@ConfigurationProperties注解生效。
+ * 如果只配置@ConfigurationProperties注解,在IOC容器中是获取不到properties配置文件转化的bean的。
+ */
+
+@EnableConfigurationProperties({DmpProperties.class})
+public class AutoConfiguration {
+
+	@Bean
+	public FeignInterceptorConfig feignInterceptorConfig() {
+		return new FeignInterceptorConfig();
+	}
+	
+}

+ 20 - 0
src/main/java/com/persagy/dmp/annotation/EnableRedisCache.java

@@ -0,0 +1,20 @@
+package com.persagy.dmp.annotation;
+
+import com.persagy.dmp.AutoConfiguration;
+import org.springframework.context.annotation.Import;
+
+import java.lang.annotation.*;
+
+/**
+ * @description:
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2021/1/13 15:59
+ * @version: V1.0
+ **/
+@Documented
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Import(AutoConfiguration.class)
+public @interface EnableRedisCache {
+}

+ 151 - 0
src/main/java/com/persagy/dmp/aspect/FeignClientAspect.java

@@ -0,0 +1,151 @@
+package com.persagy.dmp.aspect;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.IntegratedResponseResult;
+import com.persagy.dmp.common.VideoResult;
+import com.persagy.dmp.constant.ResponseCode;
+import com.persagy.dmp.constant.ResponseMsg;
+import com.persagy.dmp.enumeration.EnumResult;
+import com.persagy.dmp.utils.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * @author LuoGuangyi
+ * @version 1.0.0
+ * @Description 处理feign调用接口,接口返回值异常的情况
+ * feign调用只要返回结果有异常,那么向上抛出异常,特殊不需要抛出异常的地方,需要自己try处理
+ * @ClassName FeignClientAspect.java
+ * @createTime 2020/12/03 14:11
+ * @Since
+ */
+@Slf4j
+@Aspect
+@Component
+public class FeignClientAspect {
+    @Pointcut("execution(* com.persagy.*.client..*.*(..))")
+    public void feignPointCut() {
+    }
+
+    @Before("feignPointCut()")
+    public void before() {
+    }
+    @Around("feignPointCut()")
+    public Object handlerPageAndSize(ProceedingJoinPoint pjp) throws Throwable {
+        //中台page没size默认50,改成不限制
+        //首先获取方法名称列表
+        MethodSignature msg = (MethodSignature)pjp.getSignature();
+        String[] paramName = msg.getParameterNames();
+        List<String> paramNameList = Arrays.asList(paramName);
+        //获取传入的参数
+        Object[] args = pjp.getArgs();
+        if (ObjectUtil.isNotNull(args) && args.length > 0) {
+            for (int i = 0; i < args.length; i++) {
+                Object arg = args[i];
+                if(isJSONObject(arg)) {
+                    JSONObject argJson = getJSONObject(arg);
+                    if(getTrueNumber(argJson.containsKey("page"),argJson.containsKey("size")) == 1) {
+                        argJson.remove("page");
+                        argJson.remove("size");
+                        args[i] = argJson;
+                    }
+                }
+            }
+
+//            //返回参数位置
+//            Integer pos = paramNameList.indexOf("userId");
+//            Long paramValue = (Long)args[pos];
+//            args[pos] =paramValue;
+        }
+        //返回
+        Object retVal = pjp.proceed(args);
+        return retVal;
+    }
+
+    private static int getTrueNumber(boolean... args) {
+        int count = 0;
+        for (boolean element : args) {
+            if (element) {
+                count++;
+            }
+        }
+        return count;
+    }
+
+
+    public static boolean isJSONObject(Object content) {
+        try {
+            if(content == null) {
+                return false;
+            }
+            if(content instanceof String) {
+                Object jsobj = JSONObject.parse((String) content);
+                return jsobj instanceof JSONObject;
+            }else {
+                Object jsobj = JSONObject.parse(JSON.toJSONString(content));
+                return jsobj instanceof JSONObject;
+            }
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    public static JSONObject getJSONObject(Object content) {
+        try {
+            if(content == null) {
+                return new JSONObject();
+            }
+            if(content instanceof String) {
+                return JSONObject.parseObject((String) content);
+            }else {
+                return JSONObject.parseObject(JSON.toJSONString(content));
+            }
+        } catch (Exception e) {
+            return new JSONObject();
+        }
+    }
+    @AfterReturning(returning = "res", pointcut = "feignPointCut()")
+    public void after(JoinPoint jp, Object res) throws Exception {
+        String methodName = jp.getSignature().getName();
+        if (res instanceof DmpResult) {
+            if (DmpResult.FAILURE.equals(((DmpResult) res).getResult())) {
+                log.error("the method [{}] 异常,[错误信息]:{},[请求参数]:{}", methodName, ((DmpResult) res).getMessage(), JSONObject.toJSONString(jp.getArgs()));
+                throw new RuntimeException(((DmpResult) res).getMessage());
+            }
+            return;
+        }
+        if (res instanceof IntegratedResponseResult) {
+            if (!ResponseCode.A00000.getCode().equals(((IntegratedResponseResult) res).getRespCode())) {
+                log.error("the method [{}] 异常,[错误信息]:{},[请求参数]:{}", methodName, ((IntegratedResponseResult) res).getRespMsg(), JSONObject.toJSONString(jp.getArgs()));
+                throw new RuntimeException(((IntegratedResponseResult) res).getRespMsg());
+            }
+            return;
+        }
+        if (res instanceof ResponseMsg) {
+            if (EnumResult.success.getValue().equals(((ResponseMsg) res).getResult())) {
+                log.error("the method [{}] 异常,[错误信息]:{},[请求参数]:{}", methodName, ((ResponseMsg) res).getResultMsg(), JSONObject.toJSONString(jp.getArgs()));
+                throw new RuntimeException(((ResponseMsg) res).getResultMsg());
+            }
+            return;
+        }
+        if (res instanceof VideoResult) {
+            if (VideoResult.FAILURE.equals(((VideoResult) res).getResult())) {
+                log.error("the method [{}] 异常,[错误信息]:{},[请求参数]:{}", methodName, ((DmpResult) res).getMessage(), JSONObject.toJSONString(jp.getArgs()));
+                throw new RuntimeException(((VideoResult) res).getReason());
+            }
+            return;
+        }
+    }
+}

+ 12 - 0
src/main/java/com/persagy/dmp/auth/Anonymous.java

@@ -0,0 +1,12 @@
+package com.persagy.dmp.auth;
+
+import java.lang.annotation.*;
+
+/**
+ * 指定方法或controll允许匿名访问
+ */
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Anonymous {
+}

+ 34 - 0
src/main/java/com/persagy/dmp/auth/AuthManager.java

@@ -0,0 +1,34 @@
+package com.persagy.dmp.auth;
+
+import com.alibaba.ttl.TransmittableThreadLocal;
+import com.persagy.dmp.entity.JWTUserDto;
+
+public class AuthManager {
+
+    private AuthManager() {
+    }
+
+    /**
+     * 支持父子线程之间的数据传递
+     */
+    private static final ThreadLocal<JWTUserDto> CONTEXT = new TransmittableThreadLocal<JWTUserDto>();
+    
+    /**
+     * projectId 不一定存在
+     * 
+     * @return
+     * @date 2022年5月18日 下午7:19:15
+     */
+    public static JWTUserDto currentUser() {
+        return CONTEXT.get();
+    }
+
+    public static void remove() {
+    	CONTEXT.remove();
+    }
+
+    static void setUser(JWTUserDto authUser) {
+    	CONTEXT.set(authUser);
+    }
+
+}

+ 88 - 0
src/main/java/com/persagy/dmp/auth/AuthenticationInterceptor.java

@@ -0,0 +1,88 @@
+package com.persagy.dmp.auth;
+
+
+import java.lang.reflect.Method;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import com.persagy.dmp.entity.JWTUserDto;
+
+import cn.hutool.core.util.StrUtil;
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.ExpiredJwtException;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@Component
+public class AuthenticationInterceptor implements HandlerInterceptor {
+
+	@Value("${auth.token.enable:false}")
+	private boolean authEnable;
+	
+    @Override
+    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) {
+    	/*String requestURI = httpServletRequest.getRequestURI();
+    	if (requestURI.contains("userRole/token")) {
+			return true;
+		}*/
+    	
+        if (!(object instanceof HandlerMethod)) {
+            return true;
+        }
+        HandlerMethod handlerMethod = (HandlerMethod) object;
+        Method method = handlerMethod.getMethod();
+        boolean anonymousInterface = method.isAnnotationPresent(Anonymous.class);
+        if (anonymousInterface) {
+            return true;
+        }
+        
+        String token = httpServletRequest.getHeader("Authorization");
+        try {
+        	// 为了兼容之前的逻辑,这里只要token不为空,就解析,并设置值,方便后续日志记录使用,authEnable 只是控制是否允许访问,不控制是否进行解析
+        	if (StrUtil.isNotBlank(token)) {
+        		Claims claims = JwtHelper.verifyJwt(token);
+                setUser(claims);
+			} else if (authEnable) {
+				throw new RuntimeException("用户登录信息不可为空");
+			}
+        } catch (ExpiredJwtException e) {
+        	log.warn("token已过期,token:{}", token);
+        	if (authEnable) {
+        		throw new RuntimeException("用户登录信息已过期");
+			}
+        } catch (Exception e) {
+        	log.warn("token校验失败,token:{}", token);
+        	if (authEnable) {
+        		throw new RuntimeException("用户登录信息鉴定失败");
+			}
+        }
+
+        return true;
+    }
+
+
+    private void setUser(Claims claims) {
+    	String groupCode = claims.get("groupCode", String.class);
+    	String projectId = claims.get("projectId", String.class);
+        String userId = claims.get("userId", String.class);
+        String username = claims.get("username", String.class);
+        String name = claims.get("name", String.class);
+        String roleName = claims.get("roleName", String.class);
+        String ip = claims.get("ip", String.class);
+        JWTUserDto jwtUserDto = new JWTUserDto(userId, username, name, roleName, ip);
+        jwtUserDto.setGroupCode(groupCode);
+        jwtUserDto.setProjectId(projectId);
+        AuthManager.setUser(jwtUserDto);
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
+        AuthManager.remove();
+    }
+}

+ 134 - 0
src/main/java/com/persagy/dmp/auth/JwtHelper.java

@@ -0,0 +1,134 @@
+package com.persagy.dmp.auth;
+
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.JwtBuilder;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.SignatureAlgorithm;
+
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+public class JwtHelper {
+
+    public static final String JWT_ID = "tokenId";
+    /**
+     * token 过期时间, 单位: 毫秒. 不过期
+     */
+    private static final long TOKEN_EXPIRED_TIME = 300000000000L;
+    /**
+     * jwt 加密解密密钥   ibms --> md5
+     */
+    private static final String JWT_SECRET = "c200b99a3c0a49028c7d1fda239ae341";
+
+    private static SecretKey KEY = null;
+
+    static {
+        try {
+            KEY = new SecretKeySpec(JWT_SECRET.getBytes("UTF-8"), 0, JWT_SECRET.length(), "AES");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static String createJWT(Map<String, Object> claims, Long time) {
+        SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
+        Date now = new Date(System.currentTimeMillis());
+
+        long nowMillis = System.currentTimeMillis();
+
+        JwtBuilder builder = Jwts.builder()
+                .setClaims(claims)
+                .setId(JWT_ID)
+                .setIssuedAt(now)
+                .signWith(signatureAlgorithm, KEY);
+        if (time >= 0) {
+            long expMillis = nowMillis + time;
+            Date exp = new Date(expMillis);
+            builder.setExpiration(exp);
+        }
+        return builder.compact();
+    }
+
+    /**
+     * 验证jwt
+     */
+    public static Claims verifyJwt(String token) {
+        return Jwts.parser()
+                .setSigningKey(KEY)
+                .parseClaimsJws(token).getBody();
+    }
+
+    /**
+     * 根据userId和openid生成token
+     */
+    public static String generateToken(String userId, String name, String roleName, String ip) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("userId", userId);
+        map.put("name", name);
+        map.put("roleName", roleName);
+        map.put("ip", ip);
+        return createJWT(map, TOKEN_EXPIRED_TIME);
+    }
+    
+    /**
+     * 
+     * @param userId
+     * @param name
+     * @param roleName
+     * @param ip
+     * @param expireTime 单位:毫秒,2400000
+     * @return
+     * @date 2022年4月18日 下午2:55:17
+     */
+    public static String generateToken(String userId, String name, String roleName, String ip, long expireTime) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("userId", userId);
+        map.put("name", name);
+        map.put("roleName", roleName);
+        map.put("ip", ip);
+        return JwtHelper.createJWT(map, expireTime);
+    }
+    
+    
+    /**
+     * 根据userId和openid生成token
+     */
+    public static String generateToken(String groupCode, String projectId, String userId, String username, String name, String roleName, String ip) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("groupCode", groupCode);
+        map.put("projectId", projectId);
+        map.put("userId", userId);
+        map.put("username", username);
+        map.put("name", name);
+        map.put("roleName", roleName);
+        map.put("ip", ip);
+        return createJWT(map, TOKEN_EXPIRED_TIME);
+    }
+    
+    /**
+     * 
+     * @param userId
+     * @param name
+     * @param roleName
+     * @param ip
+     * @param expireTime 单位:毫秒,2400000
+     * @return
+     * @date 2022年4月18日 下午2:55:17
+     */
+    public static String generateToken(String groupCode, String projectId, String userId, String username, String name, String roleName, String ip, long expireTime) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("groupCode", groupCode);
+        map.put("projectId", projectId);
+        map.put("userId", userId);
+        map.put("username", username);
+        map.put("name", name);
+        map.put("roleName", roleName);
+        map.put("ip", ip);
+        return JwtHelper.createJWT(map, expireTime);
+    }
+    
+}

+ 77 - 0
src/main/java/com/persagy/dmp/cache/DataDictCache.java

@@ -0,0 +1,77 @@
+package com.persagy.dmp.cache;
+
+import com.alibaba.fastjson.JSONArray;
+import com.google.common.base.Joiner;
+import com.persagy.dmp.constant.RedisConstant;
+import com.persagy.dmp.dto.InfoPointDictDTO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Random;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @description: 数据字典缓存
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/12/29 16:09
+ * @version: V1.0
+ **/
+@Component
+public class DataDictCache {
+
+    private final static Logger logger = LoggerFactory.getLogger(DataDictCache.class);
+
+    private static final Joiner joiner = Joiner.on(":").skipNulls();
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    public void putDataDict(String groupCode, String projectId, String classCode, List<InfoPointDictDTO> infoPointDictDTOList) {
+        try {
+            if (!CollectionUtils.isEmpty(infoPointDictDTOList)) {
+                Random random = new Random();
+                String key = joiner.join(RedisConstant.DATA_DICT_PREFIX, groupCode, projectId, classCode);
+                //随机设定60到120分钟的过期时间
+                redisTemplate.opsForValue().set(key, infoPointDictDTOList, random(random, 120, 60), TimeUnit.MINUTES);
+            }
+        } catch (Exception e) {
+            logger.error("数据字典缓存异常", e);
+        }
+    }
+
+    public List<InfoPointDictDTO> getDataDict(String groupCode, String projectId, String classCode) {
+        try {
+            String key = joiner.join(RedisConstant.DATA_DICT_PREFIX, groupCode, projectId, classCode);
+            Object object = redisTemplate.opsForValue().get(key);
+            if (object != null) {
+                return JSONArray.parseArray(object.toString()).toJavaList(InfoPointDictDTO.class);
+            }
+        } catch (Exception e) {
+            logger.error("获取数据字典缓存异常", e);
+        }
+        return null;
+    }
+
+    /**
+     * @description: 产生随机数
+     * @param: random
+     * @param: max 随机数最大值
+     * @param: min 随机数最小值
+     * @return: int
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/29 15:53
+     * @version: V1.0
+     */
+    private int random(Random random, int max, int min) {
+        return random.nextInt(max - min + 1) + max;
+    }
+}

+ 228 - 0
src/main/java/com/persagy/dmp/cache/LocationCache.java

@@ -0,0 +1,228 @@
+package com.persagy.dmp.cache;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.base.Joiner;
+import com.persagy.dmp.constant.RedisConstant;
+import com.persagy.dmp.dto.EquipBelongModularDTO;
+import com.persagy.dmp.dto.EquipLocationDTO;
+import com.persagy.dmp.dto.SpaceLocationDTO;
+import com.persagy.dmp.dto.SystemLocationDTO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @description: 对象位置缓存
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/12/23 15:12
+ * @version: V1.0
+ **/
+@Component
+public class LocationCache {
+
+    private final static Logger logger = LoggerFactory.getLogger(LocationCache.class);
+
+    private static final Joiner joiner = Joiner.on(":").skipNulls();
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    public void putEquipLocation(String groupCode, String projectId, List<EquipLocationDTO> equipLocationDTOList) {
+        try {
+            Random random = new Random();
+
+            if (!CollectionUtils.isEmpty(equipLocationDTOList)) {
+                Map<String, EquipLocationDTO> map = new HashMap<>();
+
+                equipLocationDTOList.forEach(
+                        o -> {
+                            String key = joiner.join(RedisConstant.EQUIP_LOCATION_PREFIX, groupCode, projectId, o.getEquipId());
+                            map.put(key, o);
+                        });
+                redisTemplate.opsForValue().multiSet(map);
+                equipLocationDTOList.forEach(
+                        o -> {
+                            String key = joiner.join(RedisConstant.EQUIP_LOCATION_PREFIX, groupCode, projectId, o.getEquipId());
+                            //随机设定60到120分钟的过期时间
+                            redisTemplate.expire(key, random(random, 120, 60), TimeUnit.MINUTES);
+                        });
+            }
+        } catch (Exception e) {
+            logger.error("设备位置缓存异常", e);
+        }
+    }
+    public void putModularBox(String groupCode, String projectId, List<EquipBelongModularDTO> equipLocationDTOList) {
+        try {
+            Random random = new Random();
+
+            if (!CollectionUtils.isEmpty(equipLocationDTOList)) {
+                Map<String, EquipBelongModularDTO> map = new HashMap<>();
+
+                equipLocationDTOList.forEach(
+                        o -> {
+                            String key = joiner.join(RedisConstant.EQUIP_MODULAR_BOX_PREFIX, groupCode, projectId, o.getEquipId());
+                            map.put(key, o);
+                        });
+                redisTemplate.opsForValue().multiSet(map);
+                equipLocationDTOList.forEach(
+                        o -> {
+                            String key = joiner.join(RedisConstant.EQUIP_MODULAR_BOX_PREFIX, groupCode, projectId, o.getEquipId());
+                            //随机设定60到120分钟的过期时间
+                            redisTemplate.expire(key, random(random, 120, 60), TimeUnit.MINUTES);
+                        });
+            }
+        } catch (Exception e) {
+            logger.error("设备位置缓存异常", e);
+        }
+    }
+
+    public List<EquipLocationDTO> getEquipLocation(String groupCode, String projectId, List<String> equipId) {
+        List<EquipLocationDTO> equipLocationDTOList = new ArrayList<>();
+        try {
+            List<String> list = new ArrayList<>();
+            equipId.forEach(o -> list.add(joiner.join(RedisConstant.EQUIP_LOCATION_PREFIX, groupCode, projectId, o)));
+            List<Object> objectList = redisTemplate.opsForValue().multiGet(list);
+            if (!CollectionUtils.isEmpty(objectList)) {
+                objectList.forEach(o -> {
+                    if (o != null) {
+                        equipLocationDTOList.add(JSONObject.parseObject(o.toString()).toJavaObject(EquipLocationDTO.class));
+                    }
+                });
+            }
+        } catch (Exception e) {
+            logger.error("获取设备位置缓存异常", e);
+        }
+        return equipLocationDTOList;
+    }
+    public List<EquipBelongModularDTO> getEquipBelongModular(String groupCode, String projectId, List<String> equipId) {
+        List<EquipBelongModularDTO> equipLocationDTOList = new ArrayList<>();
+        try {
+            List<String> list = new ArrayList<>();
+            equipId.forEach(o -> list.add(joiner.join(RedisConstant.EQUIP_MODULAR_BOX_PREFIX, groupCode, projectId, o)));
+            List<Object> objectList = redisTemplate.opsForValue().multiGet(list);
+            if (!CollectionUtils.isEmpty(objectList)) {
+                objectList.forEach(o -> {
+                    if (o != null) {
+                        equipLocationDTOList.add(JSONObject.parseObject(o.toString()).toJavaObject(EquipBelongModularDTO.class));
+                    }
+                });
+            }
+        } catch (Exception e) {
+            logger.error("获取设备位置缓存异常", e);
+        }
+        return equipLocationDTOList;
+    }
+
+
+    public void putSpaceLocation(String groupCode, String projectId, List<SpaceLocationDTO> spaceLocationDTOList) {
+        try {
+            Random random = new Random();
+            if (!CollectionUtils.isEmpty(spaceLocationDTOList)) {
+                Map<String, SpaceLocationDTO> map = new HashMap<>();
+
+                spaceLocationDTOList.forEach(
+                        o -> {
+                            String key = joiner.join(RedisConstant.SPACE_LOCATION_PREFIX, groupCode, projectId, o.getSpaceId());
+                            map.put(key, o);
+                        });
+                redisTemplate.opsForValue().multiSet(map);
+                spaceLocationDTOList.forEach(
+                        o -> {
+                            String key = joiner.join(RedisConstant.SPACE_LOCATION_PREFIX, groupCode, projectId, o.getSpaceId());
+                            //随机设定60到120分钟的过期时间
+                            redisTemplate.expire(key, random(random, 120, 60), TimeUnit.MINUTES);
+                        });
+
+            }
+        } catch (Exception e) {
+            logger.error("空间位置缓存异常", e);
+        }
+    }
+
+
+    public List<SpaceLocationDTO> getSpaceLocation(String groupCode, String projectId, List<String> spaceId) {
+        List<SpaceLocationDTO> spaceLocationDTOList = new ArrayList<>();
+        try {
+            List<String> list = new ArrayList<>();
+            spaceId.forEach(o -> list.add(joiner.join(RedisConstant.SPACE_LOCATION_PREFIX, groupCode, projectId, o)));
+            List<Object> objectList = redisTemplate.opsForValue().multiGet(list);
+            if (!CollectionUtils.isEmpty(objectList)) {
+                objectList.forEach(o -> {
+                    if (o != null) {
+                        spaceLocationDTOList.add(JSONObject.parseObject(o.toString()).toJavaObject(SpaceLocationDTO.class));
+                    }
+                });
+            }
+        } catch (Exception e) {
+            logger.error("获取空间位置缓存异常", e);
+        }
+        return spaceLocationDTOList;
+    }
+
+
+    public void putSystemLocation(String groupCode, String projectId, List<SystemLocationDTO> systemLocationDTOList) {
+        try {
+            Random random = new Random();
+            if (!CollectionUtils.isEmpty(systemLocationDTOList)) {
+                Map<String, SystemLocationDTO> map = new HashMap<>();
+
+                systemLocationDTOList.forEach(
+                        o -> {
+                            String key = joiner.join(RedisConstant.SYSTEM_LOCATION_PREFIX, groupCode, projectId, o.getSystemId());
+                            map.put(key, o);
+                        });
+                redisTemplate.opsForValue().multiSet(map);
+                systemLocationDTOList.forEach(
+                        o -> {
+                            String key = joiner.join(RedisConstant.SYSTEM_LOCATION_PREFIX, groupCode, projectId, o.getSystemId());
+                            //随机设定60到120分钟的过期时间
+                            redisTemplate.expire(key, random(random, 120, 60), TimeUnit.MINUTES);
+                        });
+            }
+        } catch (Exception e) {
+            logger.error("系统位置缓存异常", e);
+        }
+    }
+
+
+    public List<SystemLocationDTO> getSystemLocation(String groupCode, String projectId, List<String> systemId) {
+        List<SystemLocationDTO> systemLocationDTOList = new ArrayList<>();
+        try {
+            List<String> list = new ArrayList<>();
+            systemId.forEach(o -> list.add(joiner.join(RedisConstant.SYSTEM_LOCATION_PREFIX, groupCode, projectId, o)));
+            List<Object> objectList = redisTemplate.opsForValue().multiGet(list);
+            if (!CollectionUtils.isEmpty(objectList)) {
+                objectList.forEach(o -> {
+                    if (o != null) {
+                        systemLocationDTOList.add(JSONObject.parseObject(o.toString()).toJavaObject(SystemLocationDTO.class));
+                    }
+                });
+            }
+        } catch (Exception e) {
+            logger.error("获取系统位置缓存异常", e);
+        }
+        return systemLocationDTOList;
+    }
+
+    /**
+     * @description: 产生随机数
+     * @param: random
+     * @param: max 随机数最大值
+     * @param: min 随机数最小值
+     * @return: int
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/29 15:53
+     * @version: V1.0
+     */
+    private int random(Random random, int max, int min) {
+        return random.nextInt(max - min + 1) + max;
+    }
+}

+ 118 - 0
src/main/java/com/persagy/dmp/cache/MeterFuncCache.java

@@ -0,0 +1,118 @@
+//package com.persagy.dmp.cache;
+//
+//import com.alibaba.fastjson.JSONObject;
+//import com.google.common.base.Joiner;
+//import com.persagy.dmp.constant.RedisConstant;
+//import com.persagy.dmp.dto.MeterFuncIdDTO;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.data.redis.core.RedisTemplate;
+//import org.springframework.stereotype.Component;
+//import org.springframework.util.CollectionUtils;
+//
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//import java.util.concurrent.TimeUnit;
+//
+///**
+// * @description: 表号-功能号缓存
+// * @author: xingmaojun
+// * @company: Persagy Technology Co.,Ltd
+// * @since: 2021/1/13 15:01
+// * @version: V1.0
+// **/
+//@Component
+//public class MeterFuncCache {
+//
+//    private final static Logger logger = LoggerFactory.getLogger(MeterFuncCache.class);
+//
+//    private static final Joiner joiner = Joiner.on(":").skipNulls();
+//
+//    @Autowired
+//    private RedisTemplate<String, Object> redisTemplate;
+//
+//    //查询对象METER_FUNCID_PREFIX
+//
+//    public void putMeterFuncId(String groupCode, String projectId, List<MeterFuncIdDTO> meterFuncIdDTOS) {
+//        if (!CollectionUtils.isEmpty(meterFuncIdDTOS)) {
+//            Map<String, MeterFuncIdDTO> map = new HashMap<>();
+//            for (MeterFuncIdDTO meterFuncIdDTO : meterFuncIdDTOS) {
+//                String key = joiner.join(RedisConstant.METER_FUNCID_PREFIX, groupCode, projectId, meterFuncIdDTO.getObjectId(), meterFuncIdDTO.getInfoCode());
+//                map.put(key, meterFuncIdDTO);
+//            }
+//            redisTemplate.opsForValue().multiSet(map);
+//
+//            Map<String, MeterFuncIdDTO> map2 = new HashMap<>();
+//            for (MeterFuncIdDTO meterFuncIdDTO : meterFuncIdDTOS) {
+//                String key = joiner.join(RedisConstant.METER_FUNCID_PREFIX, groupCode, projectId, meterFuncIdDTO.getMeterId(), meterFuncIdDTO.getFuncId());
+//                map2.put(key, meterFuncIdDTO);
+//            }
+//            redisTemplate.opsForValue().multiSet(map2);
+//        }
+//    }
+//
+//    public void putMeterFuncId(String groupCode, String projectId, String objectId, String infoCode, MeterFuncIdDTO meterFuncIdDto) {
+//        String key = joiner.join(RedisConstant.METER_FUNCID_PREFIX, groupCode, projectId, objectId, infoCode);
+//        redisTemplate.opsForValue().set(key, meterFuncIdDto, 60, TimeUnit.MINUTES);
+//
+//        String key2 = joiner.join(RedisConstant.METER_FUNCID_PREFIX, groupCode, projectId, meterFuncIdDto.getMeterId(), meterFuncIdDto.getFuncId());
+//        redisTemplate.opsForValue().set(key2, meterFuncIdDto, 60, TimeUnit.MINUTES);
+//    }
+//
+//    public MeterFuncIdDTO getMeterFuncId(String groupCode, String projectId, String objectId, String infoCode) {
+//        String key = joiner.join(RedisConstant.METER_FUNCID_PREFIX, groupCode, projectId, objectId, infoCode);
+//        return (MeterFuncIdDTO) redisTemplate.opsForValue().get(key);
+//    }
+//
+//    public List<MeterFuncIdDTO> getMeterFuncIdList(String groupCode, String projectId, String objectId, List<String> infoCodeList) {
+//        List<MeterFuncIdDTO> meterFuncIdDtoList = new ArrayList<>();
+//        if (!CollectionUtils.isEmpty(infoCodeList)) {
+//            List<String> keys = new ArrayList<>();
+//            for (String o : infoCodeList) {
+//                String key = joiner.join(RedisConstant.METER_FUNCID_PREFIX, groupCode, projectId, objectId, o);
+//                keys.add(key);
+//            }
+//            List<Object> list = redisTemplate.opsForValue().multiGet(keys);
+//            if (!CollectionUtils.isEmpty(list)) {
+//                list.forEach(o -> {
+//                    if (o != null) {
+//                        meterFuncIdDtoList.add(JSONObject.parseObject(o.toString()).toJavaObject(MeterFuncIdDTO.class));
+//                    }
+//                });
+//            }
+//        }
+//        return meterFuncIdDtoList;
+//    }
+//
+//    public List<MeterFuncIdDTO> getMeterFuncIdList(String groupCode, String projectId, List<String> objectIdList, String infoCode) {
+//        List<MeterFuncIdDTO> meterFuncIdDtoList = new ArrayList<>();
+//        if (!CollectionUtils.isEmpty(objectIdList)) {
+//            List<String> keys = new ArrayList<>();
+//            for (String objectId : objectIdList) {
+//                String key = joiner.join(RedisConstant.METER_FUNCID_PREFIX, groupCode, projectId, objectId, infoCode);
+//                keys.add(key);
+//            }
+//            List<Object> list = redisTemplate.opsForValue().multiGet(keys);
+//            if (!CollectionUtils.isEmpty(list)) {
+//                list.forEach(o -> {
+//                    if (o != null) {
+//                        meterFuncIdDtoList.add(JSONObject.parseObject(o.toString()).toJavaObject(MeterFuncIdDTO.class));
+//                    }
+//                });
+//            }
+//        }
+//        return meterFuncIdDtoList;
+//    }
+//
+//    public MeterFuncIdDTO queryMeterFuncId(String groupCode, String projectId, String meterId, Integer funcId) {
+//        String key = joiner.join(RedisConstant.METER_FUNCID_PREFIX, groupCode, projectId, meterId, funcId);
+//        Object object = redisTemplate.opsForValue().get(key);
+//        if (object != null) {
+//            return JSONObject.parseObject(object.toString(), MeterFuncIdDTO.class);
+//        }
+//        return null;
+//    }
+//}

+ 178 - 0
src/main/java/com/persagy/dmp/cache/ObjectCache.java

@@ -0,0 +1,178 @@
+package com.persagy.dmp.cache;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.base.Joiner;
+import com.persagy.dmp.constant.RedisConstant;
+import com.persagy.dmp.service.ObjectService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @description: 对象缓存
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/12/30 16:47
+ * @version: V1.0
+ **/
+@Component
+@Slf4j
+public class ObjectCache {
+
+    private static final Joiner joiner = Joiner.on(":").skipNulls();
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    @Autowired
+    private ObjectService objectService;
+
+    public JSONArray getObjectByClassCode(String groupCode, String projectId, String classCode) {
+        try {
+            String key = joiner.join(RedisConstant.OBJECT_PREFIX, groupCode, projectId, classCode);
+            Set<String> keys = null;
+            if (classCode.length() == 4) {
+                //classCode为系统编码是,模式匹配会匹配到系统下设备类的对象,故模糊匹配机上Sy前缀
+                keys = redisTemplate.keys(key + "Sy*");
+            } else {
+                keys = redisTemplate.keys(key + "*");
+            }
+            Object object = redisTemplate.opsForValue().multiGet(keys);
+            return JSONArray.parseArray(object.toString());
+        } catch (Exception e) {
+            log.error("根据对象类型获取对象列表缓存异常", e);
+        }
+        return null;
+    }
+
+    public JSONObject getObjectById(String groupCode, String projectId, String objId) {
+        try {
+            String classCode = objectService.queryClassCode(groupCode, projectId, objId);
+            String key = joiner.join(RedisConstant.OBJECT_PREFIX, groupCode, projectId, classCode, objId);
+            return (JSONObject) redisTemplate.opsForValue().get(key);
+        } catch (Exception e) {
+            log.error("根据id获取对象缓存异常", e);
+        }
+        return null;
+    }
+
+    public JSONArray getObjectByIds(String groupCode, String projectId, List<String> objIds) {
+        JSONArray objArr = new JSONArray();
+        try {
+            if (!CollectionUtils.isEmpty(objIds)) {
+                Set<String> keys = new HashSet<>();
+                objIds.forEach(o -> {
+                    String classCode = null;
+                    try {
+                        classCode = objectService.queryClassCode(groupCode, projectId, o);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    keys.add(joiner.join(RedisConstant.OBJECT_PREFIX, groupCode, projectId, classCode, o));
+                });
+                List<Object> objects = redisTemplate.opsForValue().multiGet(keys);
+                if (!CollectionUtils.isEmpty(objects)) {
+                    objects.stream().filter(item-> ObjectUtil.isNotEmpty(item)).forEach(o -> {
+                        objArr.add(JSONObject.parseObject(o.toString()));
+                    });
+                }
+            }
+        } catch (Exception e) {
+            log.error("根据ids获取对象列表缓存异常", e);
+        }
+        return objArr;
+    }
+
+
+    public void putObject(String groupCode, String projectId, String classCode, JSONArray objects) {
+        try {
+            Random random = new Random();
+            if (!CollectionUtils.isEmpty(objects)) {
+                Map<String, JSONObject> map = new HashMap<>();
+                objects.forEach(o -> {
+                    JSONObject jsonObject = (JSONObject) o;
+                    String key = joiner.join(RedisConstant.OBJECT_PREFIX, groupCode, projectId, classCode, jsonObject.getString("id"));
+                    map.put(key, jsonObject);
+                });
+                redisTemplate.opsForValue().multiSet(map);
+                objects.forEach(
+                        o -> {
+                            JSONObject jsonObject = (JSONObject) o;
+                            String key = joiner.join(RedisConstant.OBJECT_PREFIX, groupCode, projectId, classCode, jsonObject.getString("id"));
+                            //随机设定60到120分钟的过期时间
+                            redisTemplate.expire(key, random(random, 120, 60), TimeUnit.MINUTES);
+                        });
+            }
+        } catch (Exception e) {
+            log.error("缓存对象列表异常", e);
+        }
+    }
+
+    public void putObject(String groupCode, String projectId, JSONObject object) {
+        try {
+            String classCode = object.getString("classCode");
+            String key = joiner.join(RedisConstant.OBJECT_PREFIX,groupCode, projectId, classCode, object.getString("id"));
+            redisTemplate.opsForValue().set(key, object, random(new Random(), 120, 60), TimeUnit.MINUTES);
+        } catch (Exception e) {
+            log.error("缓存对象详情异常", e);
+        }
+    }
+
+    public void putObject(String groupCode, String projectId, JSONArray objects) {
+        try {
+            if (!CollectionUtils.isEmpty(objects)) {
+                objects.forEach(
+                        o -> {
+                            JSONObject jsonObject = (JSONObject) o;
+                            putObject(groupCode, projectId, jsonObject);
+                        }
+                );
+            }
+        } catch (Exception e) {
+            log.error("缓存对象列表异常", e);
+        }
+    }
+
+
+    public void putClassCode(String groupCode, String projectId, Map<String, String> objId2ClassCode) {
+        try {
+            String key = joiner.join(RedisConstant.CLASS_CODE_REL_PREFIX, groupCode, projectId);
+            redisTemplate.opsForHash().putAll(key, objId2ClassCode);
+        } catch (Exception e) {
+            log.error("缓存对象与对象类型关系异常", e);
+        }
+    }
+
+    public Map<String, String> getClassCode(String groupCode, String projectId, List<String> objIds) {
+        Map<String, String> objId2ClassCode = new HashMap<>();
+        try {
+            if (CollectionUtils.isEmpty(objIds)) {
+                return objId2ClassCode;
+            }
+            String key = joiner.join(RedisConstant.CLASS_CODE_REL_PREFIX, groupCode, projectId);
+            objIds.forEach(
+                    o -> {
+                        Object object = redisTemplate.opsForHash().get(key, o);
+                        if (object != null) {
+                            objId2ClassCode.put(o, (String) object);
+                        }
+                    }
+            );
+
+        } catch (Exception e) {
+            log.error("获取对象与对象类型关系缓存异常", e);
+        }
+        return objId2ClassCode;
+    }
+
+    private int random(Random random, int max, int min) {
+        return random.nextInt(max - min + 1) + max;
+    }
+}

+ 83 - 0
src/main/java/com/persagy/dmp/cache/RedisCache.java

@@ -0,0 +1,83 @@
+package com.persagy.dmp.cache;
+
+import com.alibaba.fastjson.JSON;
+import com.google.common.base.Joiner;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author : ZhangWenTao
+ * @version : 1.0
+ * @since : 2022/7/21 14:50
+ */
+@Slf4j
+@Component
+public class RedisCache {
+
+    private static final Joiner joiner = Joiner.on(":");
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+
+    public void put(String prefix, String key, Object value, long timeout, TimeUnit unit) {
+
+        try {
+            redisTemplate.opsForValue().set(joiner.join(prefix, key), toJSONString(value), timeout, unit);
+        } catch (Exception e) {
+            log.warn("set fail", e);
+        }
+    }
+
+    public <T> T get(String prefix, String key, Class<T> clazz) {
+        Object value = null;
+
+        try {
+            value = redisTemplate.opsForValue().get(joiner.join(prefix, key));
+        } catch (Exception e) {
+            log.warn("get fail", e);
+        }
+
+        if (Objects.isNull(value)) {
+            return null;
+        }
+
+        return parseObject(value, clazz);
+    }
+
+    private String toJSONString(Object object) {
+        return JSON.toJSONString(object);
+    }
+
+    private <T> T parseObject(Object object, Class<T> clazz) {
+        return JSON.parseObject(object.toString(), clazz);
+    }
+
+    public String joinKeys(String... strings) {
+        if (ArrayUtils.isEmpty(strings)) {
+            return StringUtils.EMPTY;
+        }
+
+        return joiner.join(strings);
+    }
+
+    public String md5(Collection<String> source) {
+        return DigestUtils.md5Hex(joinKeys(
+                ObjectUtils.defaultIfNull(source, Collections.<String>emptyList())
+                        .stream()
+                        .sorted()
+                        .toArray(String[]::new))
+        );
+    }
+}

+ 98 - 0
src/main/java/com/persagy/dmp/cache/RelationCache.java

@@ -0,0 +1,98 @@
+package com.persagy.dmp.cache;
+
+import com.alibaba.fastjson.JSONArray;
+import com.google.common.base.Joiner;
+import com.persagy.dmp.constant.RedisConstant;
+import com.persagy.dmp.service.ObjectService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.DataAccessException;
+import org.springframework.data.redis.connection.RedisConnection;
+import org.springframework.data.redis.core.Cursor;
+import org.springframework.data.redis.core.RedisCallback;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.ScanOptions;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @description: 关系缓存
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2021/1/4 18:04
+ * @version: V1.0
+ **/
+@Component
+public class RelationCache {
+
+    private final static Logger logger = LoggerFactory.getLogger(RelationCache.class);
+
+    private static final Joiner joiner = Joiner.on(":").skipNulls();
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    @Autowired
+    private ObjectService objectService;
+
+    public void putRelation(String prefix, String groupCode, String projectId, String id, String category, JSONArray objArr) {
+        try {
+            String key = joiner.join(prefix, groupCode, projectId, id, category);
+            redisTemplate.opsForValue().set(key, objArr, 60, TimeUnit.MINUTES);
+        } catch (Exception e) {
+            logger.error("关系对象缓存异常", e);
+        }
+    }
+
+    public JSONArray getRelation(String prefix, String groupCode, String projectId, String id, String category) {
+        try {
+            String key = joiner.join(prefix, groupCode, projectId, id, category);
+            Object object = redisTemplate.opsForValue().get(key);
+            if (object != null) {
+                return JSONArray.parseArray(object.toString());
+            }
+        } catch (Exception e) {
+            logger.error("获取关系对象缓存异常", e);
+        }
+        return null;
+    }
+
+    public void putRelation(String groupCode, String projectId, String graphCode, String relCode, String fromId, List<String> toIds) {
+        try {
+            String key = joiner.join(RedisConstant.RELATION_PREFIX, groupCode, projectId, graphCode, relCode,
+                    "from", fromId, "to", toIds);
+            Set<String> keys = redisTemplate.keys(key + "*");
+
+        } catch (Exception e) {
+            logger.error("获取系统位置缓存异常", e);
+        }
+    }
+
+    public void putRelation(String groupCode, String projectId, String graphCode, String relCode, String fromId, String toId) {
+        try {
+            String key = joiner.join(RedisConstant.RELATION_PREFIX, groupCode, projectId, graphCode, relCode,
+                    "from", fromId, "to", toId);
+            Cursor<Object> cursor = redisTemplate.opsForSet().scan("", ScanOptions.scanOptions().match("").build());
+
+            redisTemplate.opsForSet().scan("setValue", ScanOptions.scanOptions().match("C").build());
+            while (cursor.hasNext()) {
+                Object object = cursor.next();
+                System.out.println("通过scan(K key, ScanOptions options)方法获取匹配的值:" + object);
+            }
+            redisTemplate.executePipelined(new RedisCallback<Object>() {
+                @Override
+                public Object doInRedis(RedisConnection redisConnection) throws DataAccessException {
+                    //  redisConnection.
+                    return null;
+                }
+            });
+
+        } catch (Exception e) {
+            logger.error("获取系统位置缓存异常", e);
+        }
+    }
+}

+ 91 - 0
src/main/java/com/persagy/dmp/client/AlarmNewServerClient.java

@@ -0,0 +1,91 @@
+package com.persagy.dmp.client;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.SpringQueryMap;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.url.FuncIdUrParam;
+import com.persagy.dmp.common.url.InstanceUrlParam;
+import com.persagy.dmp.constant.RequestUrlConstant;
+import com.persagy.dmp.dto.QueryFuncId;
+
+/**
+ * 最新的报警类型查询服务
+ * @author 易涛
+ * @version 1.0
+ * @date 2021/6/23 15:58
+ */
+@FeignClient(name = "PERSAGY-ZKT-DMP", url = "${persagy.zkt.dmp.url:}")
+public interface AlarmNewServerClient {
+    
+    /**
+     * 产品模块(场景)下的管理对象类型
+     * @param jsonObject 产品模块编码
+     * @author 易涛
+     * @date 2021/6/23 17:02 
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @PostMapping("/rwd/def/class")
+    JSONObject queryObjectClass(@SpringQueryMap InstanceUrlParam instanceUrlParam,@RequestBody JSONObject jsonObject);
+
+    /**
+     * 管理对象类型的信息点
+     * @param jsonObject 模块,类型编码
+     * @author 易涛
+     * @date 2021/6/23 17:07 
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @PostMapping("/rwd/def/funcid")
+    JSONObject queryInfoCode(@SpringQueryMap InstanceUrlParam instanceUrlParam,@RequestBody JSONObject jsonObject);
+    
+    /**
+     * 查询对象
+     * @param instanceUrlParam get的对象
+     * @param jsonObject post对象
+     * @author 易涛
+     * @date 2021/6/23 16:26 
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @PostMapping("/rwd/instance/object/query")
+    JSONObject  queryObject(@SpringQueryMap InstanceUrlParam instanceUrlParam, @RequestBody JSONObject jsonObject);
+
+    /**
+     * 查询关系
+     * @param instanceUrlParam get的对象
+     * @param jsonObject post对象
+     * @author 易涛
+     * @date 2021/6/23 16:42
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @PostMapping("/rwd/instance/relation/query")
+    JSONObject queryRelation(@SpringQueryMap InstanceUrlParam instanceUrlParam, @RequestBody JSONObject jsonObject);
+
+    /**
+     * 查询对象关系
+     * @param instanceUrlParam get的对象
+     * @param jsonObject post对象
+     * @author 易涛
+     * @date 2021/6/23 16:42
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @PostMapping("/rwd/instance/relation/object/query")
+    JSONObject queryObjectRelation(@SpringQueryMap InstanceUrlParam instanceUrlParam, @RequestBody JSONObject jsonObject);
+
+
+
+    /**
+     * @description: 查询信息点定义
+     * @param: funcIdUrParam
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/28 15:51
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.DEF_FUNCID)
+    DmpResult<JSONArray> queryFuncId(@SpringQueryMap FuncIdUrParam funcIdUrParam, QueryFuncId queryFuncId);
+}

+ 38 - 0
src/main/java/com/persagy/dmp/client/DicServerClient.java

@@ -0,0 +1,38 @@
+package com.persagy.dmp.client;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.SpringQueryMap;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.url.DicUrlParam;
+import com.persagy.dmp.constant.RequestUrlConstant;
+
+/**
+ * @description: 数据中台 字典 feign
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 11:23
+ * @version: V1.0
+ **/
+@FeignClient(name = "dmp-dic")
+public interface DicServerClient {
+
+    /**
+     * @description: 查询字典
+     * @param: objectUrlParam
+     * @param: relationCriteriaList
+     * @return: com.persagy.dmp.config.WorldJsonResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/22 16:37
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.DICT_QUERY)
+    DmpResult<JSONArray> dataQuery(@SpringQueryMap DicUrlParam dicUrlParam, @RequestBody JSONObject criteria);
+
+
+}

+ 74 - 0
src/main/java/com/persagy/dmp/client/EmsCollectClient.java

@@ -0,0 +1,74 @@
+package com.persagy.dmp.client;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.persagy.dmp.constant.RequestUrlConstant;
+import com.persagy.dmp.dto.collect.BatchPointReportParam;
+import com.persagy.dmp.dto.collect.BatchPointReportResult;
+import com.persagy.dmp.dto.collect.PointReportParam;
+import com.persagy.dmp.dto.collect.PointReportResult;
+
+/**
+ * @description: 采集服务
+ * @author: shiliqiang
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/9/21 18:15
+ * @version: V1.0
+ */
+@FeignClient(name = "iot-collect", url = "${iot.collect.feign.client.url:}")
+public interface EmsCollectClient {
+
+    /**
+     * @description: 异步采集-读取点位
+     * @param: pointReportParam
+     * @return: com.persagy.dmp.dto.collect.PointReportResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:44
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.POINT_READ_POST)
+    PointReportResult pointRead(@RequestBody PointReportParam pointReportParam);
+
+    /**
+     * @description: 异步采集-批量读取点位
+     * @param: pointReportParam
+     * @return: com.persagy.dmp.dto.collect.PointReportResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:44
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.POINT_READ_BATCH_POST)
+    BatchPointReportResult pointReadBatch(@RequestBody BatchPointReportParam batchPointReportParam);
+
+    /**
+     * @description: 查询采集当前值
+     * @param: pointReportParam
+     * @return: com.persagy.dmp.dto.collect.PointReportResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:43
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.PRESENT_REPORT_POST)
+    PointReportResult presentReport(@RequestBody PointReportParam pointReportParam);
+
+    /**
+     * @description: 批量查询采集当前值
+     * @param: batchPointReportParam
+     * @return: com.persagy.dmp.dto.collect.BatchPointReportResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:43
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.PRESENT_REPORT_BATCH_POST)
+    BatchPointReportResult presentReportBatch(@RequestBody BatchPointReportParam batchPointReportParam);
+}

+ 113 - 0
src/main/java/com/persagy/dmp/client/EmsControlClient.java

@@ -0,0 +1,113 @@
+package com.persagy.dmp.client;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.persagy.dmp.constant.RequestUrlConstant;
+import com.persagy.dmp.dto.control.BatchPointSetParam;
+import com.persagy.dmp.dto.control.BatchPointSetResult;
+import com.persagy.dmp.dto.control.PointSetParam;
+import com.persagy.dmp.dto.control.PointSetResult;
+
+/**
+ * @description: 控制程序(指令下发)
+ * @author: shiliqiang
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/30 16:44
+ * @version: V1.0
+ */
+@FeignClient(name = "iot-collect", url = "${iot.collect.feign.client.url:}")
+public interface EmsControlClient {
+
+    /**
+     * @description: 异步控制-设置点位
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.PointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:41
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.POINT_SET_POST)
+    PointSetResult pointSet(@RequestBody PointSetParam pointSetParam);
+
+    /**
+     * @description: 异步控制-批量设置点位
+     * @param: batchPointSetParam
+     * @return: com.persagy.dmp.dto.control.BatchPointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:41
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.POINT_SET_BATCH_POST)
+    BatchPointSetResult pointSetBatch(@RequestBody BatchPointSetParam batchPointSetParam);
+
+    /**
+     * @description: 同步控制-设置点位
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.PointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:41
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.SYNC_POINT_SET_POST)
+    PointSetResult syncPointSet(@RequestBody PointSetParam pointSetParam);
+
+    /**
+     * @description: 同步控制-批量设置点位
+     * @param: batchPointSetParam
+     * @return: com.persagy.dmp.dto.control.BatchPointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:41
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.SYNC_POINT_SET_BATCH_POST)
+    BatchPointSetResult syncPointSetBatch(@RequestBody BatchPointSetParam batchPointSetParam);
+
+    /**
+     * @description: 异步控制-批量查询控制结果
+     * @param: batchPointSetParam
+     * @return: com.persagy.dmp.dto.control.BatchPointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:41
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.POINT_SET_RESULT_BATCH_POST)
+    BatchPointSetResult pointSetResultBatch(@RequestBody BatchPointSetParam batchPointSetParam);
+
+    /**
+     * @description: 查询控制当前值
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.PointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:42
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.PRESENT_SET_POST)
+    PointSetResult presentSet(@RequestBody PointSetParam pointSetParam);
+
+    /**
+     * @description: 批量查询控制当前值
+     * @param: batchPointSetParam
+     * @return: com.persagy.dmp.dto.control.BatchPointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:42
+     * @version: V1.0
+     */
+    @PostMapping(value = RequestUrlConstant.PRESENT_SET_BATCH_POST)
+    BatchPointSetResult presentSetBatch(@RequestBody BatchPointSetParam batchPointSetParam);
+}

+ 66 - 0
src/main/java/com/persagy/dmp/client/GroupServerClient.java

@@ -0,0 +1,66 @@
+package com.persagy.dmp.client;
+
+import java.util.List;
+
+import javax.validation.Valid;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.dmp.dto.ResponseContent;
+import com.persagy.dmp.dto.logicalGrouping.LogicalGroupingDTO;
+import com.persagy.dmp.dto.logicalGrouping.LogicalObjectDTO;
+
+/**
+ * 编组数据查询服务
+ * @author weiyizhong
+ * @version 1.0
+ * @date 2021/6/23 15:58
+ */
+@FeignClient(name = "zkt-monitor")
+public interface GroupServerClient {
+    
+    /**
+     * 查询逻辑编组下的对象信息
+     * @param logicalObjectDTO 请求参数
+     * @author weiyizhong
+     * @date 2021/6/23 17:02 
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @PostMapping("/logicalObject/listPage")
+    ResponseContent<List<LogicalObjectDTO>>  queryObjectClass(@RequestBody LogicalObjectDTO logicalObjectDTO);
+
+    /**
+     * 查询编组详情信息
+     * @param logicalObjectDTO 请求参数
+     * @author weiyizhong
+     * @date 2021/6/23 17:02
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @PostMapping("/logicalGrouping/list")
+    ResponseContent<List<LogicalGroupingDTO>> listLogicalGroupingDTO( @RequestBody LogicalGroupingDTO logicalObjectDTO);
+
+    /**
+     * 查询编组及其对象列表
+     * @param record 请求参数
+     * @author weiyizhong
+     * @date 2021/6/23 17:02
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @PostMapping("/logicalGrouping/listGroupingObject")
+    ResponseContent<List<LogicalGroupingDTO>>  listGroupingObject( @Valid @RequestBody LogicalGroupingDTO record);
+
+    /**
+     * 查询编组详情信息
+     * @param record 请求参数
+     * @author weiyizhong
+     * @date 2021/6/23 17:02
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @PostMapping("/logicalGrouping/listPageNotGroupingObject")
+    ResponseContent<List<JSONObject>>  listPageNotGroupingObject(@Valid @RequestBody LogicalGroupingDTO record);
+
+
+}

+ 66 - 0
src/main/java/com/persagy/dmp/client/OrgServerClient.java

@@ -0,0 +1,66 @@
+package com.persagy.dmp.client;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.SpringQueryMap;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.url.DicUrlParam;
+import com.persagy.dmp.constant.RequestUrlConstant;
+import com.persagy.dmp.dto.org.GroupInfoDTO;
+import com.persagy.dmp.dto.org.ProjectInfoDTO;
+
+/**
+ * @author LuoGuangyi
+ * @version 1.0.0
+ * @Description 数据中台人员组织机构
+ * @ClassName OrgClient.java
+ * @createTime 2021/01/13 11:54
+ * @Since
+ */
+@FeignClient(name = "dmp-org", url = "${persgay.dmp.org.url:}")
+public interface OrgServerClient {
+
+    /**
+     * @param dicUrlParam:
+     * @param criteria:
+     * @description: 查询用户信息
+     * @author: LuoGuangyi
+     * @createTime: 2021/01/13 12:59
+     * @return: com.persagy.dmp.common.DmpResult<com.alibaba.fastjson.JSONArray>
+     * @expression
+     */
+    @PostMapping(RequestUrlConstant.ORG_USER_QUERY)
+    DmpResult<JSONArray> queryUser(@SpringQueryMap DicUrlParam dicUrlParam, @RequestBody JSONObject criteria);
+
+    /**
+     * @description: 查询集团
+     * @param: dicUrlParam:
+     * @param: criteria:
+     * @return: com.persagy.dmp.common.DmpResult<com.persagy.dmp.dto.org.GroupInfoDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2021/3/16 10:26
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.ORG_GROUP_QUERY)
+    DmpResult<GroupInfoDTO> queryGroup(@SpringQueryMap DicUrlParam dicUrlParam, @RequestBody JSONObject criteria);
+
+    /**
+     * @description: 查询项目
+     * @param: dicUrlParam:
+     * @param: criteria:
+     * @return: com.persagy.dmp.common.DmpResult<ProjectInfoDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2021/3/16 10:26
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.ORG_PROJECT_QUERY)
+    DmpResult<ProjectInfoDTO> queryProject(@SpringQueryMap DicUrlParam dicUrlParam, @RequestBody JSONObject criteria);
+}

+ 49 - 0
src/main/java/com/persagy/dmp/client/PersonCenterClient.java

@@ -0,0 +1,49 @@
+package com.persagy.dmp.client;
+
+import javax.validation.Valid;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.dmp.common.IntegratedResponseResult;
+import com.persagy.dmp.constant.RequestUrlConstant;
+import com.persagy.dmp.dto.QueryPersonDTO;
+
+
+/**
+ * @author LuoGuangyi
+ * @version 1.0.0
+ * @Description 人员服务
+ * @ClassName PersonCenterClient.java
+ * @createTime 2020/12/29 17:39
+ * @Since
+ */
+@FeignClient(name = "person-center", url = "${integrated.person.center.url:}")
+public interface PersonCenterClient {
+
+
+    /**
+     * @param queryPersonDTO:
+     * @description: 查询人员详情
+     * @author: LuoGuangyi
+     * @createTime: 2020/12/29 17:39
+     * @return: com.persagy.dmp.common.IntegratedResponseResult<com.persagy.dmp.dto.dict.DictTypeDTO>
+     * @expression
+     */
+    @PostMapping(RequestUrlConstant.PERSON_CENTER_QUERY_PERSON_DETAIL_BY_ID)
+    IntegratedResponseResult<JSONObject> queryPersonDetailById(@RequestBody @Valid QueryPersonDTO queryPersonDTO);
+    
+    /**
+     * @param queryPersonDTO:
+     * @description: 查询人员详情
+     * @author: LuoGuangyi
+     * @createTime: 2020/12/29 17:39
+     * @return: com.persagy.dmp.common.IntegratedResponseResult<com.persagy.dmp.dto.dict.DictTypeDTO>
+     * @expression
+     */
+    @PostMapping(RequestUrlConstant.PERSON_CENTER_QUERY_PERSON_TOKEN_BY_USERNAME)
+    IntegratedResponseResult<JSONObject> queryPersonTokenByUserName(@RequestBody QueryPersonDTO queryPersonDTO);
+    
+}

+ 192 - 0
src/main/java/com/persagy/dmp/client/RwdServerClient.java

@@ -0,0 +1,192 @@
+package com.persagy.dmp.client;
+
+import java.util.List;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.SpringQueryMap;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.url.ClassUrParam;
+import com.persagy.dmp.common.url.FuncIdUrParam;
+import com.persagy.dmp.common.url.IOTUrlParam;
+import com.persagy.dmp.common.url.InstanceUrlParam;
+import com.persagy.dmp.constant.RequestUrlConstant;
+import com.persagy.dmp.dto.DataQueryDTO;
+import com.persagy.dmp.dto.HistoryDataQuery;
+import com.persagy.dmp.dto.QueryFuncId;
+import com.persagy.dmp.dto.relation.CreateRelation;
+import com.persagy.dmp.dto.relation.QueryRelation;
+import com.persagy.dmp.dto.relation.QueryRelationObject;
+
+/**
+ * @description: 数据中台物理世界、数据字典、IOT 接口feign
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 11:28
+ * name = "dmp-rwd"
+ * name = "persagy-zkt-dmp"
+ * url = "http://39.102.43.179:9976"
+ * @version: V1.0
+ */
+@FeignClient(name = "persagy-zkt-dmp", url = "${persagy.zkt.dmp.url:}")
+public interface RwdServerClient {
+
+    /**
+     * @description: 查询对象列表
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/21 17:09
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.OBJECT_QUERY)
+    DmpResult<JSONArray> queryObject(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONObject criteria);
+
+    /**
+     * @description: 创建对象
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/21 17:09
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.OBJECT_CREATE)
+    DmpResult createObject(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONArray objectArr);
+
+    /**
+     * @description: 更新对象
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/21 17:09
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.OBJECT_UPDATE)
+    DmpResult updateObject(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONArray objectArr);
+
+    /**
+     * @description: 删除对象
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/21 17:09
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.OBJECT_DELETE)
+    DmpResult deleteObject(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody List<String> objectIdList);
+
+    /**
+     * @description: 创建关系
+     * @param: objectUrlParam
+     * @param: relationCriteriaList
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/22 16:37
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.RELATION_CREATE)
+    DmpResult createRelation(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody List<CreateRelation> createRelationList);
+
+    /**
+     * @description: 删除关系
+     * @param: objectUrlParam
+     * @param: relationCriteriaList
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/22 16:37
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.RELATION_DELETE)
+    DmpResult deleteRelation(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONObject criteria);
+
+    /**
+     * @description: 查询关系
+     * @param: objectUrlParam
+     * @param: relationCriteriaList
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/22 16:37
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.RELATION_QUERY)
+    DmpResult<JSONArray> queryRelation(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody QueryRelation criteria);
+
+    /**
+     * @description: 查询关系对象
+     * @param: objectUrlParam
+     * @param: relationCriteriaList
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/22 16:37
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.RELATION_OBJECT_QUERY)
+    DmpResult<JSONArray> queryRelationObject(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody QueryRelationObject criteria);
+
+    /**
+     * @description: 查询iot实时数据
+     * @param: iotUrlParam iot请求url通用参数
+     * @param: dataQueryDTOList post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/21 15:19
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.OBJECT_CURRENT_DATA)
+    DmpResult<JSONArray> queryIotCurrentData(@SpringQueryMap IOTUrlParam iotUrlParam, @RequestBody List<DataQueryDTO> dataQueryDTOList);
+
+    /**
+     * @description: 查询iot历史数据/分精度数据
+     * @param: iotUrlParam iot请求url通用参数
+     * @param: historyDataQuery post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/21 15:20
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.OBJECT_HISTORY_DATA)
+    DmpResult<JSONArray> queryIotHistoryData(@SpringQueryMap IOTUrlParam iotUrlParam, @RequestBody HistoryDataQuery historyDataQuery);
+
+    /**
+     * @description: 查询信息点定义
+     * @param: funcIdUrParam
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/28 15:51
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.DEF_FUNCID)
+    DmpResult<JSONArray> queryFuncId(@SpringQueryMap FuncIdUrParam funcIdUrParam, QueryFuncId queryFuncId);
+
+    /**
+     * @description: 查询类型定义
+     * @param: classUrParam
+     * @param: criteria
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/28 15:51
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.DEF_CLASS)
+    DmpResult<JSONArray> queryClass(@SpringQueryMap ClassUrParam classUrParam, JSONObject criteria);
+}

+ 28 - 0
src/main/java/com/persagy/dmp/client/RwdServerClientNew.java

@@ -0,0 +1,28 @@
+package com.persagy.dmp.client;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.url.InstanceUrlParam;
+import com.persagy.dmp.constant.RequestUrlConstant;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.SpringQueryMap;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+@FeignClient(name = "PERSAGY-ZKT-DMP", url = "${persagy.zkt.dmp.url:}")
+public interface RwdServerClientNew {
+    /**
+     * @description: 查询对象列表
+     * @param: objectUrlParam 对象请求url通用参数
+     * @param: criteria post请求参数
+     * @return: com.persagy.dmp.common.DmpResult
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/21 17:09
+     * @version: V1.0
+     */
+    @PostMapping(RequestUrlConstant.OBJECT_QUERY)
+    DmpResult<JSONArray> queryObject(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONObject criteria);
+
+}

+ 37 - 0
src/main/java/com/persagy/dmp/common/DmpResult.java

@@ -0,0 +1,37 @@
+package com.persagy.dmp.common;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 数据中台返回值通用类
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 15:40
+ * @version: V1.0
+ */
+@Data
+public class DmpResult<T> implements Serializable {
+
+    /**
+     * 成功
+     */
+    public final static String SUCCESS = "success";
+    /**
+     * 失败
+     */
+    public final static String FAILURE = "failure";
+    private static final long serialVersionUID = 1592352920203053150L;
+    private String result;
+
+    private T data;
+
+    private Integer count;
+
+    private String message;
+
+    //private Integer modifiedCount;
+
+    // private Integer deletedCount;
+}

+ 49 - 0
src/main/java/com/persagy/dmp/common/IntegratedResponseResult.java

@@ -0,0 +1,49 @@
+package com.persagy.dmp.common;
+
+import lombok.Builder;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author zhangqiankun
+ * @description
+ * @since 2020年8月26日:	下午5:17:08
+ */
+@Data
+@Builder
+public class IntegratedResponseResult<T> implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String respCode;            // 响应码
+
+    private String respMsg;                // 响应描述
+
+    private T content;            // 响应数据,实际可以是请求体,也可以是响应体,随意
+
+    private Long count;                // 响应数据总记录数
+
+    public IntegratedResponseResult() {
+
+    }
+
+    public IntegratedResponseResult(String respCode, String respMsg) {
+        this.respCode = respCode;
+        this.respMsg = respMsg;
+    }
+
+    public IntegratedResponseResult(String respCode, String respMsg, T content) {
+        this.respCode = respCode;
+        this.respMsg = respMsg;
+        this.content = content;
+    }
+
+    public IntegratedResponseResult(String respCode, String respMsg, T content, Long count) {
+        this.respCode = respCode;
+        this.respMsg = respMsg;
+        this.content = content;
+        this.count = count;
+    }
+
+
+}

+ 74 - 0
src/main/java/com/persagy/dmp/common/IntegratedResponseResultUtil.java

@@ -0,0 +1,74 @@
+package com.persagy.dmp.common;
+
+
+import com.persagy.dmp.constant.ResponseCode;
+
+/**
+ * @author zhangqiankun
+ * @description
+ * @company persagy
+ * @since 2020年9月1日:	下午2:21:25
+ */
+public class IntegratedResponseResultUtil {
+
+    public static IntegratedResponseResult successResult() {
+        IntegratedResponseResult result = new IntegratedResponseResult();
+        result.setRespCode(ResponseCode.A00000.getCode());
+        result.setRespMsg(ResponseCode.A00000.getDesc());
+        return result;
+    }
+
+    public static IntegratedResponseResult successResult(String respMsg) {
+        IntegratedResponseResult result = new IntegratedResponseResult();
+        result.setRespCode(ResponseCode.A00000.getCode());
+        result.setRespMsg(respMsg);
+        return result;
+    }
+
+    public static IntegratedResponseResult successResult(Object content) {
+        IntegratedResponseResult result = new IntegratedResponseResult();
+        result.setRespCode(ResponseCode.A00000.getCode());
+        result.setRespMsg(ResponseCode.A00000.getDesc());
+        result.setContent(content);
+        return result;
+    }
+
+    public static IntegratedResponseResult successResult(Object content, Long count) {
+        IntegratedResponseResult result = new IntegratedResponseResult();
+        result.setRespCode(ResponseCode.A00000.getCode());
+        result.setRespMsg(ResponseCode.A00000.getDesc());
+        result.setContent(content);
+        result.setCount(count);
+        return result;
+    }
+
+    public static IntegratedResponseResult errorResult() {
+        IntegratedResponseResult result = new IntegratedResponseResult();
+        result.setRespCode(ResponseCode.A10000.getCode());
+        result.setRespMsg(ResponseCode.A10000.getDesc());
+        return result;
+    }
+
+    public static IntegratedResponseResult errorResult(String respMsg) {
+        IntegratedResponseResult result = new IntegratedResponseResult();
+        result.setRespCode(ResponseCode.A10000.getCode());
+        result.setRespMsg(respMsg);
+        return result;
+    }
+
+    public static IntegratedResponseResult errorResult(String respCode, String respMsg) {
+        IntegratedResponseResult result = new IntegratedResponseResult();
+        result.setRespCode(respCode);
+        result.setRespMsg(respMsg);
+        return result;
+    }
+
+    public static IntegratedResponseResult errorResult(String respCode, String respMsg, Object content) {
+        IntegratedResponseResult result = new IntegratedResponseResult();
+        result.setRespCode(respCode);
+        result.setRespMsg(respMsg);
+        result.setContent(content);
+        return result;
+    }
+
+}

+ 60 - 0
src/main/java/com/persagy/dmp/common/PageResult.java

@@ -0,0 +1,60 @@
+package com.persagy.dmp.common;
+
+import cn.hutool.core.util.ObjectUtil;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * @description: 数据翻页通用类
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/10 19:39
+ * @version: V1.0
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class PageResult<T extends List> {
+
+    //对象数据
+    private T data;
+
+    //数量
+    private Integer count = 0;
+
+    public T getData(Class<T> clazz) {
+        if (data == null) {
+            T t = null;
+            try {
+                t = clazz.newInstance();
+            } catch (Exception ex) {
+                ex.printStackTrace();
+            }
+            return t;
+        }
+        return data;
+    }
+
+    public <T extends List> PageResult<T> addAll(PageResult<T> pageResult) {
+        if (this == null) {
+            return pageResult;
+        }
+        if (this.getData() == null) {
+            if (pageResult == null) {
+                return (PageResult<T>) this;
+            }
+            pageResult.count += this.count;
+            return pageResult;
+        }
+        if (pageResult != null) {
+            if (ObjectUtil.isNotEmpty(pageResult.getData())) {
+                this.getData().addAll(pageResult.getData());
+            }
+            this.count += pageResult.getCount();
+        }
+        return (PageResult<T>) this;
+    }
+}

+ 35 - 0
src/main/java/com/persagy/dmp/common/VideoResult.java

@@ -0,0 +1,35 @@
+package com.persagy.dmp.common;
+
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @author zhangqiankun
+ * @description
+ * @since 2020年8月26日:	下午5:17:08
+ */
+@Data
+@NoArgsConstructor
+public class VideoResult<T> implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 成功
+     */
+    public final static String SUCCESS = "success";
+    /**
+     * 失败
+     */
+    public final static String FAILURE = "failure";
+
+    private String result;
+
+    private String reason;
+
+    private T data;
+
+
+}

+ 46 - 0
src/main/java/com/persagy/dmp/common/url/AlarmUrlParam.java

@@ -0,0 +1,46 @@
+package com.persagy.dmp.common.url;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @description: 报警请求 url 通用参数
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 11:50
+ * @version: V1.0
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class AlarmUrlParam implements Serializable {
+
+    private static final long serialVersionUID = -1282154457331039058L;
+
+    /**
+     * 用户id
+     */
+    private String userId;
+
+    /**
+     * 集团编码
+     */
+    private String groupCode;
+
+    /**
+     * 项目Id
+     */
+    private String projectId;
+
+    /**
+     * 应用id
+     */
+    private String appId;
+}

+ 47 - 0
src/main/java/com/persagy/dmp/common/url/ClassUrParam.java

@@ -0,0 +1,47 @@
+package com.persagy.dmp.common.url;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @description: 类型定义请求url 通用参数
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 15:46
+ * @version: V1.0
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ClassUrParam {
+
+    /**
+     * 集团编码
+     */
+    private String groupCode;
+
+    /**
+     * 方案id
+     */
+    private String schemeId;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 应用id
+     */
+    private String appId;
+
+    /**
+     * 子分类标记,若为 true 则按子分类字段将类型拆解后返回,目前不支持指定类型进行子分类展开
+     */
+    private Boolean subFlag;
+}

+ 47 - 0
src/main/java/com/persagy/dmp/common/url/DicUrlParam.java

@@ -0,0 +1,47 @@
+package com.persagy.dmp.common.url;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @description: 字典请求 url 通用参数
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 11:50
+ * @version: V1.0
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class DicUrlParam implements Serializable {
+
+    private static final long serialVersionUID = -1261287670813226841L;
+
+    /**
+     * 用户id
+     */
+    @Builder.Default
+    private String userId = "system";
+
+    /**
+     * 集团编码
+     */
+    private String groupCode;
+
+    /**
+     * 项目Id
+     */
+    private String projectId;
+
+    /**
+     * 应用id
+     */
+    private String appId;
+}

+ 46 - 0
src/main/java/com/persagy/dmp/common/url/FuncIdUrParam.java

@@ -0,0 +1,46 @@
+package com.persagy.dmp.common.url;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @description: 信息点定义请求url 通用参数
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 15:46
+ * @version: V1.0
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class FuncIdUrParam implements Serializable {
+
+    private static final long serialVersionUID = 3492071662599927670L;
+
+    /**
+     * 集团编码
+     */
+    private String groupCode;
+
+    /**
+     * 方案id
+     */
+    private String schemeId;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 应用id
+     */
+    private String appId;
+}

+ 37 - 0
src/main/java/com/persagy/dmp/common/url/IOTUrlParam.java

@@ -0,0 +1,37 @@
+package com.persagy.dmp.common.url;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @description: iot 请求url通用参数
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/21 16:28
+ * @version: V1.0
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class IOTUrlParam {
+
+    /**
+     * 集团编码
+     */
+    String groupCode;
+
+    /**
+     * 项目 id, 不可为空
+     */
+    String projectId;
+
+    /**
+     * 应用id
+     */
+    String appId;
+}

+ 46 - 0
src/main/java/com/persagy/dmp/common/url/InstanceUrlParam.java

@@ -0,0 +1,46 @@
+package com.persagy.dmp.common.url;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @description: 对象、关系请求url通用参数
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/21 16:28
+ * @version: V1.0
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class InstanceUrlParam implements Serializable {
+
+    private static final long serialVersionUID = -994117732505752231L;
+
+    /**
+     * 集团编码
+     */
+    private String groupCode;
+
+    /**
+     * 方案id
+     */
+    private String schemeId;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 应用id
+     */
+    private String appId;
+}

+ 36 - 0
src/main/java/com/persagy/dmp/config/AlarmJsonResult.java

@@ -0,0 +1,36 @@
+package com.persagy.dmp.config;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: shiliqiang
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/19 21:06
+ * @version: V1.0
+ */
+@Data
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class AlarmJsonResult implements Serializable {
+
+    //成功
+    public final static String SUCCESS = "success";
+    //失败
+    public final static String FAILURE = "failure";
+    private static final long serialVersionUID = 1592352920203053150L;
+    private String result;
+
+    private JSONObject data;
+
+    private Integer count;
+
+    private String message;
+
+    private Integer modifiedCount;
+
+    private Integer deletedCount;
+}

+ 72 - 0
src/main/java/com/persagy/dmp/config/CacheConfiguration.java

@@ -0,0 +1,72 @@
+package com.persagy.dmp.config;
+
+
+import com.github.benmanes.caffeine.cache.Caffeine;
+import com.github.benmanes.caffeine.cache.Ticker;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.caffeine.CaffeineCache;
+import org.springframework.cache.support.SimpleCacheManager;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+/**
+ * @description: 开启缓存
+ * @author:LuoGuangyi
+ * @company:PersagyTechnologyCo.,Ltd
+ * @since:2020/12/03 17:41
+ * @version:V1.0
+ **/
+@EnableCaching
+@Configuration
+@ConfigurationProperties(prefix = "caching")
+@Data
+@Slf4j
+public class CacheConfiguration {
+
+    private Map<String, CacheSpec> specs;
+
+    @Bean
+    public CacheManager cacheManager(Ticker ticker) {
+        SimpleCacheManager manager = new SimpleCacheManager();
+        if (specs != null) {
+            List<CaffeineCache> caches =
+                    specs.entrySet().stream()
+                            .map(entry -> buildCache(entry.getKey(),
+                                    entry.getValue(),
+                                    ticker))
+                            .collect(Collectors.toList());
+            manager.setCaches(caches);
+        }
+        return manager;
+    }
+
+    private CaffeineCache buildCache(String name, CacheSpec cacheSpec, Ticker ticker) {
+        log.info("Cache {} specified timeout of {} min, max of {}", name, cacheSpec.getTimeout(), cacheSpec.getMax());
+        final Caffeine<Object, Object> caffeineBuilder
+                = Caffeine.newBuilder()
+                .expireAfterWrite(cacheSpec.getTimeout(), TimeUnit.SECONDS)
+                .maximumSize(cacheSpec.getMax())
+                .ticker(ticker);
+        return new CaffeineCache(name, caffeineBuilder.build());
+    }
+
+    @Bean
+    public Ticker ticker() {
+        return Ticker.systemTicker();
+    }
+
+    @Data
+    public static class CacheSpec {
+        private Integer timeout = 100;
+        private Integer max = 200;
+    }
+}

+ 71 - 0
src/main/java/com/persagy/dmp/config/CrossOriginFilter.java

@@ -0,0 +1,71 @@
+package com.persagy.dmp.config;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.annotation.Order;
+import org.springframework.http.HttpHeaders;
+
+/**
+ * @description: 允许跨域 Filter
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2021/4/22 16:03
+ * @version: V1.0
+ **/
+@Order(1)
+@WebFilter
+public class CrossOriginFilter implements Filter {
+    /**
+     * true 常量
+     */
+    public static final String CONST_STRING_TRUE = "true";
+    
+	@Value("${exclude.cross.origin:false}")
+	private boolean excludeCrossOrigin;
+
+    @Override
+    public void init(FilterConfig filterConfig) {
+
+    }
+
+    @Override
+    public void destroy() {
+
+    }
+
+    public void process(HttpServletRequest request, HttpServletResponse response) {
+        String value = request.getHeader(HttpHeaders.ORIGIN);
+        if (!excludeCrossOrigin) {
+        	response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, (StringUtils.isBlank(value) || "null".equalsIgnoreCase(value)) ? "*" : value);
+		}
+        response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, CONST_STRING_TRUE);
+        value = request.getHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS);
+        if (StringUtils.isNotBlank(value)) {
+            response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, value);
+        }else {
+            response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, "*" );
+        }
+        response.setHeader(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "3600" );
+        value = request.getHeader(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD);
+        response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, (StringUtils.isBlank(value) || "null".equalsIgnoreCase(value)) ? "GET,POST,OPTIONS,PUT,DELETE" : value);
+    }
+
+    @Override
+    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
+        HttpServletRequest request = (HttpServletRequest) req;
+        process(request, (HttpServletResponse) resp);
+        chain.doFilter(req, resp);
+    }
+}

+ 32 - 0
src/main/java/com/persagy/dmp/config/DmpProperties.java

@@ -0,0 +1,32 @@
+package com.persagy.dmp.config;
+
+import feign.Logger;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * @description: 配置
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/9/21 17:43
+ * @version: V1.0
+ **/
+@ConfigurationProperties("persagy.dmp")
+public class DmpProperties implements InitializingBean {
+
+    //feign日志级别
+    private Logger.Level feignLoggerLevel = Logger.Level.NONE;
+
+    public Logger.Level getFeignLoggerLevel() {
+        return feignLoggerLevel;
+    }
+
+    public void setFeignLoggerLevel(Logger.Level feignLoggerLevel) {
+        this.feignLoggerLevel = feignLoggerLevel;
+    }
+
+    @Override
+    public void afterPropertiesSet() throws Exception {
+
+    }
+}

+ 177 - 0
src/main/java/com/persagy/dmp/config/DmpRwdReceiver.java

@@ -0,0 +1,177 @@
+//package com.persagy.dmp.config;
+//
+//import com.alibaba.fastjson.JSONObject;
+//import com.persagy.dmp.constant.RabbitMQConstant;
+//import com.persagy.dmp.enumeration.EnumRwdMQType;
+//import com.rabbitmq.client.Channel;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.amqp.rabbit.annotation.RabbitListener;
+//import org.springframework.amqp.support.AmqpHeaders;
+//import org.springframework.messaging.handler.annotation.Headers;
+//import org.springframework.stereotype.Component;
+//
+//import java.util.Map;
+//
+//
+///**
+// * @description: 中台物理世界消息
+// * @author: xingmaojun
+// * @company: Persagy Technology Co.,Ltd
+// * @since: 2021/1/4 16:11
+// * @version: V1.0
+// **/
+//@Component
+//public class DmpRwdReceiver {
+//
+//    private static final Logger log = LoggerFactory.getLogger(DmpRwdReceiver.class);
+//
+//    //@RabbitListener(queues = RabbitMQConstant.QUEUE_DMP_RWD)
+//    public void rwdMes(String jsonStr, Channel channel, @Headers Map<String, Object> headers) {
+//        log.info("接收到数据平台消息:" + jsonStr);
+//        try {
+//            Long deliveryTag = (Long) headers.get(AmqpHeaders.DELIVERY_TAG);
+//            channel.basicAck(deliveryTag, false);
+//            String type = JSONObject.parseObject(jsonStr).getString("type");
+//            switch (Enum.valueOf(EnumRwdMQType.class, type)) {
+//                case instanceObjectCreate:
+//                    log.info("创建对象", jsonStr);
+//                    break;
+//                case instanceObjectUpdate:
+//                    log.info("更新对象", jsonStr);
+//                    break;
+//                case instanceObjectDelete:
+//                    log.info("删除对象", jsonStr);
+//                    break;
+//                case instanceRelationCreate:
+//                    log.info("创建关系", jsonStr);
+//                    break;
+//                case instanceRelationDelete:
+//                    log.info("删除关系", jsonStr);
+//                    break;
+//                default:
+//                    break;
+//            }
+//        } catch (Exception e1) {
+//            log.error("dataPlatformMes Exception", e1);
+//        }
+//    }
+//
+//
+////    消息体内值为空的字段不返回
+////
+////    exchange: exchange-dmp
+////    对象创建:
+////    routingKey: routing-dmp-rwd
+////
+////    body:
+////    {
+////        "mid": "uuid",
+////            "groupCode": "集团编码",
+////            "projectId": "项目ID",
+////            "type": "instanceObjectCreate",
+////            "targetId": "物理世界对象ID",
+////            "int1": null,
+////            "int2": null,
+////            "str1": "对象objType",
+////            "str2": "对象classCode",
+////            "appId": "创建对象的appid,可能为空",
+////            "userId": "创建对象的userId,可能为空",
+////            "sendTime": "广播发送时间",
+////            "expireTime": "广播消息过期时间,一般为空",
+////            "exts": {}
+////    }
+////
+////    对象更新:
+////    routingKey: routing-dmp-rwd
+////    body:
+////    {
+////        "mid": "uuid",
+////            "groupCode": "集团编码",
+////            "projectId": "项目ID",
+////            "type": "instanceObjectUpdate",
+////            "targetId": "物理世界对象ID",
+////            "int1": null,
+////            "int2": null,
+////            "str1": "对象objType",
+////            "str2": "对象classCode",
+////            "appId": "更新对象的appid,可能为空",
+////            "userId": "更新对象的userId,可能为空",
+////            "sendTime": "广播发送时间",
+////            "expireTime": "广播消息过期时间,一般为空",
+////            "exts": {}
+////    }
+////
+////    对象删除:
+////    routingKey: routing-dmp-rwd
+////    body:
+////    {
+////        "mid": "uuid",
+////            "groupCode": "集团编码",
+////            "projectId": "项目ID",
+////            "type": "instanceObjectDelete",
+////            "targetId": "物理世界对象ID",
+////            "int1": null,
+////            "int2": null,
+////            "str1": "对象objType",
+////            "str2": "对象classCode",
+////            "appId": "删除对象的appid,可能为空",
+////            "userId": "删除对象的userId,可能为空",
+////            "sendTime": "广播发送时间",
+////            "expireTime": "广播消息过期时间,一般为空",
+////            "exts": {}
+////    }
+////
+////    关系创建:
+////    routingKey: routing-dmp-rwd
+////    body:
+////    {
+////        "mid": "uuid",
+////            "groupCode": "集团编码",
+////            "projectId": "项目ID",
+////            "type": "instanceRelationCreate",
+////            "targetId": null,
+////            "int1": null,
+////            "int2": null,
+////            "str1": null,
+////            "str2": null,
+////            "appId": "创建关系的appid,可能为空",
+////            "userId": "创建关系的userId,可能为空",
+////            "sendTime": "广播发送时间",
+////            "expireTime": "广播消息过期时间,一般为空",
+////            "exts": {
+////        "graphId": "",
+////                "graphCode": "",
+////                "relCode": "",
+////                "objFrom": "",
+////                "objTo": ""
+////    }
+////    }
+////
+////    关系删除:
+////    routingKey: routing-dmp-rwd
+////    body:
+////    {
+////        "mid": "uuid",
+////            "groupCode": "集团编码",
+////            "projectId": "项目ID",
+////            "type": "instanceRelationCreate",
+////            "targetId": null,
+////            "int1": null,
+////            "int2": null,
+////            "str1": null,
+////            "str2": null,
+////            "appId": "删除关系的appid,可能为空",
+////            "userId": "删除关系的userId,可能为空",
+////            "sendTime": "广播发送时间",
+////            "expireTime": "广播消息过期时间,一般为空",
+////            "exts": {
+////        "graphId": "",
+////                "graphCode": "",
+////                "relCode": "",
+////                "objFrom": "",
+////                "objTo": ""
+////    }
+////    }
+//
+//}

+ 35 - 0
src/main/java/com/persagy/dmp/config/FeignInterceptorConfig.java

@@ -0,0 +1,35 @@
+package com.persagy.dmp.config;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import cn.hutool.core.util.StrUtil;
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+
+/**
+ * feign拦截器,只包含基础数据
+ *
+ * @description
+ * @author persagy
+ * @since 2020年11月4日: 下午8:09:02
+ */
+public class FeignInterceptorConfig implements RequestInterceptor{
+
+	@Override
+	public void apply(RequestTemplate template) {
+		// 传递通用header
+		ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+		HttpServletRequest request = attributes == null ? null : attributes.getRequest();
+		if (request != null) {
+			// 这里的 header key 全为小写
+			String authorization = request.getHeader("authorization");
+			if (StrUtil.isNotBlank(authorization)) {
+				template.header("authorization", authorization);
+			}
+		}
+	}
+
+}

+ 62 - 0
src/main/java/com/persagy/dmp/config/FeignLogger.java

@@ -0,0 +1,62 @@
+package com.persagy.dmp.config;
+
+
+import feign.Request;
+import feign.Response;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+/**
+ * @description: 重写feign日志等级(debug改为info)
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/27 9:38
+ * @version: V1.0
+ **/
+public class FeignLogger extends feign.Logger {
+
+
+    private final Logger logger;
+
+    public FeignLogger() {
+        this(feign.Logger.class);
+    }
+
+    public FeignLogger(Class<?> clazz) {
+        this(LoggerFactory.getLogger(clazz));
+    }
+
+    public FeignLogger(String name) {
+        this(LoggerFactory.getLogger(name));
+    }
+
+    FeignLogger(Logger logger) {
+        this.logger = logger;
+    }
+
+
+    @Override
+    protected void logRequest(String configKey, Level logLevel, Request request) {
+        if (logger.isInfoEnabled()) {
+            super.logRequest(configKey, logLevel, request);
+        }
+    }
+
+    @Override
+    protected Response logAndRebufferResponse(String configKey, Level logLevel, Response response, long elapsedTime)
+            throws IOException {
+        if (logger.isInfoEnabled()) {
+            return super.logAndRebufferResponse(configKey, logLevel, response, elapsedTime);
+        }
+        return response;
+    }
+
+    @Override
+    protected void log(String configKey, String format, Object... args) {
+        if (logger.isInfoEnabled()) {
+            logger.info(String.format(methodTag(configKey) + format, args));
+        }
+    }
+}

+ 55 - 0
src/main/java/com/persagy/dmp/config/HttpFilterConfig.java

@@ -0,0 +1,55 @@
+//package com.persagy.dmp.config;
+//
+//import org.springframework.boot.web.servlet.FilterRegistrationBean;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import javax.servlet.*;
+//import javax.servlet.http.HttpServletResponse;
+//import java.io.IOException;
+//
+///**
+// * @Description 使用配置方式开发Filter,否则其中的自动注入无效
+// * @ClassName HttpFilterConfig.java
+// * @author LuoGuangyi
+// * @version 1.0.0
+// * @createTime  2021/04/22 17:09
+// * @Since
+// */
+//@Configuration
+//public class HttpFilterConfig {
+//
+//    /**
+//     * @Description 注册自定义跨域过滤器
+//     * @ClassName HttpFilterConfig.java
+//     * @author LuoGuangyi
+//     * @version 1.0.0
+//     * @createTime  2021/04/22 17:09
+//     * @Since
+//     */
+//    @Bean
+//    public FilterRegistrationBean registerFilter() {
+//        FilterRegistrationBean bean = new FilterRegistrationBean();
+//        bean.addUrlPatterns("/*");
+//        bean.setFilter(new CrosFilter());
+//        return bean;
+//    }
+//
+//    /**
+//     * @Description 跨域过滤器
+//     * @ClassName HttpFilterConfig.java
+//     * @author LuoGuangyi
+//     * @version 1.0.0
+//     * @createTime  2021/04/22 17:10
+//     * @Since
+//     */
+//    class CrosFilter implements Filter {
+//        @Override
+//        public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+//            HttpServletResponse res = (HttpServletResponse) response;
+//            //*号表示对所有请求都允许跨域访问
+//            res.addHeader("Access-Control-Allow-Origin", "*");
+//            res.addHeader("Access-Control-Allow-Methods", "*");
+//            chain.doFilter(request, response);
+//        }
+//    }
+//}

+ 36 - 0
src/main/java/com/persagy/dmp/config/RabbitMQConfig.java

@@ -0,0 +1,36 @@
+//package com.persagy.dmp.config;
+//
+//
+//import com.persagy.dmp.constant.RabbitMQConstant;
+//import org.springframework.amqp.core.Binding;
+//import org.springframework.amqp.core.BindingBuilder;
+//import org.springframework.amqp.core.Queue;
+//import org.springframework.amqp.core.TopicExchange;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//
+///**
+// * @description: RabbitMQ配置
+// * @author: xingmaojun
+// * @company: Persagy Technology Co.,Ltd
+// * @since: 2021/1/4 16:11
+// * @version: V1.0
+// **/
+//@Configuration
+//public class RabbitMQConfig {
+//
+//    /**
+//     * @description: 中台物理世界队列绑定
+//     * @return: org.springframework.amqp.core.Binding
+//     * @author: xingmaojun
+//     * @company: Persagy Technology Co.,Ltd
+//     * @since: 2021/1/4 16:28
+//     * @version: V1.0
+//     */
+//    @Bean
+//    public Binding DmpRwdBind() {
+//        return BindingBuilder.bind(new Queue(RabbitMQConstant.QUEUE_DMP_RWD))
+//                .to(new TopicExchange(RabbitMQConstant.EXCHANGE_DMP))
+//                .with(RabbitMQConstant.ROUTING_DMP_RWD);
+//    }
+//}

+ 166 - 0
src/main/java/com/persagy/dmp/config/WebConfig.java

@@ -0,0 +1,166 @@
+package com.persagy.dmp.config;
+
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.factory.ObjectFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
+import org.springframework.cloud.openfeign.support.ResponseEntityDecoder;
+import org.springframework.cloud.openfeign.support.SpringDecoder;
+import org.springframework.cloud.openfeign.support.SpringEncoder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.BufferedImageHttpMessageConverter;
+import org.springframework.http.converter.ByteArrayHttpMessageConverter;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.ResourceHttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter;
+import org.springframework.http.converter.xml.SourceHttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.PropertyNamingStrategy;
+import com.alibaba.fastjson.serializer.SerializeConfig;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.alibaba.fastjson.support.config.FastJsonConfig;
+import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
+import com.persagy.dmp.auth.AuthenticationInterceptor;
+
+@Configuration
+public class WebConfig extends WebMvcConfigurationSupport {
+
+	@Autowired
+	private AuthenticationInterceptor authenticationInterceptor;
+	
+	/**
+     * token拦截器,
+     * 不是bean,无法通过 @Conditional相关方法来控制
+     * 而且一个项目只能有一个WebMvcConfigurationSupport
+     *
+     * @param registry
+     */
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(authenticationInterceptor)
+                .addPathPatterns("/**")
+                .excludePathPatterns("/swagger-resources/**", "/error", "/webjars/**", "/v2/**", "/swagger-ui.html/**", "/doc.html");
+    }
+
+	/*
+	 * @Bean public AuthenticationInterceptor authenticationInterceptor() { return
+	 * new AuthenticationInterceptor(); }
+	 */
+
+    /**
+     * 修改自定义消息转换器
+     *
+     * @param converters
+     */
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+
+        // 修改全局的全局日期格式 默认为yyyy-MM-dd HH:mm:ss
+        JSON.DEFFAULT_DATE_FORMAT = "yyyyMMddHHmmss";
+        //---处理字符串, 避免直接返回字符串的时候被添加了引号,处理中文乱码问题
+        StringHttpMessageConverter smc = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        converters.add(smc);
+        converters.add(createFastJsonConverter());
+        converters.add(new ByteArrayHttpMessageConverter());
+        converters.add(new BufferedImageHttpMessageConverter());
+        converters.add(new ResourceHttpMessageConverter());
+        converters.add(new SourceHttpMessageConverter());
+        converters.add(new Jaxb2RootElementHttpMessageConverter());
+    }
+
+    /**
+     * @description: 放行swagger 静态资源文件,否则swagger页面打不开,报404错误
+     * WebMvcConfigurationSupport导致自动配置失效, 因为WebMvc的自动配置都在WebMvcAutoConfiguration类中
+     * 参考:https://blog.csdn.net/universsky2015/article/details/108064340
+     * @param: registry
+     * @return: void
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/27 20:16
+     * @version: V1.0
+     */
+    @Override
+    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/");
+        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
+        super.addResourceHandlers(registry);
+    }
+
+    @Bean
+    public ResponseEntityDecoder feignDecoder() {
+        HttpMessageConverter fastJsonConverter = createFastJsonConverter();
+        ObjectFactory<HttpMessageConverters> objectFactory = () -> new HttpMessageConverters(fastJsonConverter);
+        return new ResponseEntityDecoder(new SpringDecoder(objectFactory));
+    }
+
+    @Bean
+    public SpringEncoder feignEncoder() {
+        HttpMessageConverter fastJsonConverter = createFastJsonConverter();
+        ObjectFactory<HttpMessageConverters> objectFactory = () -> new HttpMessageConverters(fastJsonConverter);
+        return new SpringEncoder(objectFactory);
+    }
+
+    /**
+     * Description: 添加支持的类型
+     *
+     * @return List<MediaType>
+     * @author luoguangyi
+     * @since 2019年9月3日: 下午6:20:33 Update By luoguangyi 2019年9月3日: 下午6:20:33
+     */
+    private HttpMessageConverter createFastJsonConverter() {
+        //===========替换框架json为fastjson
+        FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
+        List<MediaType> supportedMediaTypes = new ArrayList<>();
+        supportedMediaTypes.add(MediaType.APPLICATION_JSON);
+        supportedMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
+        supportedMediaTypes.add(MediaType.APPLICATION_ATOM_XML);
+        supportedMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED);
+        supportedMediaTypes.add(MediaType.APPLICATION_OCTET_STREAM);
+        supportedMediaTypes.add(MediaType.APPLICATION_PDF);
+        supportedMediaTypes.add(MediaType.APPLICATION_RSS_XML);
+        supportedMediaTypes.add(MediaType.APPLICATION_XHTML_XML);
+        supportedMediaTypes.add(MediaType.APPLICATION_XML);
+        supportedMediaTypes.add(MediaType.IMAGE_GIF);
+        supportedMediaTypes.add(MediaType.IMAGE_JPEG);
+        supportedMediaTypes.add(MediaType.IMAGE_PNG);
+        supportedMediaTypes.add(MediaType.TEXT_EVENT_STREAM);
+        supportedMediaTypes.add(MediaType.TEXT_HTML);
+        supportedMediaTypes.add(MediaType.TEXT_MARKDOWN);
+        supportedMediaTypes.add(MediaType.TEXT_PLAIN);
+        supportedMediaTypes.add(MediaType.TEXT_XML);
+        fastConverter.setSupportedMediaTypes(supportedMediaTypes);
+
+        //创建配置类
+        FastJsonConfig fastJsonConfig = new FastJsonConfig();
+        //---下划线转驼峰
+        SerializeConfig serializeConfig = new SerializeConfig();
+        serializeConfig.propertyNamingStrategy = PropertyNamingStrategy.CamelCase;
+        fastJsonConfig.setSerializeConfig(serializeConfig);
+        //---序列化格式
+        fastJsonConfig.setSerializerFeatures(
+                SerializerFeature.PrettyFormat,
+                SerializerFeature.WriteDateUseDateFormat,
+                // List字段如果为null,输出为[],而非null
+                // SerializerFeature.WriteNullListAsEmpty,
+                // 是否显示为null的字段,加上会显示,取消就不会显示为空的字段
+                // SerializerFeature.WriteMapNullValue,
+                // 禁止循环引用
+                SerializerFeature.DisableCircularReferenceDetect
+                // SerializerFeature.WriteNullStringAsEmpty
+        );
+        fastJsonConfig.setDateFormat("yyyyMMddHHmmss");
+        fastConverter.setFastJsonConfig(fastJsonConfig);
+
+        return fastConverter;
+    }
+}

+ 80 - 0
src/main/java/com/persagy/dmp/constant/CommonConstant.java

@@ -0,0 +1,80 @@
+package com.persagy.dmp.constant;
+
+/**
+ * @author xingmaojun
+ * @version V1.0
+ * @ClassName CommonConstant
+ * @Description: 常量
+ * @date 2019/9/5 10:07
+ **/
+public class CommonConstant {
+
+    //时间格式-显示
+    public final static String date_format_show = "yyyy-MM-dd HH:mm:ss";
+    //时间格式-存储
+    public final static String date_format_save = "yyyyMMddHHmmss";
+    // 日期格式-
+    public final static String date_format_day_ = "yyyy-MM-dd";
+
+    //模板目录
+    public final static String template_dir = "template";
+    //导出文件目录
+    public final static String template_data_dir = "template_data";
+
+    //模板中表格锁定的密码
+    public static final String SHEET_LOCK_PASSWORD = "locked123";
+
+    //标识-项目
+    public final static String tag_project = "Pj";
+
+    //标识-系统
+    public final static String SYSTEM_ID = "systemId";
+    //标识-系统名称
+    public final static String SYSTEM_NAME = "系统";
+
+    /*
+     * 系统类
+     */
+    public static final String SYSTEM = "system";
+    /*
+     * 设备类
+     */
+    public static final String EQUIPMENT = "equipment";
+
+    /*
+     * 查询专业信息的常量
+     */
+    public static final String MAJOR = "major";
+
+    /*
+     * 专业编码
+     */
+    public static final String MAJOR_CODE = "majorCode";
+
+    /*
+     * 父编码
+     */
+    public static final String PARENT_CODE = "parentCode";
+
+    /*
+     * 父编码
+     */
+    public static final String GENERAL_DICTIONARY_PARENT_CODE = "/";
+
+    /*
+     * 系统编码
+     */
+    public static final String SYSTEM_CODE = "systemCode";
+
+    /**
+     * 排序
+     */
+    public static class Order {
+        //升序
+        public static final String ASC = "asc";
+        //降序
+        public static final String DESC = "desc";
+    }
+
+
+}

+ 113 - 0
src/main/java/com/persagy/dmp/constant/DmpConstant.java

@@ -0,0 +1,113 @@
+package com.persagy.dmp.constant;
+
+import com.alibaba.fastjson.JSONObject;
+
+import cn.hutool.core.util.StrUtil;
+
+/**
+ * @description: 数据中台接口常量
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 15:40
+ * @version: V1.0
+ */
+public class DmpConstant {
+
+    /** ibms显示名称,替换localName */
+	public static final String IBMS_XIANSHI_MINCGHENG = "ibmsxianshimingcheng";
+
+    /** ibms显示名称,替换localId */
+	public static final String IBMS_XIANSHI_BIANMA = "ibmsxianshibianma";
+    
+	/** 慧云本地编码 */
+	public static final String WD_HUIYUNBENDIBIANMA = "wD_huiyunbendibianma";
+	
+	/** 设备名称(工程设备名称),慧云本地名称 */
+	public static final String WD_HUIYUNBENDIMINGCHENG = "wD_huiyunbendimingcheng";
+	
+    /** 本地编码 */
+	public static final String LOCAL_ID = "localId";
+    
+    /** 本地名称 */
+	public static final String LOCAL_NAME = "localName";
+	
+    public static class ObjectQuery {
+        public static final String CRITERIAS = "criterias";
+        public static final String CRITERIA = "criteria";
+        public static final String WITH_COLUMNS = "withColumns";
+        public static final String ORDERS = "orders";
+        public static final String COLUMN = "column";
+        public static final String RELATION_FROM = "relationFrom";
+        public static final String RELATION_TO = "relationTo";
+    }
+
+    public static class ObjectBaseInfoCode {
+        public static final String ID = "id";
+        public static final String NAME = "name";
+        public static final String LOCAL_ID = "localId";
+        public static final String LOCAL_NAME = "localName";
+        public static final String CLASS_CODE = "classCode";
+        public static final String GROUPING = "grouping";
+        public static final String VALID = "valid";
+
+        public static final String IBMS_SCENE_CODE = "ibmsSceneCode";
+        public static final String IBMS_CLASS_CODE = "ibmsClassCode";
+    }
+
+    public static class ObjectType {
+        public static final String PROJECT = "project";
+        public static final String BUILDING = "building";
+        public static final String FLOOR = "floor";
+        public static final String SPACE = "space";
+        public static final String SHAFT = "shaft";
+        public static final String EQUIPMENT = "equipment";
+        public static final String SYSTEM = "system";
+    }
+
+    public static class RelationType {
+        public static final String ARCH_SUBSET_PROJECT_BUILDING = "Pj2Bd";
+        public static final String ARCH_SUBSET_BUILDING_FLOOR = "Bd2Fl";
+        public static final String ARCH_SUBSET_BUILDING_SPACE = "Bd2Sp";
+        public static final String ARCH_SUBSET_FLOOR_SPACE = "Fl2Sp";
+
+        //机电类服务区域关系, 设备设施服务于业务空间
+        public static final String MECH_FOR_ARCH_EQUIP_SPACE = "Eq2Sp";
+        public static final String MECH_FOR_ARCH_EQUIP_FLOOR = "Eq2Fl";
+
+    }
+    
+    public static String getIbmsxianshimingcheng(JSONObject jsonObject) {
+    	String ibmsxianshimingcheng = null;
+    	if (jsonObject == null) {
+    		return ibmsxianshimingcheng;
+		}
+    	String groupCode = jsonObject.getString("groupCode");
+    	if ("WD".equals(groupCode)) {
+    		ibmsxianshimingcheng = jsonObject.getString(WD_HUIYUNBENDIMINGCHENG);
+		} else {
+			ibmsxianshimingcheng = jsonObject.getString(IBMS_XIANSHI_MINCGHENG);
+		}
+        if (StrUtil.isBlank(ibmsxianshimingcheng)) {
+            ibmsxianshimingcheng = jsonObject.getString(LOCAL_NAME);
+        }
+        return ibmsxianshimingcheng;
+    }
+    
+    public static String getIbmsxianshibianma(JSONObject jsonObject) {
+    	String ibmsxianshibianma = null;
+    	if (jsonObject == null) {
+    		return ibmsxianshibianma;
+		}
+    	String groupCode = jsonObject.getString("groupCode");
+    	if ("WD".equals(groupCode)) {
+    		ibmsxianshibianma = jsonObject.getString(WD_HUIYUNBENDIBIANMA);
+		} else {
+			ibmsxianshibianma = jsonObject.getString(IBMS_XIANSHI_BIANMA);
+		}
+        if (StrUtil.isBlank(ibmsxianshibianma)) {
+        	ibmsxianshibianma = jsonObject.getString(LOCAL_ID);
+        }
+        return ibmsxianshibianma;
+    }
+    
+}

+ 40 - 0
src/main/java/com/persagy/dmp/constant/GeneralDictionaryConstant.java

@@ -0,0 +1,40 @@
+package com.persagy.dmp.constant;
+
+/**
+ * @author LuoGuangyi
+ * @version 1.0.0
+ * @Description 字典服务-字典服务常量
+ * @ClassName GeneralDictionaryConstant.java
+ * @createTime 2021/02/04 17:24
+ * @Since
+ */
+public class GeneralDictionaryConstant {
+
+    /**
+     * 中控字典-交接班字段(表头)
+     */
+    public final static String HANDOVER_SHIFT_FIELDS = "handoverShiftFields";
+    /**
+     * 中控字典-操作日志字段(表头)
+     */
+    public final static String OPERATION_LOG_FIELDS = "operationLogFields";
+    /**
+     *  报警系统隔离
+     */
+    public final static String ALARM_SYSTEM_ISOLATIONS = "alarmSystemIsolations";
+    /**
+     * 班次
+     */
+    public final static String SHIFT_TYPE = "shiftType";
+
+    /**
+     * 视频墙布局
+     */
+    public final static String VIDEO_WALL_LAYOUT = "videoWallLayout";
+
+    /**
+     * 逻辑编组
+     */
+    public final static String LOGICALG_ROUPING = "logicalGrouping";
+}
+

+ 45 - 0
src/main/java/com/persagy/dmp/constant/LogConstant.java

@@ -0,0 +1,45 @@
+package com.persagy.dmp.constant;
+
+/**
+ * @description: 日志常量
+ * @author:LuoGuangyi
+ * @company:PersagyTechnologyCo.,Ltd
+ * @since:2020/12/04 20:28
+ * @version:V1.0
+ **/
+public class LogConstant {
+    //标识-业务日志数据字典类型
+    public final static String FUNCTION_LOG = "functionLog";
+    //模式管理
+    public final static String LOG_MODEL_MANAGEMENT = "modelManagement";
+    //模式管理
+    public final static String LOG_USER_MANAGEMENT = "userManagement";
+    //登入登出
+    public final static String LOG_LOGIN_LOGOUT = "loginLogout";
+    //远程控制
+    public final static String LOG_REMOTE_CONTROL = "remoteControl";
+    //交接班
+    public final static String HANDOVER_SHIFT = "handoverShift";
+    //报警
+    public final static String ALARM_DEAL_WITH = "alarmDealWith";
+    //系统日历
+    public final static String LOG_CALENDAR = "calendar";
+    //报表管理
+    public final static String LOG_REPORT_MANAGEMENT="reportFormsManagement";
+    //运行日志
+    public final static String LOG_RUNNING_LOG="runningLog";
+
+
+    public static class SourceType {
+        /**
+         * 用户操作
+         */
+        public final static int user = 1;
+        /**
+         * 系统运行
+         */
+        public final static int auto = 2;
+
+    }
+
+}

+ 17 - 0
src/main/java/com/persagy/dmp/constant/RabbitMQConstant.java

@@ -0,0 +1,17 @@
+package com.persagy.dmp.constant;
+
+/**
+ * @description: RabbitMQ 常量
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2021/1/4 16:11
+ * @version: V1.0
+ **/
+public class RabbitMQConstant {
+
+    public final static String EXCHANGE_DMP = "exchange-dmp";
+
+    public final static String ROUTING_DMP_RWD = "routing-dmp-rwd";
+
+    public final static String QUEUE_DMP_RWD = "zkt-queue-dmp-rwd";
+}

+ 100 - 0
src/main/java/com/persagy/dmp/constant/RedisConstant.java

@@ -0,0 +1,100 @@
+package com.persagy.dmp.constant;
+
+/**
+ * @description: redis 常量
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/12/23 15:16
+ * @version: V1.0
+ **/
+public class RedisConstant {
+
+    /**
+     * 设备位置缓存
+     */
+    public final static String EQUIP_LOCATION_PREFIX = "EQUIP_LOCATION";
+
+    /**
+     * 设备所属模块、所属配电箱
+     */
+    public final static String EQUIP_MODULAR_BOX_PREFIX = "EQUIP_MODULAR_BOX_V2";
+
+    /**
+     * 空间位置缓存
+     */
+    public final static String SPACE_LOCATION_PREFIX = "SPACE_LOCATION";
+
+    /**
+     * 系统位置缓存
+     */
+    public final static String SYSTEM_LOCATION_PREFIX = "SYSTEM_LOCATION";
+
+    /**
+     * 数据字典缓存
+     */
+    public final static String DATA_DICT_PREFIX = "DATA_DICT";
+
+    /*
+     * 对象缓存
+     */
+    public final static String OBJECT_PREFIX = "OBJECT";
+
+    /*
+     * 建筑下设备
+     */
+    public final static String EQUIP_IN_BUILD_PREFIX = "EQUIP_IN_BUILD";
+
+    /*
+     * 空间下设备
+     */
+    public final static String EQUIP_IN_SPACE_PREFIX = "EQUIP_IN_SPACE";
+
+    /*
+     * 楼层下设备
+     */
+    public final static String EQUIP_IN_FLOOR_PREFIX = "EQUIP_IN_FLOOR";
+
+    /*
+     *对象类型
+     */
+    public final static String CLASS_CODE_REL_PREFIX = "CLASS_CODE_REL";
+
+    /*
+     *关系
+     */
+    public final static String RELATION_PREFIX = "RELATION";
+
+    /*
+     *关系
+     */
+    public final static String RELATION_FROM_PREFIX = "RELATION_FROM";
+
+    /*
+     *关系
+     */
+    public final static String RELATION_TO_PREFIX = "RELATION_TO";
+
+    /**
+     * 表号-功能号
+     */
+    public final static String METER_FUNCID_PREFIX = "METER_FUNCID";
+
+    /**
+     * 交接班当前班次
+     */
+    public final static String CURRENT_SHIFT = "CURRENT_SHIFT";
+    /**
+     * 未读消息
+     */
+    public final static String UNREAD_MATTER = "UNREAD_MATTER";
+
+    /**
+     * 建筑下楼层
+     */
+    public static final String BUILD_FLOOR_CACHE = "BUILD_FLOOR";
+
+    /**
+     * 项目下建筑
+     */
+    public static final String PROJECT_BUILD_CACHE = "PROJECT_BUILD";
+}

+ 295 - 0
src/main/java/com/persagy/dmp/constant/RequestUrlConstant.java

@@ -0,0 +1,295 @@
+package com.persagy.dmp.constant;
+
+/**
+ * @author xingmaojun
+ * @version V1.0
+ * @ClassName RequestUrlConstant
+ * @Description: 请求url常量
+ * @date 2020/6/3 16:09
+ **/
+public class RequestUrlConstant {
+
+    /**
+     * 创建对象
+     */
+    public final static String OBJECT_CREATE = "/rwd/instance/object/create";
+
+    /**
+     * 更新对象
+     */
+    public final static String OBJECT_UPDATE = "/rwd/instance/object/update";
+
+    /**
+     * 删除对象
+     */
+    public final static String OBJECT_DELETE = "/rwd/instance/object/delete";
+
+    /**
+     * 查询对象
+     */
+    public final static String OBJECT_QUERY = "/rwd/instance/object/query";
+
+    /**
+     * 查询实时数据
+     */
+    public final static String OBJECT_CURRENT_DATA = "/rwd/iot/data/current";
+
+    /**
+     * 查询历史数据/分精度数据
+     */
+    public final static String OBJECT_HISTORY_DATA = "/rwd/iot/data/history";
+
+    /**
+     * 查询图实例
+     */
+    public final static String GRAPH_QUERY = "/rwd/graph/query";
+
+    /**
+     * 创建关系
+     */
+    public final static String RELATION_CREATE = "/rwd/instance/relation/create";
+
+    /**
+     * 删除关系
+     */
+    public final static String RELATION_DELETE = "/rwd/instance/relation/delete";
+
+    /**
+     * 查询关系
+     */
+    public final static String RELATION_QUERY = "/rwd/instance/relation/query";
+
+    /**
+     * 查询关系对象
+     */
+    public final static String RELATION_OBJECT_QUERY = "/rwd/instance/relation/object/query";
+
+
+    /************************************************************************************/
+
+    /************************************************************************************/
+
+
+    /**
+     * 查询信息点描述信息
+     */
+    public final static String DEF_FUNCID = "/rwd/def/funcid";
+
+    /**
+     * 类型查询
+     */
+    public final static String DEF_CLASS = "/rwd/def/class";
+
+    /**
+     * 从数据字典中查询专业
+     */
+    public static final String DICT_QUERY = "/dic/dt/data/query";
+
+    // ==================报警模块=========================================================================
+    /**
+     * 查询报警记录
+     */
+    public static final String ALARM_QUERY = "/alarm/record/query";
+
+    /**
+     * 新增报警记录
+     */
+    public static final String ALARM_CREATE = "/alarm/record/create";
+
+    /**
+     * 更新报警记录
+     */
+    public static final String ALARM_UPDATE = "/alarm/record/update";
+
+    /**
+     * 查询报警条目
+     */
+    public static final String ALARM_ITEM = "/alarm/item/query";
+
+    /**
+     * 查询报警定义
+     */
+    public static final String ALARM_CONFIG = "/alarm/config/query";
+
+    /**
+     * 更新报警定义
+     */
+    public static final String ALARM_CONFIG_UPDATE = "/alarm/config/update";
+
+    /**
+     * 查询报警匹配规则
+     */
+    public static final String ALARM_TARGET_QUERY = "/alarm/target/query";
+
+    /**
+     * 创建报警匹配规则
+     */
+    public static final String ALARM_TARGET_CREATE = "/alarm/target/create";
+
+    /**
+     * 更新报警匹配规则
+     */
+    public static final String ALARM_TARGET_UPDATE = "/alarm/target/update";
+
+    /**
+     * 删除报警匹配规则
+     */
+    public static final String ALARM_TARGET_DELETE = "/alarm/target/delete";
+
+    /**
+     * 创建报警记录的操作日志
+     */
+    public static final String ALARM_CREATE_LOG = "/alarm/log/create";
+
+    /**
+     * 查询操作日志数据
+     */
+    public static final String ALARM_QUERY_LOG = "/alarm/log/query";
+
+    /**
+     * 创建报警批注
+     */
+    public static final String ALARM_CREATE_COMMENT = "/alarm/comment/create";
+
+    /**
+     * 查询报警批注
+     */
+    public static final String ALARM_QUERY_COMMENT = "/alarm/comment/query";
+
+    /**
+     * 根据系统类/设备类 查询专业和系统
+     */
+    public static final String ZKT_MONITOR_CATEGORY_MAJOR_AND_SYSTEM = "/category/categoryMajorAndSystem";
+    /**
+     * 集成框架字典服务--创建字典类型
+     */
+    public static final String DICT_CENTER_CREATE_DICT_TYPE = "/v1.0/dictType/createDictType";
+    /**
+     * 集成框架字典服务--查询字典类型
+     */
+    public static final String DICT_CENTER_QUERY_DICT_TYPE_LIST = "/v1.0/dictType/queryDictTypeList";
+    /**
+     * 集成框架字典服务--创建字典数据
+     */
+    public static final String DICT_CENTER_CREATE_DICT_DATA = "/v1.0/dictData/createDictData";
+    /**
+     * 集成框架字典服务--查询字典数据
+     */
+    public static final String DICT_CENTER_QUERY_AGG_DICT_DATA_LIST = "/v1.0/dictData/queryAggDictDataList";
+
+
+    /**
+     * 异步采集-读取点位
+     */
+    public static final String POINT_READ_POST = "/pointread_post";
+
+    /**
+     * 异步采集-批量读取点位
+     */
+    public static final String POINT_READ_BATCH_POST = "/pointreadbatch_post";
+
+    /**
+     * 同步采集-同步读取点位
+     */
+    public static final String SYNC_POINT_READ_POST = "/sync_pointread_post";
+
+    /**
+     * 同步采集-批量读取点位
+     */
+    public static final String SYNC_POINT_READ_BATCH_POST = "/sync_pointreadbatch_post";
+
+    /**
+     * 查询采集当前值
+     */
+    public static final String PRESENT_REPORT_POST = "/presentreport_post";
+
+    /**
+     * 批量查询采集当前值
+     */
+    public static final String PRESENT_REPORT_BATCH_POST = "/presentreportbatch_post";
+
+
+    /**
+     * 异步控制-设置点位
+     */
+    public static final String POINT_SET_POST = "/pointset_post";
+
+
+    /**
+     * 异步控制-批量设置点位
+     */
+    public static final String POINT_SET_BATCH_POST = "/pointsetbatch_post";
+
+    /**
+     * 同步控制-设置点位
+     */
+    public static final String SYNC_POINT_SET_POST = "/sync_pointset_post";
+
+    /**
+     * 同步控制-批量设置点位
+     */
+    public static final String SYNC_POINT_SET_BATCH_POST = "/sync_pointsetbatch_post";
+
+    /**
+     * 同步控制-批量查询控制结果
+     */
+    public static final String POINT_SET_RESULT_BATCH_POST = "/pointsetresultbatch_post";
+
+    /**
+     * 查询控制当前值
+     */
+    public static final String PRESENT_SET_POST = "/presentset_post";
+
+    /**
+     * 批量查询控制当前值
+     */
+    public static final String PRESENT_SET_BATCH_POST = "/presentsetbatch_post";
+
+    /**
+     * 查询人员详情
+     */
+    public static final String PERSON_CENTER_QUERY_PERSON_DETAIL_BY_ID = "/restPersonService/queryPersonDetailById";
+    
+    /**
+     * 查询人员的token
+     */
+    public static final String PERSON_CENTER_QUERY_PERSON_TOKEN_BY_USERNAME = "/user/queryPersonTokenByUserName";
+    
+    // ==================中台组织结构开始=========================================================================
+    /**
+     * 中台人员组织权限服务--查询用户
+     */
+    public static final String ORG_USER_QUERY = "/org/user/query";
+
+    /**
+     * 集团查询
+     */
+    public static final String ORG_GROUP_QUERY = "/org/group/query";
+
+    /**
+     * 项目查询
+     */
+    public static final String ORG_PROJECT_QUERY = "/org/project/query";
+
+    // ==================中台组织结构结束=========================================================================
+
+    // ==================FM=========================================================================
+    /**
+     * FM工单--工单列表
+     */
+    public static final String QUERY_WORK_ORDER_LIST = "/workorder/restWorkOrderService/queryWorkOrderList";
+    // ==================FM=========================================================================
+
+    // zkt-monitor begin
+
+    /**
+     * 获取角色名称
+     */
+    public static final String GET_ROLE_NAME = "getRoleName";
+
+    // zkt-monitor end
+
+    /** 查询IBMS角色人员列表 */
+    public static final String QUERY_FM_SAAS_PERSON = "/ibmsManage/personRoleRel/queryPersonRoleList";
+
+}

+ 92 - 0
src/main/java/com/persagy/dmp/constant/ResponseCode.java

@@ -0,0 +1,92 @@
+package com.persagy.dmp.constant;
+
+/**
+ * @author zhangqiankun
+ * @description
+ * @since 2020年8月26日:	下午5:17:08
+ */
+public enum ResponseCode {
+
+    A00000("00000", "success"),
+
+    A10000("10000", "failure"),
+
+    A0001("A0001", "用户端错误"),
+
+    A0100("A0100", "用户注册错误"),
+
+    A0151("A0151", "手机格式校验失败"),
+
+    A0152("A0152", "地址格式校验失败"),
+
+    A0153("A0153", "邮箱格式校验失败"),
+
+    A0154("A0154", "账号名称重复"),
+
+    A0155("A0155", "员工编号重复"),
+
+    A0156("A0156", "手机号重复"),
+
+    A0157("A0157", "邮箱重复"),
+
+    A0220("A0220", "用户身份校验失败"),
+
+    A0301("A0301", "访问未授权"),
+
+    A0324("A0324", "网关访问受限"),
+
+    A0400("A0400", "用户请求参数错误"),
+
+    A0402("A0402", "无效的用户输入"),
+
+    A0422("A0422", "地址不在服务范围"),
+
+    A0427("A0427", "请求 JSON 解析失败"),
+
+    B0001("B0001", "系统执行出错"),
+
+    B0300("B0300", "系统资源异常"),
+
+    C0001("C0001", "调用第三方服务出错"),
+
+    C0100("C0100", "中间件服务出错"),
+
+    C0110("C0110", "RPC服务出错"),
+
+    C0134("C0134", "不支持的数据格式"),
+
+    C0135("C0135", "Method Not Allowed"),
+
+    C0136("C0136", "Unsupported Media Type"),
+
+    C0137("C0137", "Not Acceptable"),
+
+    C0320("C0320", "数据不存在"),
+
+    C0341("C0341", "主键冲突"),
+
+    Z9999("Z9999", "系统繁忙");    // 未知异常
+
+    private final String code;
+
+    private final String desc;
+
+    ResponseCode(String code, String desc) {
+        this.desc = desc;
+        this.code = code;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    @Override
+    public String toString() {
+        return this.code + "_" + this.desc;
+    }
+
+}

+ 42 - 0
src/main/java/com/persagy/dmp/constant/ResponseMsg.java

@@ -0,0 +1,42 @@
+package com.persagy.dmp.constant;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.persagy.dmp.enumeration.EnumResult;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @description: 服务接口调用返回值
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/9/21 11:01
+ * @version: V1.0
+ */
+@Data
+@NoArgsConstructor
+public class ResponseMsg {
+
+    /**
+     * 状态,success成功 failure失败
+     */
+    @JSONField(name = "Result")
+    private EnumResult result;
+
+    /**
+     * 响应码
+     */
+    @JSONField(name = "ResultCode")
+    private Integer resultCode;
+
+    /**
+     * 错误信息
+     */
+    @JSONField(name = "ResultMsg")
+    private String resultMsg;
+
+    public ResponseMsg(EnumResult result, Integer resultCode, String resultMsg) {
+        this.result = result;
+        this.resultCode = resultCode;
+        this.resultMsg = resultMsg;
+    }
+}

+ 40 - 0
src/main/java/com/persagy/dmp/constant/UserConstant.java

@@ -0,0 +1,40 @@
+package com.persagy.dmp.constant;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy 
+ * @author zhangqiankun
+ * @date 2021年12月14日 上午11:26:01
+ */
+public class UserConstant {
+
+	public static String EMS_SAAS_WEB_LOGIN_PARAM = "{\"loginName\":\"{}\",\"password\":\"{}\",\"loginDevice\":\"{}\", \"isAdminLogin\":false}";
+    
+    /** 默认用户ID */
+    public static final String USER_ID = "ibms";
+    /** 默认用户ID */
+    public static final String SUCCESS = "success";
+    
+    /** 服务异常 */
+    public static final int SERVER_EXCEPTION = -500;
+    
+    /** 账号不存在 */
+    public static final int NOT_EXISTS_USERNAME = -501;
+    
+    /** 账号密码不一致 */
+    public static final int USERNAME_NOT_PASSWORD = -502;
+    
+    /** 账号不允许在此端登录 */
+    public static final int NOT_EXISTS_LOGINDEVICE = -503;
+    
+    /** 此账号没有访问权限 */
+    public static final int NOT_AUTH_USERNAME = -504;
+
+    /** 此账号已被冻结 */
+    public static final int NOT_ALLOW_USERNAME = -505;
+    
+    /** 此账号未关联人员 */
+    public static final int USERNAME_NOT_PERSON = -506;
+    
+}

+ 65 - 0
src/main/java/com/persagy/dmp/dao/CollectDao.java

@@ -0,0 +1,65 @@
+package com.persagy.dmp.dao;
+
+import com.persagy.dmp.dto.collect.BatchPointReportParam;
+import com.persagy.dmp.dto.collect.BatchPointReportResult;
+import com.persagy.dmp.dto.collect.PointReportParam;
+import com.persagy.dmp.dto.collect.PointReportResult;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * @description: 采集dao接口
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/12/18 18:20
+ * @version: V1.0
+ **/
+public interface CollectDao {
+
+    /**
+     * @description: 异步采集-读取点位
+     * @param: pointReportParam
+     * @return: com.persagy.dmp.dto.collect.PointReportResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:23
+     * @version: V1.0
+     */
+    PointReportResult pointRead(@RequestBody PointReportParam pointReportParam);
+
+    /**
+     * @description: 异步采集-批量读取点位
+     * @param: pointReportParam
+     * @return: com.persagy.dmp.dto.collect.BatchPointReportResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:23
+     * @version: V1.0
+     */
+    BatchPointReportResult pointReadBatch(@RequestBody BatchPointReportParam batchPointReportParam);
+
+    /**
+     * @description: 查询采集当前值
+     * @param: pointReportParam
+     * @return: com.persagy.dmp.dto.collect.PointReportResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:23
+     * @version: V1.0
+     */
+    PointReportResult presentReport(@RequestBody PointReportParam pointReportParam);
+
+    /**
+     * @description: 批量查询采集当前值
+     * @param: pointReportParam
+     * @return: com.persagy.dmp.dto.collect.BatchPointReportResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:23
+     * @version: V1.0
+     */
+    BatchPointReportResult presentReportBatch(@RequestBody BatchPointReportParam batchPointReportParam);
+}

+ 100 - 0
src/main/java/com/persagy/dmp/dao/ControlDao.java

@@ -0,0 +1,100 @@
+package com.persagy.dmp.dao;
+
+import com.persagy.dmp.dto.control.BatchPointSetParam;
+import com.persagy.dmp.dto.control.BatchPointSetResult;
+import com.persagy.dmp.dto.control.PointSetParam;
+import com.persagy.dmp.dto.control.PointSetResult;
+
+/**
+ * @description: 控制dao接口
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/12/18 18:20
+ * @version: V1.0
+ **/
+public interface ControlDao {
+
+    /**
+     * @description: 异步控制-设置点位
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.PointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:20
+     * @version: V1.0
+     */
+    PointSetResult pointSet(PointSetParam pointSetParam);
+
+    /**
+     * @description: 异步控制-批量设置点位
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.BatchPointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:20
+     * @version: V1.0
+     */
+    BatchPointSetResult pointSetBatch(BatchPointSetParam batchPointSetParam);
+
+    /**
+     * @description: 同步控制-设置点位
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.PointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:20
+     * @version: V1.0
+     */
+    PointSetResult syncPointSet(PointSetParam pointSetParam);
+
+    /**
+     * @description: 同步控制-批量设置点位
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.BatchPointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:20
+     * @version: V1.0
+     */
+    BatchPointSetResult syncPointSetBatch(BatchPointSetParam batchPointSetParam);
+
+    /**
+     * @description: 异步控制-批量查询控制结果
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.BatchPointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:20
+     * @version: V1.0
+     */
+    BatchPointSetResult pointSetResultBatch(BatchPointSetParam batchPointSetParam);
+
+    /**
+     * @description: 查询控制当前值
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.PointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:20
+     * @version: V1.0
+     */
+    PointSetResult presentSet(PointSetParam pointSetParam);
+
+    /**
+     * @description: 批量查询控制当前值
+     * @param: pointSetParam
+     * @return: com.persagy.dmp.dto.control.BatchPointSetResult
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/18 20:20
+     * @version: V1.0
+     */
+    BatchPointSetResult presentSetBatch(BatchPointSetParam batchPointSetParam);
+}

+ 63 - 0
src/main/java/com/persagy/dmp/dao/DefDao.java

@@ -0,0 +1,63 @@
+package com.persagy.dmp.dao;
+
+import com.alibaba.fastjson.JSONArray;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.dmp.dto.FuncIdQueryDTO;
+import com.persagy.dmp.dto.InfoPointDictDTO;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @description: 字典定义
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 15:24
+ * @version: V1.0
+ */
+public interface DefDao {
+
+    /***
+     * @description: 获取数据字典平台级别信息点属性信息
+     * @param groupCode 集团编码
+     * @param: projectId
+     * @param: classCode
+     * @return: java.util.List<com.persagy.huiyun.dto.InfoPointDictDTO>
+     * @exception:
+     * @author: fenghanchao
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/6/5 17:14
+     * @version: V1.0
+     */
+    List<InfoPointDictDTO> queryInfoPointDictList(String groupCode, String projectId, String classCode) throws Exception;
+
+    /**
+     * @param groupCode 集团编码
+     * @description: 获取数据字典信息点属性信息
+     * @param: projectId 项目id
+     * @param: funcIdQueryDto 查询信息点参数类
+     * @return: java.util.List<com.persagy.common.dto.InfoPointDictDTO>
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/29 10:56
+     * @version: V1.0
+     */
+    List<InfoPointDictDTO> queryInfoPointDictList(String groupCode, String projectId, FuncIdQueryDTO funcIdQueryDto) throws Exception;
+
+
+    /**
+     * @param groupCode                        集团编码
+     * @param projectId
+     * @param subFlag:true/false,是否按分类信息点展示子分类 可选,默认false
+     * @param criteria:参数自定义可传id,code等
+     * @description: 查询类信息(可实例化的)
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: shiliqiang
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/11 16:44
+     * @version: V1.0
+     */
+    JSONArray queryClassInfoList(String groupCode, @NotNull String projectId, Boolean subFlag, @NotNull JacksonCriteria criteria) throws Exception;
+
+}

+ 44 - 0
src/main/java/com/persagy/dmp/dao/DicDao.java

@@ -0,0 +1,44 @@
+package com.persagy.dmp.dao;
+
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.dmp.dto.dict.DictDataDTO;
+
+import java.util.List;
+
+/**
+ * @description: 字典接口
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 15:18
+ * @version: V1.0
+ **/
+public interface DicDao {
+
+    /**
+     * @description: 查询字典
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: type  字典类型
+     * @return: java.util.List<com.persagy.dmp.dto.dict.DictDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/29 17:24
+     * @version: V1.0
+     */
+    List<DictDataDTO> queryDictDataList(String groupCode, String projectId, String type) throws Exception;
+
+    /**
+     * @description: 查询字典
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: criteria  筛选条件
+     * @return: java.util.List<com.persagy.dmp.dto.dict.DictDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/29 17:24
+     * @version: V1.0
+     */
+    List<DictDataDTO> queryDictDataList(String groupCode, String projectId, JacksonCriteria criteria) throws Exception;
+}

+ 30 - 0
src/main/java/com/persagy/dmp/dao/FireAlarmDao.java

@@ -0,0 +1,30 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.FireAlarm;
+import com.persagy.dmp.mapper.FireAlarmMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @description: 消防报警dao
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2021/4/19 16:57
+ * @version: V1.0
+ **/
+@Slf4j
+@Repository
+public class FireAlarmDao extends ServiceImpl<FireAlarmMapper, FireAlarm> {
+
+    @Autowired
+    private FireAlarmMapper fireAlarmMapper;
+
+    public List<String> queryEquipList(String groupCode, String projectId) {
+        return fireAlarmMapper.queryEquipList(groupCode, projectId);
+    }
+}

+ 20 - 0
src/main/java/com/persagy/dmp/dao/GeneralDictionaryDao.java

@@ -0,0 +1,20 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.GeneralDictionary;
+import com.persagy.dmp.mapper.GeneralDictionaryMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 通用数据字典表(general_dictionary)数据DAO
+ *
+ * @author luoguangyi
+ * @description 由 Mybatisplus Code Generator 创建
+ * @since 2021-01-26 11:42:11
+ */
+@Slf4j
+@Repository
+public class GeneralDictionaryDao extends ServiceImpl<GeneralDictionaryMapper, GeneralDictionary> {
+
+}

+ 19 - 0
src/main/java/com/persagy/dmp/dao/GroupProjectRelDao.java

@@ -0,0 +1,19 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.GroupProjectRel;
+import com.persagy.dmp.mapper.GroupProjectRelMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @description: 集团-项目关联表
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/12/14 17:37
+ * @version: V1.0
+ **/
+@Slf4j
+@Repository
+public class GroupProjectRelDao extends ServiceImpl<GroupProjectRelMapper, GroupProjectRel> {
+}

+ 150 - 0
src/main/java/com/persagy/dmp/dao/IOTDao.java

@@ -0,0 +1,150 @@
+package com.persagy.dmp.dao;
+
+import com.persagy.dmp.dto.CurrentDataDTO;
+import com.persagy.dmp.dto.DataQueryDTO;
+import com.persagy.dmp.dto.HistoryDataDTO;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @description: iot数据接口
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/15 11:58
+ * @version: V1.0
+ **/
+public interface IOTDao {
+
+    /**
+     * @description: 查询实时数据
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @param: infoCode 信息点编码
+     * @return: com.persagy.common.dto.CurrentDataDTO
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:12
+     * @version: V1.0
+     */
+    CurrentDataDTO queryCurrentData(String groupCode, @NotNull String projectId, @NotNull String objectId, @NotNull String infoCode) throws Exception;
+
+    /**
+     * @description: 查询实时数据
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectIdList 对象列表
+     * @param: infoCode 信息点编码
+     * @return: java.util.List<com.persagy.common.dto.CurrentDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:12
+     * @version: V1.0
+     */
+    List<CurrentDataDTO> queryCurrentDataList(String groupCode, @NotNull String projectId, @NotNull List<String> objectIdList, @NotNull String infoCode) throws Exception;
+
+    /**
+     * @description: 查询实时数据
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @param: infoCodeList 信息点编码列表
+     * @return: java.util.List<com.persagy.common.dto.CurrentDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:11
+     * @version: V1.0
+     */
+
+    List<CurrentDataDTO> queryCurrentDataList(String groupCode, @NotNull String projectId, @NotNull String objectId, @NotNull List<String> infoCodeList) throws Exception;
+
+    /**
+     * @description: 查询实时数据
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: dataQueryDtoList 实时数据参数(对象id、信息点)列表
+     * @return: java.util.List<com.persagy.common.dto.CurrentDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:11
+     * @version: V1.0
+     */
+    List<CurrentDataDTO> queryCurrentDataList(String groupCode, @NotNull String projectId, @NotNull List<DataQueryDTO> dataQueryDTOList) throws Exception;
+
+
+    /**
+     * @description: 查询历史数据/分精度数据
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @param: infoCode 信息点编码
+     * @param: startTime 开始时间
+     * @param: endTime 结束时间
+     * @param: period 时间间隔
+     * @return: com.persagy.common.dto.HistoryDataDTO
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:06
+     * @version: V1.0
+     */
+    HistoryDataDTO queryHistoryDataList(String groupCode, @NotNull String projectId, @NotNull String objectId, @NotNull String infoCode, @NotNull String startTime, String endTime, @NotNull String period) throws Exception;
+
+    /**
+     * @description: 查询历史数据/分精度数据
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @param: infoCodeList 信息点编码列表
+     * @param: startTime 开始时间
+     * @param: endTime 结束时间
+     * @param: period 时间间隔
+     * @return: java.util.List<com.persagy.common.dto.HistoryDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:06
+     * @version: V1.0
+     */
+    List<HistoryDataDTO> queryHistoryDataList(String groupCode, @NotNull String projectId, @NotNull String objectId, @NotNull List<String> infoCodeList, @NotNull String startTime, String endTime, @NotNull String period) throws Exception;
+
+    /**
+     * @description: 查询历史数据/分精度数据
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectIdList 对象id列表
+     * @param: infoCode 信息点编码
+     * @param: startTime 开始时间
+     * @param: endTime 结束时间
+     * @param: period 时间间隔
+     * @return: java.util.List<com.persagy.common.dto.HistoryDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:05
+     * @version: V1.0
+     */
+    List<HistoryDataDTO> queryHistoryDataList(String groupCode, @NotNull String projectId, @NotNull List<String> objectIdList, @NotNull String infoCode, @NotNull String startTime, String endTime, String period) throws Exception;
+
+    /**
+     * @description: 查询历史数据/分精度数据
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: dataQueryDtoList 查询历史数据的对象id、信息点信息点编码类列表
+     * @param: startTime 开始时间
+     * @param: endTime 结束时间
+     * @param: period 时间间隔
+     * @return: java.util.List<com.persagy.common.dto.HistoryDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:04
+     * @version: V1.0
+     */
+    List<HistoryDataDTO> queryHistoryDataList(String groupCode, @NotNull String projectId, @NotNull List<DataQueryDTO> dataQueryDTOList, @NotNull String startTime, String endTime, @NotNull String period) throws Exception;
+}

+ 470 - 0
src/main/java/com/persagy/dmp/dao/InstanceDao.java

@@ -0,0 +1,470 @@
+package com.persagy.dmp.dao;
+
+import java.util.List;
+
+import javax.validation.constraints.NotNull;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.dmp.common.PageResult;
+import com.persagy.dmp.dto.ObjRelationDTO;
+import com.persagy.dmp.dto.RelationFromDTO;
+import com.persagy.dmp.dto.RelationToDTO;
+import com.persagy.dmp.dto.relation.BatchRelationCriteria;
+import com.persagy.dmp.dto.relation.CreateRelation;
+import com.persagy.dmp.dto.relation.RelationCriteria;
+
+import lombok.NonNull;
+
+/**
+ * @description: 物理世界对象、关系实例
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/6/3 16:56
+ * @version: V1.0
+ */
+public interface InstanceDao {
+
+    /**
+     * @description: 查询关系对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromId from对象id
+     * @param: toClassCode to对象类型
+     * @param: withColumns 附带对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/6/5 15:56
+     * @version: V1.0
+     */
+    JSONArray queryRelationObjectByFromId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull String fromId, List<String> toClassCode, List<String> withColumns) throws Exception;
+
+    /**
+     * 获取系统下指定设备
+     * 
+     * @param groupCode
+     * @param projectId
+     * @param graphCode
+     * @param relCode
+     * @param fromId
+     * @param ibmsSceneCode
+     * @param ibmsClassCode
+     * @param withColumns
+     * @return
+     * @throws Exception
+     * @date 2021年12月24日 下午4:03:05
+     */
+    JSONArray queryRelationObjectByFromId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull String fromId, 
+    		String ibmsSceneCode, String ibmsClassCode, List<String> withColumns) throws Exception;
+
+    /**
+     * @description: 查询关系对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromIds from对象id列表
+     * @param: toClassCode to对象类型
+     * @param: withColumns 附带对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/6/5 15:56
+     * @version: V1.0
+     */
+    JSONArray queryRelationObjectByFromIds(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull List<String> fromIds, List<String> toClassCode, List<String> withColumns) throws Exception;
+
+    /**
+     * @description: 查询关系对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromClassCode from对象类型
+     * @param: toId to对象id
+     * @param: withColumns 附带对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/29 11:44
+     * @version: V1.0
+     */
+    JSONArray queryRelationObjectByToId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, List<String> fromClassCode, @NotNull String toId, List<String> withColumns) throws Exception;
+
+    /**
+     * @description: 查询对象关系
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型
+     * @param: relCode 边类型
+     * @param: fromClassCode from对象类型
+     * @param: toId to对象id
+     * @param: withColumns 附带对象信息点(默认只返回id, name, localId, localName, classCode)
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/9/17 14:52
+     * @version: V1.0
+     */
+    JSONArray queryRelationObjectByToId(String groupCode, String projectId, String graphCode, String relCode, String toId, String ibmsSceneCode, String ibmsClassCode) throws Exception;
+
+    /**
+     * @description: 查询关系对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromClassCode from对象类型
+     * @param: toIds to对象id列表
+     * @param: withColumns 附带对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/29 11:44
+     * @version: V1.0
+     */
+    JSONArray queryRelationObjectByToIds(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, List<String> fromClassCode, @NotNull List<String> toIds, List<String> withColumns) throws Exception;
+
+    /**
+     * @description: 查询关系对象(fromIds和toIds只能传一个)
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromIds from对象id
+     * @param: toIds to对象id列表
+     * @param: objectCriteria 查询对象条件
+     * @param: withColumns 查询对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/30 10:40
+     * @version: V1.0
+     */
+    JSONArray queryRelationObject(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, List<String> fromIds, List<String> toIds, JSONObject objectCriteria, List<String> withColumns) throws Exception;
+
+    /**
+     * @description: 查询关系
+     * @param: groupCode 集团编码
+     * @param: projectId 查询关系
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromId from对象id
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:22
+     * @version: V1.0
+     */
+    List<ObjRelationDTO> queryRelationByFromId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull String fromId) throws Exception;
+
+    /**
+     * @description: 查询关系
+     * @param: groupCode 集团编码
+     * @param: projectId 查询关系
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromIds from对象id列表
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:22
+     * @version: V1.0
+     */
+    List<ObjRelationDTO> queryRelationByFromIds(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull List<String> fromIds) throws Exception;
+
+    /**
+     * @description: 查询关系
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: toId to对象id
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:21
+     * @version: V1.0
+     */
+    List<ObjRelationDTO> queryRelationByToId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull String toId) throws Exception;
+
+    /**
+     * @description: 查询关系
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: toIds to对象id列表
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:20
+     * @version: V1.0
+     */
+    List<ObjRelationDTO> queryRelationByToIds(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull List<String> toIds) throws Exception;
+
+    /**
+     * @description: 查询关系(fromIds和toIds只能传一个)
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromIds from对象id列表
+     * @param: toIds to对象id列表
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:19
+     * @version: V1.0
+     */
+    List<ObjRelationDTO> queryRelation(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, List<String> fromIds, List<String> toIds) throws Exception;
+
+    /**
+     * @description: 创建关系
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: createRelationList 创建关系
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:20
+     * @version: V1.0
+     */
+    Boolean createRelation(String groupCode, @NotNull String projectId, @NotNull CreateRelation createRelation);
+
+    /**
+     * @description: 批量创建关系
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: createRelationList 创建关系
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:20
+     * @version: V1.0
+     */
+    Boolean createRelation(String groupCode, @NotNull String projectId, @NotNull List<CreateRelation> createRelationList);
+
+    /**
+     * @description: 批量删除关系
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: criteria 删除关系条件
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:20
+     * @version: V1.0
+     */
+    Boolean batchDeleteRelation(String groupCode, @NotNull String projectId, @NotNull BatchRelationCriteria criteria);
+
+    /**
+     * @description: 删除关系
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: criteria 删除关系条件
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:20
+     * @version: V1.0
+     */
+    Boolean deleteRelation(String groupCode, @NotNull String projectId, @NotNull RelationCriteria criteria);
+
+    /**
+     * @description: 批量创建对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: classCode 对象类型
+     * @param: objectInfo 创建对象信息点
+     * @return: void
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:17
+     * @version: V1.0
+     */
+    Boolean createObject(String groupCode, String projectId, @NonNull String classCode, JSONObject objectInfo);
+
+    /**
+     * @description: 批量创建对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectArr 创建对象列表
+     * @return: void
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:17
+     * @version: V1.0
+     */
+    Boolean createObject(String groupCode, String projectId, JSONArray objectArr);
+
+    /**
+     * @description: 批量更新对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectId 更新对象id
+     * @param: objectArr 更新对象信息点
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:16
+     * @version: V1.0
+     */
+    Boolean updateObject(String groupCode, String projectId, String objectId, JSONObject objectInfo);
+
+    /**
+     * @description: 批量更新对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectArr 更新对象列表
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:16
+     * @version: V1.0
+     */
+    Boolean updateObject(String groupCode, String projectId, JSONArray objectArr);
+
+    /**
+     * @description: 删除对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectId 删除对象id
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:15
+     * @version: V1.0
+     */
+    Boolean deleteObject(String groupCode, String projectId, String objectId);
+
+    /**
+     * @description: 批量删除对象
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectIdList 删除对象id列表
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:15
+     * @version: V1.0
+     */
+    Boolean deleteObject(String groupCode, String projectId, List<String> objectIdList);
+
+    /**
+     * @description: 获取对象信息点
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @return: com.alibaba.fastjson.JSONObject
+     * @exception:
+     * @author: fenghanchao
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/6/5 17:06
+     * @version: V1.0
+     */
+    JSONObject queryObjectInfo(String groupCode, String projectId, String objectId) throws Exception;
+    
+    /**
+     * 获取对象信息
+     * 
+     * @param groupCode
+     * @param projectId
+     * @param ibmsSceneCode
+     * @param ibmsClassCode
+     * @param objectId
+     * @return
+     * @throws Exception
+     * @date 2021年12月24日 上午10:48:11
+     */
+    JSONObject queryObjectInfo(String groupCode, String projectId, String ibmsSceneCode, String ibmsClassCode, String objectId) throws Exception;
+
+    /***
+     * @description: 根据classCode获取对象列表
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: classCode 设备类型编码
+     * @return: JSONArray
+     * @exception:
+     * @author: fenghanchao
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 11:27 2020/6/23
+     * @version: V1.0
+     */
+    PageResult<JSONArray> queryObjectList(String groupCode, String projectId, String classCode,List<String> withColumns) throws Exception;
+
+    PageResult<JSONArray> queryObjectList(String groupCode, @NotNull String projectId, @NotNull String ibmsSceneCode, @NotNull String ibmsClassCode, List<String> withColumns) throws Exception;
+
+    /***
+     * @description: 根据对象id获取项目列表
+     * @param: groupCode 集团编码
+     * @param: projectId 建筑id
+     * @param: objectIdList 对象列表
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: fenghanchao
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 16:56 2020/7/13
+     * @version: V1.0
+     */
+    JSONArray queryObjectList(String groupCode, String projectId, List<String> objectIdList) throws Exception;
+
+    /***
+     * @description: 根据对象id获取项目列表
+     * @param: groupCode 集团编码
+     * @param: projectId 建筑id
+     * @param: criteria 查询条件
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: fenghanchao
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 16:56 2020/7/13
+     * @version: V1.0
+     */
+    PageResult<JSONArray> queryObjectList(String groupCode, @NotNull String projectId, @NotNull JacksonCriteria criteria) throws Exception;
+
+    /***
+     * @description: 根据对象id获取项目列表
+     * @param: groupCode 集团编码
+     * @param: projectId 建筑id
+     * @param: criteria 查询条件
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: fenghanchao
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 16:56 2020/7/13
+     * @version: V1.0
+     */
+    PageResult<JSONArray> queryObjectList(String groupCode, @NotNull String projectId, @NotNull JSONObject criteria) throws Exception;
+
+    /***
+     * @description: 根据对象id获取项目列表
+     * @param: groupCode 集团编码
+     * @param: projectId 建筑id
+     * @param: criteria 对象查询条件
+     * @param: relationFromDTO from关系查询条件
+     * @param: relationToDTO to关系查询条件
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: fenghanchao
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 16:56 2020/7/13
+     * @version: V1.0
+     */
+    PageResult<JSONArray> queryObjectList(String groupCode, @NotNull String projectId, @NotNull JacksonCriteria criteria, RelationFromDTO relationFromDTO, RelationToDTO relationToDTO) throws Exception;
+}

+ 15 - 0
src/main/java/com/persagy/dmp/dao/ObjectClassConfigBlackDao.java

@@ -0,0 +1,15 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.ObjectClassConfigBlack;
+import com.persagy.dmp.mapper.ObjectClassConfigBlackMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 模块-功能-对象分类下黑名单对象信息表(conf_object_black)数据DAO
+ */
+@Slf4j
+@Repository
+public class ObjectClassConfigBlackDao extends ServiceImpl<ObjectClassConfigBlackMapper, ObjectClassConfigBlack> {
+}

+ 15 - 0
src/main/java/com/persagy/dmp/dao/ObjectClassConfigDao.java

@@ -0,0 +1,15 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.ObjectClassConfig;
+import com.persagy.dmp.mapper.ObjectClassConfigMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 模块-功能-对象分类信息表(conf_object_class_map)数据DAO
+ */
+@Slf4j
+@Repository
+public class ObjectClassConfigDao extends ServiceImpl<ObjectClassConfigMapper, ObjectClassConfig> {
+}

+ 16 - 0
src/main/java/com/persagy/dmp/dao/ObjectClassFuncRelDao.java

@@ -0,0 +1,16 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.ObjectClassFuncRel;
+import com.persagy.dmp.mapper.ObjectClassFuncRelMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 模块-功能定义表(conf_module_function)数据DAO
+ */
+@Slf4j
+@Repository
+public class ObjectClassFuncRelDao extends ServiceImpl<ObjectClassFuncRelMapper, ObjectClassFuncRel> {
+
+}

+ 15 - 0
src/main/java/com/persagy/dmp/dao/ObjectGroupConfigDao.java

@@ -0,0 +1,15 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.ObjectGroupConfig;
+import com.persagy.dmp.mapper.ObjectGroupConfigMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 对象分组DAO
+ */
+@Slf4j
+@Repository
+public class ObjectGroupConfigDao extends ServiceImpl<ObjectGroupConfigMapper, ObjectGroupConfig> {
+}

+ 15 - 0
src/main/java/com/persagy/dmp/dao/ObjectGroupRelConfigDao.java

@@ -0,0 +1,15 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.ObjectGroupRelConfig;
+import com.persagy.dmp.mapper.ObjectGroupRelConfigMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 对象分组与对象实例关系DAO
+ */
+@Slf4j
+@Repository
+public class ObjectGroupRelConfigDao extends ServiceImpl<ObjectGroupRelConfigMapper, ObjectGroupRelConfig> {
+}

+ 19 - 0
src/main/java/com/persagy/dmp/dao/ObjectMeterFunctionDao.java

@@ -0,0 +1,19 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.ObjectMeterFunction;
+import com.persagy.dmp.mapper.ObjectMeterFunctionMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @description: 对象表号-功能号dao
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2021/3/15 18:00
+ * @version: V1.0
+ **/
+@Slf4j
+@Repository
+public class ObjectMeterFunctionDao extends ServiceImpl<ObjectMeterFunctionMapper, ObjectMeterFunction> {
+}

+ 20 - 0
src/main/java/com/persagy/dmp/dao/OperationLogDao.java

@@ -0,0 +1,20 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.OperationLog;
+import com.persagy.dmp.mapper.OperationLogMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 业务日志表(业务操作记录)(operation_log)数据DAO
+ *
+ * @author luoguangyi
+ * @description 由 Mybatisplus Code Generator 创建
+ * @since 2020-12-03 15:18:07
+ */
+@Slf4j
+@Repository
+public class OperationLogDao extends ServiceImpl<OperationLogMapper, OperationLog> {
+
+}

+ 16 - 0
src/main/java/com/persagy/dmp/dao/OrgDao.java

@@ -0,0 +1,16 @@
+package com.persagy.dmp.dao;
+
+import com.persagy.dmp.common.url.DicUrlParam;
+import com.persagy.dmp.entity.User;
+
+import java.util.List;
+import java.util.Map;
+
+public interface OrgDao {
+
+    List<User> queryUserList(DicUrlParam dicUrlParam, List<String> userIds) throws Exception;
+
+    Map<String, String> queryUserMap(DicUrlParam dicUrlParam, List<String> userIds) throws Exception;
+
+    List<User> queryUserIdNameList(DicUrlParam dicUrlParam, List<String> userIds) throws Exception;
+}

+ 18 - 0
src/main/java/com/persagy/dmp/dao/ZktJarRoleDao.java

@@ -0,0 +1,18 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.ZktJarRole;
+import com.persagy.dmp.mapper.ZktJarRoleMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Repository;
+
+/**
+ * zkt角色 数据DAO
+ *
+ * @author wenjie
+ */
+@Slf4j
+@Repository
+public class ZktJarRoleDao extends ServiceImpl<ZktJarRoleMapper, ZktJarRole> {
+
+}

+ 10 - 0
src/main/java/com/persagy/dmp/dao/ZktModuleDao.java

@@ -0,0 +1,10 @@
+package com.persagy.dmp.dao;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.entity.ZktModule;
+import com.persagy.dmp.mapper.ZktModuleMapper;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public class ZktModuleDao extends ServiceImpl<ZktModuleMapper, ZktModule> {
+}

+ 44 - 0
src/main/java/com/persagy/dmp/dao/impl/CollectDaoImpl.java

@@ -0,0 +1,44 @@
+package com.persagy.dmp.dao.impl;
+
+import com.persagy.dmp.client.EmsCollectClient;
+import com.persagy.dmp.dao.CollectDao;
+import com.persagy.dmp.dto.collect.BatchPointReportParam;
+import com.persagy.dmp.dto.collect.BatchPointReportResult;
+import com.persagy.dmp.dto.collect.PointReportParam;
+import com.persagy.dmp.dto.collect.PointReportResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @description: 采集dao实现
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/12/18 18:20
+ * @version: V1.0
+ **/
+@Component
+public class CollectDaoImpl implements CollectDao {
+
+    @Autowired
+    private EmsCollectClient emsCollectClient;
+
+    @Override
+    public PointReportResult pointRead(PointReportParam pointReportParam) {
+        return emsCollectClient.pointRead(pointReportParam);
+    }
+
+    @Override
+    public BatchPointReportResult pointReadBatch(BatchPointReportParam batchPointReportParam) {
+        return emsCollectClient.pointReadBatch(batchPointReportParam);
+    }
+
+    @Override
+    public PointReportResult presentReport(PointReportParam pointReportParam) {
+        return emsCollectClient.presentReport(pointReportParam);
+    }
+
+    @Override
+    public BatchPointReportResult presentReportBatch(BatchPointReportParam batchPointReportParam) {
+        return emsCollectClient.presentReportBatch(batchPointReportParam);
+    }
+}

+ 59 - 0
src/main/java/com/persagy/dmp/dao/impl/ControlDaoImpl.java

@@ -0,0 +1,59 @@
+package com.persagy.dmp.dao.impl;
+
+import com.persagy.dmp.client.EmsControlClient;
+import com.persagy.dmp.dao.ControlDao;
+import com.persagy.dmp.dto.control.BatchPointSetParam;
+import com.persagy.dmp.dto.control.BatchPointSetResult;
+import com.persagy.dmp.dto.control.PointSetParam;
+import com.persagy.dmp.dto.control.PointSetResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @description: 控制dao实现
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/12/18 18:20
+ * @version: V1.0
+ **/
+@Component
+public class ControlDaoImpl implements ControlDao {
+
+    @Autowired
+    private EmsControlClient emsControlClient;
+
+    @Override
+    public PointSetResult pointSet(PointSetParam pointSetParam) {
+        return emsControlClient.pointSet(pointSetParam);
+    }
+
+    @Override
+    public BatchPointSetResult pointSetBatch(BatchPointSetParam batchPointSetParam) {
+        return emsControlClient.pointSetBatch(batchPointSetParam);
+    }
+
+    @Override
+    public PointSetResult syncPointSet(PointSetParam pointSetParam) {
+        return emsControlClient.syncPointSet(pointSetParam);
+    }
+
+    @Override
+    public BatchPointSetResult syncPointSetBatch(BatchPointSetParam batchPointSetParam) {
+        return emsControlClient.syncPointSetBatch(batchPointSetParam);
+    }
+
+    @Override
+    public BatchPointSetResult pointSetResultBatch(BatchPointSetParam batchPointSetParam) {
+        return emsControlClient.pointSetResultBatch(batchPointSetParam);
+    }
+
+    @Override
+    public PointSetResult presentSet(PointSetParam pointSetParam) {
+        return emsControlClient.presentSet(pointSetParam);
+    }
+
+    @Override
+    public BatchPointSetResult presentSetBatch(BatchPointSetParam batchPointSetParam) {
+        return emsControlClient.presentSetBatch(batchPointSetParam);
+    }
+}

+ 107 - 0
src/main/java/com/persagy/dmp/dao/impl/DefDaoImpl.java

@@ -0,0 +1,107 @@
+package com.persagy.dmp.dao.impl;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.json.JacksonMapper;
+import com.persagy.dmp.client.AlarmNewServerClient;
+import com.persagy.dmp.client.GroupServerClient;
+import com.persagy.dmp.client.RwdServerClient;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.url.ClassUrParam;
+import com.persagy.dmp.common.url.FuncIdUrParam;
+import com.persagy.dmp.dao.DefDao;
+import com.persagy.dmp.dto.FuncIdQueryDTO;
+import com.persagy.dmp.dto.InfoPointDictDTO;
+import com.persagy.dmp.dto.QueryFuncId;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+
+import javax.validation.constraints.NotNull;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 数据字典类接口实现类
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/6/3 16:55
+ * @version: V1.0
+ */
+@Component
+public class DefDaoImpl implements DefDao {
+
+    private static final Logger logger = LoggerFactory.getLogger(DefDaoImpl.class);
+
+    @Autowired
+    private RwdServerClient rwdServerClient;
+
+    @Autowired
+    private AlarmNewServerClient alarmNewServerClient;
+
+    /***
+     * @description: 获取数据字典平台级信息点属性信息
+     * @param: projectId 项目id
+     * @param: classCode 类型编码
+     * @return: java.util.List<com.persagy.huiyun.dto.InfoPointDictDTO>
+     * @exception:
+     * @author: fenghanchao
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/6/5 17:14
+     * @version: V1.0
+     */
+    @Override
+    @Cacheable(value = "dataDict")
+    public List<InfoPointDictDTO> queryInfoPointDictList(String groupCode, String projectId, String classCode) throws Exception {
+        FuncIdQueryDTO funcIdQueryDto = new FuncIdQueryDTO();
+        funcIdQueryDto.setClassCode(classCode);
+        return this.queryInfoPointDictList(groupCode, projectId, funcIdQueryDto);
+    }
+
+    /**
+     * @description: 获取数据字典信息点属性信息
+     * @param: projectId 项目id
+     * @param: funcIdQueryDto 查询信息点参数类
+     * @return: java.util.List<com.persagy.common.dto.InfoPointDictDTO>
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/29 10:56
+     * @version: V1.0
+     */
+    @Override
+    @Cacheable(value = "dataDict")
+    public List<InfoPointDictDTO> queryInfoPointDictList(String groupCode, String projectId, FuncIdQueryDTO funcIdQueryDto) throws Exception {
+        FuncIdUrParam funcIdUrParam = FuncIdUrParam.builder().groupCode(groupCode).projectId(projectId).build();
+        QueryFuncId queryFuncId = QueryFuncId.builder().criteria(funcIdQueryDto).build();
+        DmpResult<JSONArray> dmpResult =  rwdServerClient.queryFuncId(funcIdUrParam, queryFuncId);
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            JSONArray dataArray = dmpResult.getData();
+            if (!CollectionUtils.isEmpty(dataArray)) {
+                List<InfoPointDictDTO> infoPointDictDTOList = dataArray.toJavaList(InfoPointDictDTO.class);
+                //信息点别名覆盖信息点名称
+                infoPointDictDTOList.forEach(o -> o.setName(o.getAliasName()));
+                return infoPointDictDTOList;
+            }
+        }
+        return new ArrayList<>();
+    }
+
+    @Override
+    public JSONArray queryClassInfoList(String groupCode, @NotNull String projectId, Boolean subFlag, @NotNull JacksonCriteria criteria) throws Exception {
+        ClassUrParam classUrParam = ClassUrParam.builder().groupCode(groupCode).projectId(projectId).subFlag(subFlag).build();
+        JSONObject queryParam = JSONObject.parseObject(JacksonMapper.toFormatJson(criteria));
+        DmpResult<JSONArray> dmpResult = rwdServerClient.queryClass(classUrParam, queryParam);
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            JSONArray dataArray = dmpResult.getData();
+            return dataArray;
+        }
+        return new JSONArray();
+    }
+}

+ 60 - 0
src/main/java/com/persagy/dmp/dao/impl/DicDaoImpl.java

@@ -0,0 +1,60 @@
+package com.persagy.dmp.dao.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.json.JacksonMapper;
+import com.persagy.dmp.client.DicServerClient;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.url.DicUrlParam;
+import com.persagy.dmp.constant.RequestUrlConstant;
+import com.persagy.dmp.dao.DicDao;
+import com.persagy.dmp.dto.dict.DictDataDTO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 字典接口实现类
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 15:18
+ * @version: V1.0
+ **/
+@Component
+public class DicDaoImpl implements DicDao {
+
+    private static final Logger logger = LoggerFactory.getLogger(DicDaoImpl.class);
+
+    @Autowired
+    private DicServerClient dicServerClient;
+
+    @Override
+    public List<DictDataDTO> queryDictDataList(String groupCode, String projectId, String type) throws Exception {
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("type", type);
+        return queryDictDataList(groupCode, projectId, criteria);
+    }
+
+    @Override
+    public List<DictDataDTO> queryDictDataList(String groupCode, String projectId, JacksonCriteria criteria) throws Exception {
+        DicUrlParam dicUrlParam = DicUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        DmpResult<JSONArray> dmpResult = dicServerClient.dataQuery(dicUrlParam, JSONObject.parseObject(JacksonMapper.toFormatJson(criteria)));
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            JSONArray dataArray = dmpResult.getData();
+            if (!CollectionUtils.isEmpty(dataArray)) {
+                return dataArray.toJavaList(DictDataDTO.class);
+            }
+        } else {
+            logger.error("字典请求:{},参数:{},返回值:{}", RequestUrlConstant.DICT_QUERY, dmpResult);
+        }
+        return new ArrayList<>();
+    }
+}
+
+

+ 335 - 0
src/main/java/com/persagy/dmp/dao/impl/IOTDaoImpl.java

@@ -0,0 +1,335 @@
+package com.persagy.dmp.dao.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.persagy.dmp.client.RwdServerClient;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.url.IOTUrlParam;
+import com.persagy.dmp.dao.IOTDao;
+import com.persagy.dmp.dto.*;
+import lombok.NonNull;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import javax.validation.constraints.NotNull;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+/**
+ * @description: iot数据接口实现类
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/15 11:58
+ * @version: V1.0
+ **/
+@Component
+public class IOTDaoImpl implements IOTDao {
+
+    @Autowired
+    private RwdServerClient dmpServerClient;
+
+    /**
+     * @description: 查询实时数据
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @param: infoCode 信息点编码
+     * @return: com.persagy.common.dto.CurrentDataDTO
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:12
+     * @version: V1.0
+     */
+    @Override
+    public CurrentDataDTO queryCurrentData(String groupCode, @NotNull String projectId, @NotNull String objectId, @NotNull String infoCode) throws Exception {
+        List<CurrentDataDTO> currentDataDTOList = queryCurrentDataList(groupCode, projectId, objectId, Arrays.asList(infoCode));
+        if (!CollectionUtils.isEmpty(currentDataDTOList)) {
+            return currentDataDTOList.get(0);
+        }
+        return new CurrentDataDTO();
+    }
+
+    /**
+     * @description: 查询实时数据
+     * @param: projectId 项目id
+     * @param: objectIdList 对象列表
+     * @param: infoCode 信息点编码
+     * @return: java.util.List<com.persagy.common.dto.CurrentDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:12
+     * @version: V1.0
+     */
+    @Override
+    public List<CurrentDataDTO> queryCurrentDataList(String groupCode, @NotNull String projectId, @NotNull List<String> objectIdList, @NotNull String infoCode) throws Exception {
+        List<DataQueryDTO> dataQueryDTOList = new ArrayList<>();
+        for (String objectId : objectIdList) {
+            DataQueryDTO dataQueryDto = new DataQueryDTO();
+            dataQueryDto.setObjectId(objectId);
+            dataQueryDto.setInfoCode(infoCode);
+            dataQueryDTOList.add(dataQueryDto);
+        }
+        return queryCurrentDataList(groupCode, projectId, dataQueryDTOList);
+    }
+
+    /**
+     * @description: 查询实时数据
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @param: infoCodeList 信息点编码列表
+     * @return: java.util.List<com.persagy.common.dto.CurrentDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:11
+     * @version: V1.0
+     */
+    @Override
+    public List<CurrentDataDTO> queryCurrentDataList(String groupCode, @NotNull String projectId, @NotNull String objectId, @NotNull List<String> infoCodeList) throws Exception {
+        List<DataQueryDTO> dataQueryDTOList = new ArrayList<>();
+        for (String infoCode : infoCodeList) {
+            DataQueryDTO dataQueryDto = new DataQueryDTO();
+            dataQueryDto.setObjectId(objectId);
+            dataQueryDto.setInfoCode(infoCode);
+            dataQueryDTOList.add(dataQueryDto);
+        }
+        return this.queryCurrentDataList(groupCode, projectId, dataQueryDTOList);
+    }
+
+    /**
+     * @description: 查询实时数据
+     * @param: projectId 项目id
+     * @param: dataQueryDtoList 实时数据参数(对象id、信息点)列表
+     * @return: java.util.List<com.persagy.common.dto.CurrentDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:11
+     * @version: V1.0
+     */
+    private List<CurrentDataDTO> queryIotCurrentDataList(String groupCode, @NonNull String projectId, @NotNull List<DataQueryDTO> dataQueryDTOList) throws Exception {
+        //构建请求url上参数
+        IOTUrlParam iotUrlParam = IOTUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        DmpResult<JSONArray> dmpResult = dmpServerClient.queryIotCurrentData(iotUrlParam, dataQueryDTOList);
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            JSONArray dataArray = dmpResult.getData();
+            if (!CollectionUtils.isEmpty(dataArray)) {
+                return dataArray.toJavaList(CurrentDataDTO.class);
+            }
+        }
+        return new ArrayList<>();
+    }
+
+    @Override
+    public List<CurrentDataDTO> queryCurrentDataList(String groupCode, @NonNull String projectId, @NotNull List<DataQueryDTO> dataQueryDTOList) throws Exception {
+
+        if (CollectionUtils.isEmpty(dataQueryDTOList)) {
+            return new ArrayList<>();
+        }
+
+        int threadCounts = dataQueryDTOList.size() / 100;
+        if (threadCounts == 0) {
+            threadCounts = 1;
+        } else if (threadCounts > 32) {
+            threadCounts = 32;
+        }
+
+        ExecutorService exec = Executors.newFixedThreadPool(threadCounts);
+        List<Callable<List<CurrentDataDTO>>> callList = new ArrayList<Callable<List<CurrentDataDTO>>>();
+
+        //平均分割List
+        int len = dataQueryDTOList.size() / threadCounts;
+        //List中的数量没有线程数多(很少存在)
+        if (len == 0) {
+            //采用一个线程处理List中的一个元素
+            threadCounts = dataQueryDTOList.size();
+            //重新平均分割List
+            len = dataQueryDTOList.size() / threadCounts;
+        }
+
+        for (int i = 0; i < threadCounts; i++) {
+            final List<DataQueryDTO> subList;
+            if (i == threadCounts - 1) {
+                subList = dataQueryDTOList.subList(i * len, dataQueryDTOList.size());
+            } else {
+                subList = dataQueryDTOList.subList(i * len, len * (i + 1) > dataQueryDTOList.size() ? dataQueryDTOList.size() : len * (i + 1));
+            }
+            //采用匿名内部类实现
+            callList.add(() -> IOTDaoImpl.this.queryIotCurrentDataList(groupCode, projectId, subList));
+        }
+
+        List<Future<List<CurrentDataDTO>>> futureList = exec.invokeAll(callList);
+        List<CurrentDataDTO> currentDataDTOList = new ArrayList<>();
+        for (Future<List<CurrentDataDTO>> future : futureList) {
+            List<CurrentDataDTO> subCurrentDataDTOList = future.get();
+            if (!CollectionUtils.isEmpty(subCurrentDataDTOList)) {
+                currentDataDTOList.addAll(subCurrentDataDTOList);
+            }
+        }
+        exec.shutdown();
+
+        return currentDataDTOList;
+    }
+
+    /**
+     * @description: 查询历史数据/分精度数据
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @param: infoCode 信息点编码
+     * @param: startTime 开始时间
+     * @param: endTime 结束时间
+     * @param: period 时间间隔
+     * @return: com.persagy.common.dto.HistoryDataDTO
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:06
+     * @version: V1.0
+     */
+    @Override
+    public HistoryDataDTO queryHistoryDataList(String groupCode, @NotNull String projectId, @NotNull String objectId, @NotNull String infoCode, @NotNull String startTime, String endTime, @NotNull String period) throws Exception {
+        List<HistoryDataDTO> historyDataDTOList = queryHistoryDataList(groupCode, projectId, objectId, Arrays.asList(infoCode), startTime, endTime, period);
+        if (!CollectionUtils.isEmpty(historyDataDTOList)) {
+            return historyDataDTOList.get(0);
+        }
+        return new HistoryDataDTO();
+    }
+
+    /**
+     * @description: 查询历史数据/分精度数据
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @param: infoCodeList 信息点编码列表
+     * @param: startTime 开始时间
+     * @param: endTime 结束时间
+     * @param: period 时间间隔
+     * @return: java.util.List<com.persagy.common.dto.HistoryDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:06
+     * @version: V1.0
+     */
+    @Override
+    public List<HistoryDataDTO> queryHistoryDataList(String groupCode, @NotNull String projectId, @NotNull String objectId, @NotNull List<String> infoCodeList, @NotNull String startTime, String endTime, @NotNull String period) throws Exception {
+        List<DataQueryDTO> dataQueryDTOList = new ArrayList<>();
+        for (String infoCode : infoCodeList) {
+            DataQueryDTO dataQueryDto = new DataQueryDTO();
+            dataQueryDto.setObjectId(objectId);
+            dataQueryDto.setInfoCode(infoCode);
+            dataQueryDTOList.add(dataQueryDto);
+        }
+        return queryHistoryDataList(groupCode, projectId, dataQueryDTOList, startTime, endTime, period);
+    }
+
+    /**
+     * @description: 查询历史数据/分精度数据
+     * @param: projectId 项目id
+     * @param: objectIdList 对象id列表
+     * @param: infoCode 信息点编码
+     * @param: startTime 开始时间
+     * @param: endTime 结束时间
+     * @param: period 时间间隔
+     * @return: java.util.List<com.persagy.common.dto.HistoryDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:05
+     * @version: V1.0
+     */
+    @Override
+    public List<HistoryDataDTO> queryHistoryDataList(String groupCode, @NotNull String projectId, @NotNull List<String> objectIdList, @NotNull String infoCode, @NotNull String startTime, String endTime, String period) throws Exception {
+        List<DataQueryDTO> dataQueryDTOList = new ArrayList<>();
+        for (String objectId : objectIdList) {
+            DataQueryDTO dataQueryDto = new DataQueryDTO();
+            dataQueryDto.setObjectId(objectId);
+            dataQueryDto.setInfoCode(infoCode);
+            dataQueryDTOList.add(dataQueryDto);
+        }
+        return queryHistoryDataList(groupCode, projectId, dataQueryDTOList, startTime, endTime, period);
+    }
+
+    /**
+     * @description: 查询历史数据/分精度数据
+     * @param: projectId 项目id
+     * @param: dataQueryDtoList 查询历史数据的对象id、信息点信息点编码类列表
+     * @param: startTime 开始时间
+     * @param: endTime 结束时间
+     * @param: period 时间间隔 1min、5min、15min、30min、1h、2h、1d
+     * @return: java.util.List<com.persagy.common.dto.HistoryDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:04
+     * @version: V1.0
+     */
+    @Override
+    public List<HistoryDataDTO> queryHistoryDataList(String groupCode, @NotNull String projectId, @NotNull List<DataQueryDTO> dataQueryDTOList, @NotNull String startTime, String endTime, @NotNull String period) throws Exception {
+
+        String newPeriod = period;
+        if ("30min".equals(period)) {
+            newPeriod = "15min";
+        } else if ("2h".equals(period)) {
+            newPeriod = "1h";
+        }
+        //查询历史数据
+        List<HistoryDataDTO> historyDataDTOList = queryHistoryDataList2(groupCode, projectId, dataQueryDTOList, startTime, endTime, newPeriod);
+
+        if (CollectionUtils.isEmpty(historyDataDTOList)) {
+            return new ArrayList<>();
+        }
+        if ("30min".equals(period) || "2h".equals(period)) {
+            for (HistoryDataDTO historyDataDTO : historyDataDTOList) {
+                List<DataTimeDTO> dataTimeDTOList = historyDataDTO.getData();
+                if (CollectionUtils.isEmpty(dataTimeDTOList)) {
+                    continue;
+                }
+                List<DataTimeDTO> newDataTimeDTOList = new ArrayList<>();
+                for (int i = 0; i < dataTimeDTOList.size(); i = i + 2) {
+                    newDataTimeDTOList.add(dataTimeDTOList.get(i));
+                }
+                historyDataDTO.setData(newDataTimeDTOList);
+            }
+
+        }
+        return historyDataDTOList;
+    }
+
+
+    /**
+     * @description: 查询历史数据/分精度数据
+     * @param: projectId 项目id
+     * @param: dataQueryDtoList 查询历史数据的对象id、信息点信息点编码类列表
+     * @param: startTime 开始时间
+     * @param: endTime 结束时间
+     * @param: period 时间间隔 1min、5min、15min、1h、1d
+     * @return: java.util.List<com.persagy.common.dto.HistoryDataDTO>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:04
+     * @version: V1.0
+     */
+    private List<HistoryDataDTO> queryHistoryDataList2(String groupCode, @NonNull String projectId, @NotNull List<DataQueryDTO> dataQueryDTOList, @NotNull String startTime, String endTime, @NotNull String period) throws Exception {
+        //构建请求url上参数
+        IOTUrlParam iotUrlParam = IOTUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+
+        //构建post参数
+        HistoryDataQuery historyDataQuery = HistoryDataQuery.builder().startTime(startTime).endTime(endTime)
+                .period(period).params(dataQueryDTOList).build();
+        DmpResult<JSONArray> dmpResult = dmpServerClient.queryIotHistoryData(iotUrlParam, historyDataQuery);
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            JSONArray dataArray = dmpResult.getData();
+            if (!CollectionUtils.isEmpty(dataArray)) {
+                return dataArray.toJavaList(HistoryDataDTO.class);
+            }
+        }
+        return new ArrayList<>();
+    }
+}

+ 972 - 0
src/main/java/com/persagy/dmp/dao/impl/InstanceDaoImpl.java

@@ -0,0 +1,972 @@
+package com.persagy.dmp.dao.impl;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import javax.validation.constraints.NotNull;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.json.JacksonMapper;
+import com.persagy.dmp.client.RwdServerClient;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.PageResult;
+import com.persagy.dmp.common.url.InstanceUrlParam;
+import com.persagy.dmp.constant.DmpConstant.ObjectBaseInfoCode;
+import com.persagy.dmp.constant.DmpConstant.ObjectQuery;
+import com.persagy.dmp.dao.InstanceDao;
+import com.persagy.dmp.dto.InfoPointDictDTO;
+import com.persagy.dmp.dto.ObjRelationDTO;
+import com.persagy.dmp.dto.RelationFromDTO;
+import com.persagy.dmp.dto.RelationToDTO;
+import com.persagy.dmp.dto.relation.BatchDeleteRelation;
+import com.persagy.dmp.dto.relation.BatchRelationCriteria;
+import com.persagy.dmp.dto.relation.CreateRelation;
+import com.persagy.dmp.dto.relation.DeleteRelation;
+import com.persagy.dmp.dto.relation.QueryRelation;
+import com.persagy.dmp.dto.relation.QueryRelationObject;
+import com.persagy.dmp.dto.relation.RelationCriteria;
+import com.persagy.dmp.dto.relation.RelationCriteriaObject;
+import com.persagy.dmp.enumeration.EnumDataType;
+import com.persagy.dmp.enumeration.EnumGrouping;
+import com.persagy.dmp.enumeration.EnumValid;
+import com.persagy.dmp.service.DictService;
+
+import cn.hutool.core.util.StrUtil;
+import lombok.NonNull;
+
+/**
+ * @description: 物理世界对象、关系实例接口实现类
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/28 15:01
+ * @version: V1.0
+ */
+@Component
+public class InstanceDaoImpl implements InstanceDao {
+
+    @Autowired
+    private RwdServerClient dmpServerClient;
+
+    @Autowired
+    private DictService dictService;
+
+    /**
+     * @description: 查询关系对象
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromId from对象id
+     * @param: toClassCode to对象类型
+     * @param: withColumns 附带对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/6/5 15:56
+     * @version: V1.0
+     */
+    @Override
+    public JSONArray queryRelationObjectByFromId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull String fromId, List<String> toClassCode, List<String> withColumns) throws Exception {
+        return queryRelationObjectByFromIds(groupCode, projectId, graphCode, relCode, Arrays.asList(fromId), toClassCode, withColumns);
+    }
+    
+    @Override
+    public JSONArray queryRelationObjectByFromId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull String fromId, 
+    		String ibmsSceneCode, String ibmsClassCode, List<String> withColumns) throws Exception {
+    	JSONObject objectCriteria = new JSONObject();
+        if (StrUtil.isNotBlank(ibmsSceneCode)) {
+            objectCriteria.put(ObjectBaseInfoCode.IBMS_SCENE_CODE, ibmsSceneCode);
+        }
+        if (StrUtil.isNotBlank(ibmsClassCode)) {
+            objectCriteria.put(ObjectBaseInfoCode.IBMS_CLASS_CODE, ibmsClassCode);
+        }
+        
+        return queryRelationObject(groupCode, projectId, graphCode, relCode, Lists.newArrayList(fromId), null, objectCriteria, withColumns);
+    }
+
+    /**
+     * @description: 查询关系对象
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromIds from对象id列表
+     * @param: toClassCode to对象类型
+     * @param: withColumns 附带对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/6/5 15:56
+     * @version: V1.0
+     */
+    @Override
+    public JSONArray queryRelationObjectByFromIds(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull List<String> fromIds, List<String> toClassCode, List<String> withColumns) throws Exception {
+        return queryRelationObject(groupCode, projectId, graphCode, relCode, fromIds, null, toClassCode, withColumns);
+    }
+
+    /**
+     * @description: 查询关系对象
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromClassCode from对象类型
+     * @param: toId to对象id
+     * @param: withColumns 附带对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/29 11:44
+     * @version: V1.0
+     */
+    @Override
+    public JSONArray queryRelationObjectByToId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, List<String> fromClassCode, @NotNull String toId, List<String> withColumns) throws Exception {
+        return queryRelationObjectByToIds(groupCode, projectId, graphCode, relCode, fromClassCode, Arrays.asList(toId), withColumns);
+    }
+
+    /**
+     * @description: 查询对象关系
+     * @param: groupCode 集团编码
+     * @param: projectId 项目id
+     * @param: graphCode 图类型
+     * @param: relCode 边类型
+     * @param: fromClassCode from对象类型
+     * @param: toId to对象id
+     * @param: withColumns 附带对象信息点(默认只返回id, name, localId, localName, classCode)
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/9/17 14:52
+     * @version: V1.0
+     */
+    @Override
+    public JSONArray queryRelationObjectByToId(String groupCode, String projectId, String graphCode, String relCode, String toId, String ibmsSceneCode, String ibmsClassCode) throws Exception {
+    	InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+    	
+    	RelationCriteriaObject criteriaObject = new RelationCriteriaObject();
+    	criteriaObject.setObjTo(Lists.newArrayList(toId));
+    	criteriaObject.setGraphCode(graphCode);
+    	criteriaObject.setRelCode(relCode);
+    	
+    	JSONObject objectCriteria = new JSONObject();
+    	if (StrUtil.isNotBlank(ibmsSceneCode)) {
+    		objectCriteria.put("ibmsSceneCode", ibmsSceneCode);
+		}
+    	if (StrUtil.isNotBlank(ibmsClassCode)) {
+    		objectCriteria.put("ibmsClassCode", ibmsClassCode);
+		}
+    	criteriaObject.setObjectCriteria(objectCriteria);
+    	
+    	QueryRelationObject queryRelationObject = new QueryRelationObject();
+    	queryRelationObject.setCriteria(criteriaObject);
+    	DmpResult<JSONArray> dmpResult = dmpServerClient.queryRelationObject(objectUrlParam, queryRelationObject);
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            JSONArray data = dmpResult.getData();
+            if (!CollectionUtils.isEmpty(data)) {
+                return data;
+            }
+        } else {
+            throw new Exception("调用中台错误" + dmpResult.getMessage());
+        }
+        return new JSONArray();
+    }
+
+    /**
+     * @description: 查询关系对象
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromClassCode from对象类型
+     * @param: toIds to对象id列表
+     * @param: withColumns 附带对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/29 11:44
+     * @version: V1.0
+     */
+    @Override
+    public JSONArray queryRelationObjectByToIds(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, List<String> fromClassCode, @NotNull List<String> toIds, List<String> withColumns) throws Exception {
+        return queryRelationObject(groupCode, projectId, graphCode, relCode, null, toIds, fromClassCode, withColumns);
+    }
+
+    /**
+     * @description: 查询关系对象
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromId from对象id
+     * @param: toClassCode to对象类型
+     * @param: fromClassCode from 对象类型
+     * @param: toIds to对象id列表
+     * @param: withColumns
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:26
+     * @version: V1.0
+     */
+    private JSONArray queryRelationObject(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, List<String> fromIds, List<String> toIds, List<String> classCode, List<String> withColumns) throws Exception {
+        JSONObject objectCriteria = new JSONObject();
+        if (!CollectionUtils.isEmpty(classCode)) {
+            objectCriteria.put(ObjectBaseInfoCode.CLASS_CODE, classCode);
+        }
+        return queryRelationObject(groupCode, projectId, graphCode, relCode, fromIds, toIds, objectCriteria, withColumns);
+    }
+
+    /**
+     * @description: 查询关系对象(fromIds和toIds只能传一个)
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromIds from对象id
+     * @param: toIds to对象id列表
+     * @param: objectCriteria 查询对象条件
+     * @param: withColumns 查询对象信息点
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/30 10:40
+     * @version: V1.0
+     */
+    @Override
+    public JSONArray queryRelationObject(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, List<String> fromIds, List<String> toIds, JSONObject objectCriteria, List<String> withColumns) throws Exception {
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        RelationCriteriaObject.RelationCriteriaObjectBuilder builder = RelationCriteriaObject.builder();
+        builder.graphCode(graphCode).relCode(relCode);
+        if (!CollectionUtils.isEmpty(fromIds)) {
+            builder.objFrom(fromIds);
+        }
+        if (!CollectionUtils.isEmpty(toIds)) {
+            builder.objTo(toIds);
+        }
+        if (objectCriteria == null) {
+            objectCriteria = new JSONObject();
+        }
+
+        //获取查询条件中的设备类
+        if (objectCriteria.containsKey(ObjectBaseInfoCode.CLASS_CODE)) {
+
+            // 获取查询条件中的设备类
+            List<String> classCode = this.getClassCode(objectCriteria);
+
+            JSONArray resultArr = new JSONArray();
+            if (!CollectionUtils.isEmpty(classCode)) {
+
+                List<String> newClassCode = classCode.stream().filter(o -> !o.contains("&")).collect(Collectors.toList());
+
+                if (!CollectionUtils.isEmpty(newClassCode)) {
+                    objectCriteria.put(ObjectBaseInfoCode.CLASS_CODE, newClassCode);
+
+                    builder.objectCriteria(objectCriteria);
+                    QueryRelationObject queryRelationObject = QueryRelationObject.builder().criteria(builder.build()).build();
+
+                    //如果不传withColumns则查询到的对象默认只返回id, name, localId, localName, classCode
+                    if (!CollectionUtils.isEmpty(withColumns)) {
+                        queryRelationObject.setWithColumns(new HashSet<>(withColumns));
+                    }
+                    resultArr.addAll(queryRelationObject(objectUrlParam, queryRelationObject));
+                }
+
+                List<String> subClassCode = classCode.stream().filter(o -> o.contains("&")).collect(Collectors.toList());
+                if (!CollectionUtils.isEmpty(subClassCode)) {
+                    for (String classCodeStr : subClassCode) {
+                        //把带信息点的classCode拆分成多个条件
+                        objectCriteria.putAll(classCode2Condition(groupCode, projectId, classCodeStr));
+
+                        builder.objectCriteria(objectCriteria);
+                        QueryRelationObject queryRelationObject = QueryRelationObject.builder().criteria(builder.build()).build();
+
+                        //如果不传withColumns则查询到的对象默认只返回id, name, localId, localName, classCode
+                        if (!CollectionUtils.isEmpty(withColumns)) {
+                            queryRelationObject.setWithColumns(new HashSet<>(withColumns));
+                        }
+                        resultArr.addAll(queryRelationObject(objectUrlParam, queryRelationObject));
+
+                        //移除信息点,避免影响下次循环
+                        removeClassCode(classCodeStr, objectCriteria);
+                    }
+                }
+            }
+
+            return resultArr;
+
+        } else {
+
+            builder.objectCriteria(objectCriteria);
+
+            QueryRelationObject queryRelationObject = QueryRelationObject.builder().criteria(builder.build()).build();
+
+            //如果不传withColumns则查询到的对象默认只返回id, name, localId, localName, classCode
+            if (!CollectionUtils.isEmpty(withColumns)) {
+                queryRelationObject.setWithColumns(new HashSet<>(withColumns));
+            }
+
+            return queryRelationObject(objectUrlParam, queryRelationObject);
+        }
+    }
+
+
+    /**
+     * @description: 获取查询条件中的设备类
+     * @param: objectCriteria
+     * @return: java.util.List<java.lang.String>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/20 18:42
+     * @version: V1.0
+     */
+    private List<String> getClassCode(JSONObject objectCriteria) {
+        Object object = objectCriteria.get(ObjectBaseInfoCode.CLASS_CODE);
+        List<String> classCode = null;
+        if (object instanceof String) {
+            classCode = new ArrayList<>();
+            classCode.add(objectCriteria.getString(ObjectBaseInfoCode.CLASS_CODE));
+        } else if (object instanceof Map) {
+            classCode = objectCriteria.getJSONObject(ObjectBaseInfoCode.CLASS_CODE).getJSONArray("$in").toJavaList(String.class);
+        } else if (object instanceof List) {
+            classCode = objectCriteria.getJSONArray(ObjectBaseInfoCode.CLASS_CODE).toJavaList(String.class);
+        }
+        return classCode;
+    }
+
+    /**
+     * @description: 把信息点的classCode拆分成多个条件
+     * @param: classCode
+     * @return: com.alibaba.fastjson.JSONObject
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/20 18:48
+     * @version: V1.0
+     */
+    private JSONObject classCode2Condition(String groupCode, String projectId, String classCode) throws Exception {
+        JSONObject criteria = new JSONObject();
+        if (classCode.contains("&")) {
+            String[] strArr = classCode.split("&");
+            if (strArr != null && strArr.length > 0) {
+                //第一位才是真正的classCode
+                Map<String, InfoPointDictDTO> infoPointDictDTOMap = dictService.queryInfoPointDictMap(groupCode, projectId, strArr[0]);
+                criteria.put(ObjectBaseInfoCode.CLASS_CODE, strArr[0]);
+                //第二位开始是信息点
+                for (int i = 1; i < strArr.length; i++) {
+                    String[] codeValue = strArr[i].split("=");
+                    if (infoPointDictDTOMap.containsKey(codeValue[0])) {
+                        if (EnumDataType.INTEGER.equals(infoPointDictDTOMap.get(codeValue[0]).getDataType())) {
+                            criteria.put(codeValue[0], Integer.valueOf(codeValue[1]));
+                        } else if (EnumDataType.BOOLEAN.equals(infoPointDictDTOMap.get(codeValue[0]).getDataType())) {
+                            criteria.put(codeValue[0], Integer.valueOf(codeValue[1]));
+                        } else if (EnumDataType.DOUBLE.equals(infoPointDictDTOMap.get(codeValue[0]).getDataType())) {
+                            criteria.put(codeValue[0], Double.valueOf(codeValue[1]));
+                        } else {
+                            criteria.put(codeValue[0], codeValue[1]);
+                        }
+                    } else {
+                        criteria.put(codeValue[0], codeValue[1]);
+                    }
+                }
+            }
+        } else {
+            criteria.put(ObjectBaseInfoCode.CLASS_CODE, classCode);
+        }
+        return criteria;
+    }
+
+    /**
+     * @description: 把信息点的classCode拆分成多个条件
+     * @param: classCode
+     * @return: com.alibaba.fastjson.JSONObject
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/20 18:48
+     * @version: V1.0
+     */
+    private void removeClassCode(String classCode, JSONObject criteria) {
+        if (classCode.contains("&")) {
+            String[] strArr = classCode.split("&");
+            if (strArr != null && strArr.length > 0) {
+                //第一位才是真正的classCode
+                //第二位开始是信息点
+                for (int i = 1; i < strArr.length; i++) {
+                    String[] codeValue = strArr[i].split("=");
+                    criteria.remove(codeValue[0]);
+                }
+            }
+        }
+    }
+
+    /**
+     * @description: 查询关系对象
+     * @param: objectUrlParam
+     * @param: queryRelationObject
+     * @return: com.alibaba.fastjson.JSONArray
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/20 17:39
+     * @version: V1.0
+     */
+    private JSONArray queryRelationObject(InstanceUrlParam objectUrlParam, QueryRelationObject queryRelationObject) throws Exception {
+        RelationCriteriaObject relationCriteriaObject = queryRelationObject.getCriteria();
+        if (relationCriteriaObject == null) {
+            relationCriteriaObject = new RelationCriteriaObject();
+        }
+        JSONObject objectCriteria = relationCriteriaObject.getObjectCriteria();
+        //默认查询未被逻辑删除的对象
+        if (objectCriteria != null && !objectCriteria.containsKey(ObjectBaseInfoCode.VALID)) {
+            objectCriteria.put(ObjectBaseInfoCode.VALID, 1);
+        }
+
+        //筛选条件参数 加到withColumns
+        Set<String> withColumns = queryRelationObject.getWithColumns();
+        if (!CollectionUtils.isEmpty(withColumns)) {
+            //筛选条件字段
+            if (objectCriteria != null && !CollectionUtils.isEmpty(objectCriteria.keySet())) {
+                withColumns.addAll(objectCriteria.keySet());
+            }
+        }
+
+        DmpResult<JSONArray> dmpResult = dmpServerClient.queryRelationObject(objectUrlParam, queryRelationObject);
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            JSONArray data = dmpResult.getData();
+            if (!CollectionUtils.isEmpty(data)) {
+                return data;
+            }
+        } else {
+            throw new Exception("调用中台错误" + dmpResult.getMessage());
+        }
+
+        return new JSONArray();
+    }
+
+    /**
+     * @description: 查询关系
+     * @param: projectId 查询关系
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromId from对象id
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:22
+     * @version: V1.0
+     */
+    @Override
+    public List<ObjRelationDTO> queryRelationByFromId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull String fromId) throws Exception {
+        return queryRelationByFromIds(groupCode, projectId, graphCode, relCode, Arrays.asList(fromId));
+    }
+
+    /**
+     * @description: 查询关系
+     * @param: projectId 查询关系
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromIds from对象id列表
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:22
+     * @version: V1.0
+     */
+    @Override
+    public List<ObjRelationDTO> queryRelationByFromIds(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull List<String> fromIds) throws Exception {
+        return queryRelation(groupCode, projectId, graphCode, relCode, fromIds, null);
+    }
+
+    /**
+     * @description: 查询关系
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: toId to对象id
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:21
+     * @version: V1.0
+     */
+    @Override
+    public List<ObjRelationDTO> queryRelationByToId(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull String toId) throws Exception {
+        return queryRelationByToIds(groupCode, projectId, graphCode, relCode, Arrays.asList(toId));
+    }
+
+    /**
+     * @description: 查询关系
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: toIds to对象id列表
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:20
+     * @version: V1.0
+     */
+    @Override
+    public List<ObjRelationDTO> queryRelationByToIds(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, @NotNull List<String> toIds) throws Exception {
+        return queryRelation(groupCode, projectId, graphCode, relCode, null, toIds);
+    }
+
+    /**
+     * @description: 查询关系
+     * @param: projectId 项目id
+     * @param: graphCode 图类型编码
+     * @param: relCode 边类型编码
+     * @param: fromIds from对象id列表
+     * @param: toIds to对象id列表
+     * @return: java.util.List<com.persagy.common.dto.ObjRelationDto>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/8/30 20:19
+     * @version: V1.0
+     */
+    @Override
+    public List<ObjRelationDTO> queryRelation(String groupCode, @NotNull String projectId, @NotNull String graphCode, @NotNull String relCode, List<String> fromIds, List<String> toIds) throws Exception {
+        //关系接口请求url通用参数构建
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        //post参数构建
+        BatchRelationCriteria relationCriteria = BatchRelationCriteria.builder().graphCode(graphCode).relCode(relCode).objFrom(fromIds).objTo(toIds).build();
+        QueryRelation queryRelation = QueryRelation.builder().criteria(relationCriteria).build();
+        DmpResult<JSONArray> dmpResult = dmpServerClient.queryRelation(objectUrlParam, queryRelation);
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            JSONArray data = dmpResult.getData();
+            if (!CollectionUtils.isEmpty(data)) {
+                return data.toJavaList(ObjRelationDTO.class);
+            }
+        }
+        return new ArrayList<>();
+    }
+
+    /**
+     * @description: 创建关系
+     * @param: projectId 项目id
+     * @param: createRelationList 创建关系
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:20
+     * @version: V1.0
+     */
+    @Override
+    public Boolean createRelation(String groupCode, @NotNull String projectId, @NotNull CreateRelation createRelation) {
+        return createRelation(groupCode, projectId, Arrays.asList(createRelation));
+    }
+
+    /**
+     * @description: 批量创建关系
+     * @param: projectId 项目id
+     * @param: createRelationList 创建关系
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:20
+     * @version: V1.0
+     */
+    @Override
+    public Boolean createRelation(String groupCode, @NotNull String projectId, @NotNull List<CreateRelation> createRelationList) {
+        //关系接口请求url通用参数构建
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        //post参数构建
+        DmpResult dmpResult = dmpServerClient.createRelation(objectUrlParam, createRelationList);
+        return dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult());
+    }
+
+    /**
+     * @description: 删除关系
+     * @param: projectId 项目id
+     * @param: criteria 删除关系条件
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:20
+     * @version: V1.0
+     */
+    @Override
+    public Boolean batchDeleteRelation(String groupCode, @NotNull String projectId, @NotNull BatchRelationCriteria criteria) {
+        //关系接口请求url通用参数构建
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        //post参数构建
+        BatchDeleteRelation batchDeleteRelation = BatchDeleteRelation.builder().criteria(criteria).build();
+        DmpResult dmpResult = dmpServerClient.deleteRelation(objectUrlParam, JSONObject.parseObject(batchDeleteRelation.toString()));
+        return dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult());
+    }
+
+    /**
+     * @description: 删除关系
+     * @param: projectId 项目id
+     * @param: criteria 删除关系条件
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:20
+     * @version: V1.0
+     */
+    @Override
+    public Boolean deleteRelation(String groupCode, @NotNull String projectId, @NotNull RelationCriteria criteria) {
+        //关系接口请求url通用参数构建
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        //post参数构建
+        DeleteRelation deleteRelation = DeleteRelation.builder().criteria(criteria).build();
+        DmpResult dmpResult = dmpServerClient.deleteRelation(objectUrlParam, JSONObject.parseObject(deleteRelation.toString()));
+        return dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult());
+    }
+
+    /**
+     * @description: 批量创建对象
+     * @param: projectId 项目id
+     * @param: classCode 对象类型
+     * @param: objectInfo 创建对象信息点
+     * @return: void
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:17
+     * @version: V1.0
+     */
+    @Override
+    public Boolean createObject(String groupCode, String projectId, @NonNull String classCode, JSONObject objectInfo) {
+        objectInfo.put(ObjectBaseInfoCode.CLASS_CODE, classCode);
+        JSONArray objectArr = new JSONArray();
+        objectArr.add(objectInfo);
+        return createObject(groupCode, projectId, objectArr);
+    }
+
+    /**
+     * @description: 批量创建对象
+     * @param: projectId 项目id
+     * @param: objectArr 创建对象列表
+     * @return: void
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:17
+     * @version: V1.0
+     */
+    @Override
+    public Boolean createObject(String groupCode, String projectId, JSONArray objectArr) {
+        //关系接口请求url通用参数构建
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        DmpResult dmpResult = dmpServerClient.createObject(objectUrlParam, objectArr);
+        return dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult());
+    }
+
+    /**
+     * @description: 批量更新对象
+     * @param: projectId 项目id
+     * @param: objectId 更新对象id
+     * @param: objectArr 更新对象信息点
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:16
+     * @version: V1.0
+     */
+    @Override
+    public Boolean updateObject(String groupCode, String projectId, String objectId, JSONObject objectInfo) {
+        objectInfo.put(ObjectBaseInfoCode.ID, objectId);
+        JSONArray objectArr = new JSONArray();
+        objectArr.add(objectInfo);
+        return updateObject(groupCode, projectId, objectArr);
+    }
+
+    /**
+     * @description: 批量更新对象
+     * @param: projectId 项目id
+     * @param: objectArr 更新对象列表
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:16
+     * @version: V1.0
+     */
+    @Override
+    public Boolean updateObject(String groupCode, String projectId, JSONArray objectArr) {
+        //关系接口请求url通用参数构建
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        DmpResult dmpResult = dmpServerClient.updateObject(objectUrlParam, objectArr);
+        return dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult());
+    }
+
+    /**
+     * @description: 删除对象
+     * @param: projectId 项目id
+     * @param: objectId 删除对象id
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:15
+     * @version: V1.0
+     */
+    @Override
+    public Boolean deleteObject(String groupCode, String projectId, String objectId) {
+        //关系接口请求url通用参数构建
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        DmpResult dmpResult = dmpServerClient.deleteObject(objectUrlParam, Arrays.asList(objectId));
+        return dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult());
+    }
+
+    /**
+     * @description: 批量删除对象
+     * @param: projectId 项目id
+     * @param: objectIdList 删除对象id列表
+     * @return: java.lang.Integer
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/10/31 11:15
+     * @version: V1.0
+     */
+    @Override
+    public Boolean deleteObject(String groupCode, String projectId, List<String> objectIdList) {
+        //关系接口请求url通用参数构建
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+        DmpResult dmpResult = dmpServerClient.deleteObject(objectUrlParam, objectIdList);
+        return dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult());
+    }
+
+    /**
+     * @description: 获取对象信息点详情
+     * @param: projectId 项目id
+     * @param: objectId 对象id
+     * @return: com.alibaba.fastjson.JSONObject
+     * @exception:
+     * @author: fenghanchao
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/6/5 17:06
+     * @version: V1.0
+     */
+    @Override
+    public JSONObject queryObjectInfo(String groupCode, @NotNull String projectId, @NotNull String objectId) throws Exception {
+        JSONArray jsonArray = queryObjectList(groupCode, projectId, Arrays.asList(objectId));
+        if (!CollectionUtils.isEmpty(jsonArray)) {
+            return jsonArray.getJSONObject(0);
+        }
+        return new JSONObject();
+    }
+    
+    @Override
+    public JSONObject queryObjectInfo(String groupCode, @NotNull String projectId, String ibmsSceneCode, String ibmsClassCode, @NotNull String objectId) throws Exception {
+    	InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+    	
+    	JSONObject criteria = new JSONObject();
+    	JSONObject objectQueryParam = new JSONObject();
+    	objectQueryParam.put(ObjectBaseInfoCode.IBMS_SCENE_CODE, ibmsSceneCode);
+    	objectQueryParam.put(ObjectBaseInfoCode.IBMS_CLASS_CODE, ibmsClassCode);
+    	objectQueryParam.put(ObjectBaseInfoCode.ID, objectId);
+    	criteria.put(ObjectQuery.CRITERIA, objectQueryParam);
+    	DmpResult<JSONArray> dmpResult = dmpServerClient.queryObject(objectUrlParam, criteria);
+    	if (dmpResult == null || dmpResult.getData() == null || dmpResult.getData().size() == 0) {
+    		return new JSONObject();
+		}
+        return dmpResult.getData().getJSONObject(0);
+    }
+
+    @Override
+    public PageResult<JSONArray> queryObjectList(String groupCode, @NotNull String projectId, @NotNull String classCode, List<String> withColumns) throws Exception {
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add(ObjectBaseInfoCode.CLASS_CODE, classCode);
+        if (!CollectionUtils.isEmpty(withColumns)) {
+            criteria.setWithColumns(new HashSet<>(withColumns));
+        }
+        return queryObjectList(groupCode, projectId, criteria);
+    }
+
+    @Override
+    public PageResult<JSONArray> queryObjectList(String groupCode, @NotNull String projectId, @NotNull String ibmsSceneCode, @NotNull String ibmsClassCode, List<String> withColumns) throws Exception {
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add(ObjectBaseInfoCode.IBMS_SCENE_CODE, ibmsSceneCode);
+        criteria.add(ObjectBaseInfoCode.IBMS_CLASS_CODE, ibmsClassCode);
+        if (!CollectionUtils.isEmpty(withColumns)) {
+            criteria.setWithColumns(new HashSet<>(withColumns));
+        }
+        return queryObjectList(groupCode, projectId, criteria);
+    }
+
+    @Override
+    public JSONArray queryObjectList(String groupCode, @NotNull String projectId, @NotNull List<String> objectIdList) throws Exception {
+        if (CollectionUtils.isEmpty(objectIdList)) {
+            return new JSONArray();
+        }
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add(ObjectBaseInfoCode.ID).in(objectIdList);
+        return queryObjectList(groupCode, projectId, criteria).getData(JSONArray.class);
+    }
+
+    @Override
+    public PageResult<JSONArray> queryObjectList(String groupCode, @NotNull String projectId, @NotNull JacksonCriteria criteria) throws Exception {
+        return queryObjectList(groupCode, projectId, criteria, null, null);
+    }
+
+    @Override
+    public PageResult<JSONArray> queryObjectList(String groupCode, @NotNull String projectId, @NotNull JacksonCriteria criteria, RelationFromDTO relationFromDTO, RelationToDTO relationToDTO) throws Exception {
+        JSONObject objectQueryParam = JSONObject.parseObject(JacksonMapper.toFormatJson(criteria));
+        if (relationFromDTO != null) {
+            JSONObject criteriaJson = objectQueryParam.getJSONObject(ObjectQuery.CRITERIA);
+            if (criteriaJson != null) {
+                criteriaJson.put(ObjectQuery.RELATION_FROM, relationFromDTO);
+            }
+        }
+        if (relationToDTO != null) {
+            JSONObject criteriaJson = objectQueryParam.getJSONObject(ObjectQuery.CRITERIA);
+            if (criteriaJson != null) {
+                objectQueryParam.put(ObjectQuery.RELATION_TO, relationToDTO);
+            }
+        }
+        return queryObjectList(groupCode, projectId, objectQueryParam);
+    }
+
+    @Override
+    public PageResult<JSONArray> queryObjectList(String groupCode, @NotNull String projectId, @NotNull JSONObject criteria) throws Exception {
+        InstanceUrlParam objectUrlParam = InstanceUrlParam.builder().groupCode(groupCode).projectId(projectId).build();
+
+        JSONObject criteriaJson = criteria.getJSONObject(ObjectQuery.CRITERIA);
+
+        if (criteriaJson.containsKey(ObjectBaseInfoCode.CLASS_CODE)) {
+
+            // 获取查询条件中的设备类
+            List<String> classCode = this.getClassCode(criteriaJson);
+
+            PageResult<JSONArray> pageResult = new PageResult<>(new JSONArray(), 0);
+            if (!CollectionUtils.isEmpty(classCode)) {
+                List<String> newClassCode = classCode.stream().filter(o -> !o.contains("&")).collect(Collectors.toList());
+
+                if (!CollectionUtils.isEmpty(newClassCode)) {
+                    criteriaJson.put(ObjectBaseInfoCode.CLASS_CODE, newClassCode);
+                    //查询
+                    pageResult.addAll(queryObjectList(objectUrlParam, criteria));
+                }
+
+                List<String> subClassCode = classCode.stream().filter(o -> o.contains("&")).collect(Collectors.toList());
+                if (!CollectionUtils.isEmpty(subClassCode)) {
+                    for (String classCodeStr : subClassCode) {
+                        //把信息点的classCode拆分成多个条件
+                        criteriaJson.putAll(classCode2Condition(groupCode, projectId, classCodeStr));
+                        //查询
+                        pageResult.addAll(queryObjectList(objectUrlParam, criteria));
+                        //移除信息点,避免影响下次循环
+                        removeClassCode(classCodeStr, criteriaJson);
+                    }
+                }
+            }
+
+            //TODO:可能重新处理分页
+            return pageResult;
+        } else {
+            return queryObjectList(objectUrlParam, criteria);
+        }
+    }
+
+    /**
+     * @description: 查询对象数据
+     * @param: objectUrlParam
+     * @param: criteria
+     * @return: com.persagy.dmp.common.PageResult<com.alibaba.fastjson.JSONArray>
+     * @exception:
+     * @author: xingmaojun
+     * @company: Persagy Technology Co.,Ltd
+     * @since: 2020/12/20 14:48
+     * @version: V1.0
+     */
+    private PageResult<JSONArray> queryObjectList(InstanceUrlParam objectUrlParam, JSONObject criteria) throws Exception {
+
+        JSONObject criteriaJson = criteria.getJSONObject(ObjectQuery.CRITERIA);
+
+        //排序参数,筛选条件参数 加到withColumns
+        JSONArray withColumns = criteria.getJSONArray(ObjectQuery.WITH_COLUMNS);
+        if (!CollectionUtils.isEmpty(withColumns)) {
+
+            //筛选条件字段
+            if (criteriaJson != null && !CollectionUtils.isEmpty(criteriaJson.keySet())) {
+                withColumns.addAll(criteriaJson.keySet());
+            }
+
+            //排序字段
+            JSONArray orders = criteria.getJSONArray(ObjectQuery.ORDERS);
+            if (!CollectionUtils.isEmpty(orders)) {
+                for (Object order : orders) {
+                    withColumns.add(((JSONObject) order).getString(ObjectQuery.COLUMN));
+                }
+            }
+        } else {
+            criteriaJson.remove(ObjectQuery.WITH_COLUMNS);
+        }
+
+        //默认查询未被逻辑删除的对象(根据id查询除外)
+        if (criteriaJson != null && !criteriaJson.containsKey(ObjectBaseInfoCode.ID)) {
+            if (!criteriaJson.containsKey(ObjectBaseInfoCode.VALID)) {
+                criteriaJson.put(ObjectBaseInfoCode.VALID, EnumValid.TRUE.getValue());
+            }
+            //默认值查询对象,不查询编组
+            if (!criteriaJson.containsKey(ObjectBaseInfoCode.GROUPING)) {
+                criteriaJson.put(ObjectBaseInfoCode.GROUPING, EnumGrouping.OBJECT.getValue());
+            }
+        }
+
+        // 默认采用分页查询,防止feign调用超时
+        if (criteria.getInteger("size") == null) {
+        	criteria.put("size", 500);
+        	criteria.put("page", 1);
+        	JSONArray result = new JSONArray();
+        	this.queryPageObjects(result, objectUrlParam, criteria);
+        	return new PageResult<>(result, result.size());
+		}
+        DmpResult<JSONArray> dmpResult = dmpServerClient.queryObject(objectUrlParam, criteria);
+
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            return new PageResult<>(dmpResult.getData(), dmpResult.getCount());
+        } else {
+            throw new Exception("调用中台错误" + dmpResult.getMessage());
+        }
+    }
+    
+	/**
+	 * 分页查询信息点定义数据
+	 * 
+	 * @param all
+	 * @param queryCriteria
+	 * @param groupCode
+	 * @param projectId
+	 * @throws Exception 
+	 */
+	private void queryPageObjects(JSONArray datArrays, InstanceUrlParam objectUrlParam, JSONObject criteria) throws Exception {
+		DmpResult<JSONArray> dmpResult = dmpServerClient.queryObject(objectUrlParam, criteria);
+		if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+			Integer count = dmpResult.getCount();
+			JSONArray jsonArray = dmpResult.getData();
+			if (count == null || jsonArray == null || jsonArray.size() == 0) {
+				return;
+			}
+			
+			datArrays.addAll(jsonArray);
+			
+			if (count < criteria.getIntValue("size")) {
+				return;
+			} else {
+				criteria.put("page", criteria.getIntValue("page") + 1);
+				this.queryPageObjects(datArrays, objectUrlParam, criteria);
+			}
+        } else {
+            throw new Exception("调用中台错误" + dmpResult.getMessage());
+        }
+	}
+}

+ 102 - 0
src/main/java/com/persagy/dmp/dao/impl/OrgDaoImpl.java

@@ -0,0 +1,102 @@
+package com.persagy.dmp.dao.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.common.criteria.JacksonCriteria;
+import com.persagy.common.json.JacksonMapper;
+import com.persagy.dmp.client.OrgServerClient;
+import com.persagy.dmp.common.DmpResult;
+import com.persagy.dmp.common.url.DicUrlParam;
+import com.persagy.dmp.constant.CommonConstant;
+import com.persagy.dmp.dao.OrgDao;
+import com.persagy.dmp.entity.User;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author LuoGuangyi
+ * @version 1.0.0
+ * @Description 人员组织权限
+ * @ClassName OrgDaoImpl.java
+ * @createTime 2021/01/13 13:03
+ * @Since
+ */
+@Component
+@Slf4j
+public class OrgDaoImpl implements OrgDao {
+
+    @Autowired
+    private OrgServerClient  orgServerClient;
+
+    /**
+     * @param dicUrlParam: 中台URL参数
+     * @param userIds:     用户Id集合
+     * @description: 根据用户id批量查询用户姓名
+     * @author: LuoGuangyi
+     * @createTime: 2021/01/13 13:19
+     * @return: java.util.List<com.persagy.dmp.entity.User>
+     * @expression
+     */
+    @Override
+    public List<User> queryUserList(DicUrlParam dicUrlParam, List<String> userIds) throws Exception {
+        JacksonCriteria criteria = JacksonCriteria.newInstance();
+        criteria.add("id", userIds);
+        JSONObject param = JSONObject.parseObject(JacksonMapper.toFormatJson(criteria));
+        DmpResult<JSONArray> dmpResult = orgServerClient.queryUser(dicUrlParam, param);
+        if (dmpResult != null && DmpResult.SUCCESS.equalsIgnoreCase(dmpResult.getResult())) {
+            JSONArray dataArray = dmpResult.getData();
+            if (CollectionUtil.isNotEmpty(dataArray)) {
+                return dataArray.toJavaList(User.class);
+            }
+        }
+        return new ArrayList<>();
+    }
+
+    /**
+     * @param dicUrlParam: 中台URL参数
+     * @param userIds:     用户Id集合
+     * @description: 根据用户Id批量查询用户<id, name>的map
+     * @author: LuoGuangyi
+     * @createTime: 2021/01/13 13:20
+     * @return: java.util.Map<java.lang.String, java.lang.String>
+     * @expression
+     */
+    @Override
+    public Map<String, String> queryUserMap(DicUrlParam dicUrlParam, List<String> userIds) throws Exception {
+        List<User> users = queryUserList(dicUrlParam, userIds);
+        Map<String, String> userIdNameMap = users.stream().collect(Collectors.toMap(User::getId, User::getName));
+        userIdNameMap.put(CommonConstant.SYSTEM_ID, CommonConstant.SYSTEM_NAME);
+        return userIdNameMap;
+    }
+
+    /**
+     * @param dicUrlParam:
+     * @param userIds:
+     * @description: 查询用户列表,只保留用户ID和名称
+     * @author: LuoGuangyi
+     * @createTime: 2021/02/03 15:26
+     * @return: java.util.List<com.persagy.dmp.entity.User>
+     * @expression
+     */
+    @Override
+    public List<User> queryUserIdNameList(DicUrlParam dicUrlParam, List<String> userIds) throws Exception {
+        List<User> users = queryUserList(dicUrlParam, userIds);
+        users = users.stream().map(item -> {
+            User user = new User();
+            user.setId(item.getId());
+            user.setName(item.getName());
+            return user;
+        }).collect(Collectors.toList());
+        return users;
+    }
+
+}
+
+

+ 38 - 0
src/main/java/com/persagy/dmp/dto/CategoryDTO.java

@@ -0,0 +1,38 @@
+package com.persagy.dmp.dto;
+
+import lombok.Data;
+
+/**
+ * @description: 设备类型
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/9/24 11:10
+ * @version: V1.0
+ **/
+@Data
+public class CategoryDTO {
+    //设备类型编码
+    private String categoryCode;
+    //设备类型名称
+    private String categoryName;
+    //设备类型别编码
+    private String categoryAliasCode;
+    //设备类型别名
+    private String categoryAliasName;
+    //系统编码
+    private String systemCode;
+    //系统名称
+    private String systemName;
+    //系统别编码
+    private String systemAliasCode;
+    //系统别名
+    private String systemAliasName;
+    //专业编码
+    private String majorCode;
+    //专业名称
+    private String majorName;
+    //专业别编码
+    private String majorAliasCode;
+    //专业别名
+    private String majorAliasName;
+}

+ 40 - 0
src/main/java/com/persagy/dmp/dto/ClassInfo.java

@@ -0,0 +1,40 @@
+package com.persagy.dmp.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @description: 可实例化的类
+ * @author: shiliqiang
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/10/11 14:55
+ * @version: V1.0
+ */
+
+@Data
+public class ClassInfo {
+    private String id;
+    private String code;
+    /*
+     *对象类型:equipment、building、floor、system
+     */
+    private String objType;
+    private String name;
+    private String aliasCode;
+    private String aliasName;
+    private String type;
+    private String groupCode;
+    private String projectId;
+    private String majorCode;
+    private String systemCode;
+    private String parentCode;
+
+
+    private String ibmsSceneCode;
+    private String ibmsClassCode;
+
+
+
+    private List<ClassInfo> children;
+}

+ 58 - 0
src/main/java/com/persagy/dmp/dto/CurrentDataDTO.java

@@ -0,0 +1,58 @@
+package com.persagy.dmp.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author feng
+ * @version 1.0
+ * @description 实时数据
+ * @since 2020/5/29 10:45
+ */
+@Data
+public class CurrentDataDTO implements Serializable {
+
+    private static final long serialVersionUID = -3852968434771523519L;
+
+    /**
+     * 对象id
+     */
+    private String objectId;
+
+    /**
+     * 信息点编码
+     */
+    private String infoCode;
+
+    /**
+     * 信息点值
+     */
+    private String infoValue;
+
+    /**
+     * 时间
+     */
+    private String time;
+
+    /**
+     * 数据值
+     */
+    private BigDecimal data;
+
+    /**
+     * 表号
+     */
+    private String meter;
+
+    /**
+     * 功能号
+     */
+    private String function;
+
+    /**
+     * 错误信息
+     */
+    private String error;
+}

+ 25 - 0
src/main/java/com/persagy/dmp/dto/DataQueryDTO.java

@@ -0,0 +1,25 @@
+package com.persagy.dmp.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @description: 实时数据、历史数据查询类
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/8/30 18:17
+ * @version: V1.0
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class DataQueryDTO {
+
+    //对象id
+    private String objectId;
+
+    //信息点编码
+    private String infoCode;
+
+}

+ 29 - 0
src/main/java/com/persagy/dmp/dto/DataTimeDTO.java

@@ -0,0 +1,29 @@
+package com.persagy.dmp.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+
+/**
+ * @description: 历史数据
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/8/30 18:17
+ * @version: V1.0
+ **/
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class DataTimeDTO {
+
+    //时间
+    private String time;
+
+    //数值
+    private BigDecimal data;
+}

+ 32 - 0
src/main/java/com/persagy/dmp/dto/DeptJobId.java

@@ -0,0 +1,32 @@
+package com.persagy.dmp.dto;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @description: 人员部门岗位
+ * @author:LuoGuangyi
+ * @company:PersagyTechnologyCo.,Ltd
+ * @since:2020/12/10 16:12
+ * @version:V1.0
+ **/
+@Data
+@NoArgsConstructor
+public class DeptJobId {
+    /**
+     * 部门实例id
+     */
+    private String deptId;
+    /**
+     * 部门实例名称
+     */
+    private String deptName;
+    /**
+     * 岗位分类编码
+     */
+    private String jobClassifyCode;
+    /**
+     * 岗位分类名称
+     */
+    private String jobClassifyName;
+}

+ 58 - 0
src/main/java/com/persagy/dmp/dto/EquipBelongModularDTO.java

@@ -0,0 +1,58 @@
+package com.persagy.dmp.dto;
+
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+/**
+ * @Description:
+ * @Author:Sarah
+ * @Data:
+ * @Version: 设备所属模块
+ */
+@Data
+@NoArgsConstructor
+public class EquipBelongModularDTO extends LocationDTO{
+
+    //设备id
+    private String equipId;
+
+    //项目id
+    private String projectId;
+
+    //所属模块 id
+    private String belongModularId;
+
+    //所属模块名称
+    private String belongModularName;
+
+    //所属模块编码
+    private String belongModularCode;
+
+    //所属配电箱id
+    private String belongPowerBoxId;
+
+    //所属配电箱名称
+    private String belongPowerBoxName;
+
+    //所属配电箱编码
+    private String belongPowerBoxCode;
+
+    //楼层id
+    private String floorId;
+
+    //楼层code
+    private String floorCode;
+
+    //楼层name
+    private String floorName;
+
+    //电井ID
+    private String powerWellsId;
+
+    //电井Code
+    private String powerWellsCode;
+
+    //电井名称
+    private String powerWellsName;
+
+}

+ 57 - 0
src/main/java/com/persagy/dmp/dto/EquipLocationDTO.java

@@ -0,0 +1,57 @@
+package com.persagy.dmp.dto;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @description: 设备位置
+ * @author: xingmaojun
+ * @company: Persagy Technology Co.,Ltd
+ * @since: 2020/9/16 16:53
+ * @version: V1.0
+ **/
+@Data
+@NoArgsConstructor
+public class EquipLocationDTO extends LocationDTO{
+
+    private static final long serialVersionUID = 1L;
+
+    //设备id
+    private String equipId;
+
+    //项目id
+    private String projectId;
+
+    //建筑id
+    private String buildId;
+
+    //建筑名称
+    private String buildName;
+
+    //建筑编码
+    private String buildCode;
+
+    //楼层id
+    private String floorId;
+
+    //楼层名称
+    private String floorName;
+
+    //楼层编码
+    private String floorCode;
+
+    //空间id
+    private String spaceId;
+
+    //空间名称
+    private String spaceName;
+
+    //空间编码
+    private String spaceCode;
+
+    @Override
+    public String toString() {
+        return JSONObject.toJSONString(this);
+    }
+}

+ 0 - 0
src/main/java/com/persagy/dmp/dto/FuncIdQueryDTO.java


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