commit 9cda928880cd91f9126f07dcc46de8cc9e6eaf4a Author: liuguijing <123456> Date: Fri Nov 24 15:05:49 2023 +0800 I2代码提交 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000..cb28b0e Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..5f0536e --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..66df285 --- /dev/null +++ b/mvnw @@ -0,0 +1,308 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.2.0 +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "$(uname)" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && + JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then + if $darwin ; then + javaHome="$(dirname "\"$javaExecutable\"")" + javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" + else + javaExecutable="$(readlink -f "\"$javaExecutable\"")" + fi + javaHome="$(dirname "\"$javaExecutable\"")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=$(cd "$wdir/.." || exit 1; pwd) + fi + # end of workaround + done + printf '%s' "$(cd "$basedir" || exit 1; pwd)" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' < "$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR +log "$MAVEN_PROJECTBASEDIR" + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" +else + log "Couldn't find $wrapperJarPath, downloading it ..." + + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + fi + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; + esac + done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget > /dev/null; then + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + fi + else + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + log " - Compiling MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; + esac +done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# shellcheck disable=SC2086 # safe args +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..95ba6f5 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,205 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.2.0 +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..59eb97f --- /dev/null +++ b/pom.xml @@ -0,0 +1,193 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.5.6 + + + com.shxy + i2 + 0.0.1-SNAPSHOT + i2 + Demo project for Spring Boot + + 1.8 + 1.0.0 + UTF-8 + 2.5.6 + 3.0.0 + 3.0.2 + 1.5.21 + 1.5.21 + 1.2.79 + 1.2.8 + 2.2.0 + 1.4.0 + 1.4 + 0.9.0 + 3.2.0 + 3.2.1 + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot-dependencies.version} + pom + + + + + org.springframework.boot + spring-boot-starter-aop + + + org.slf4j + slf4j-log4j12 + + + org.springframework.boot + spring-boot-starter-logging + + + ch.qos.logback + logback-classic + + + + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + ${mybatis-spring-boot.version} + + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + + mysql + mysql-connector-java + 8.0.27 + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + + + org.projectlombok + lombok + + + + org.springframework.boot + spring-boot-starter-log4j2 + + + + org.apache.logging.log4j + log4j-web + + + + org.apache.commons + commons-lang3 + + + + commons-codec + commons-codec + 1.11 + + + + + cn.hutool + hutool-all + 5.7.20 + + + + + + + + + + + + + + org.apache.cxf + cxf-rt-frontend-jaxws + 3.5.5 + + + + + + + + + + org.apache.cxf + cxf-rt-transports-http + 3.2.5 + + + + org.springframework.boot + spring-boot-starter-test + + + org.slf4j + slf4j-log4j12 + + + org.springframework.boot + spring-boot-starter-logging + + + ch.qos.logback + logback-classic + + + test + + + + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.5 + + + + org.springframework.boot + spring-boot-maven-plugin + + + paketobuildpacks/builder-jammy-base:latest + + + + + + + diff --git a/src/main/java/com/shxy/i2/GenerateXml.java b/src/main/java/com/shxy/i2/GenerateXml.java new file mode 100644 index 0000000..4b01d26 --- /dev/null +++ b/src/main/java/com/shxy/i2/GenerateXml.java @@ -0,0 +1,778 @@ +package com.shxy.i2; + +import com.shxy.i2.entity.Data_SF6_Qtyl; +import com.shxy.i2.entity.Niec_Sensors; + +import java.io.IOException; +import java.io.StringReader; +import java.util.TreeMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class GenerateXml { + +// //解析xml +// public static TreeMap xmlElements(String xmlDoc) throws JDOMException, IOException { +// if (xmlDoc!=null && !xmlDoc.equals("")) { +// Pattern p = Pattern.compile("\r|\n"); +// Matcher m = p.matcher(xmlDoc); +// xmlDoc = m.replaceAll(""); +// }//创建一个新的字符串 +// StringReader read = new StringReader(xmlDoc); +// //创建新的输入源SAX 解析器将使用 InputSource 对象来确定如何读取 XML 输入 +// InputSource source = new InputSource(read); +// //创建一个新的SAXBuilder +// SAXBuilder sb = new SAXBuilder(); +// TreeMap rtnMap = new TreeMap(); +// SAXBuilder builder = new SAXBuilder(); +// Document doc = (Document) builder.build(new StringReader(xmlDoc)); +// // 得到根节点 +// Element root = doc.getRootElement(); +// String rootName = root.getName(); +// rtnMap.put("root.name", rootName); +// // 调用递归函数,得到所有最底层元素的名称和值,加入map中 +// convert(root, rtnMap, rootName); +// return rtnMap; +// } +// public static void convert(Element e, Map map, String lastname) { +// if (e.getAttributes().size() > 0) { +// Iterator it_attr = e.getAttributes().iterator(); +// while (it_attr.hasNext()) { +// Attribute attribute = (Attribute) it_attr.next(); +// String attrname = attribute.getName(); +// String attrvalue = e.getAttributeValue(attrname); +// // map.put( attrname, attrvalue); +// map.put(lastname + "." + attrname, attrvalue); // key 根据根节点 进行生成 +// } +// } +// List children = e.getChildren(); +// Iterator it = children.iterator(); +// while (it.hasNext()) { +// Element child = (Element) it.next(); +// /* String name = lastname + "." + child.getName(); */ +// String name = child.getName(); +// // 如果有子节点,则递归调用 +// if (child.getChildren().size() > 0) { +// convert(child, map, lastname + "." + child.getName()); +// } else { +// // 如果没有子节点,则把值加入map +// map.put(name, child.getText()); +// // 如果该节点有属性,则把所有的属性值也加入map +// if (child.getAttributes().size() > 0) { +// Iterator attr = child.getAttributes().iterator(); +// while (attr.hasNext()) { +// Attribute attribute = (Attribute) attr.next(); +// String attrname = attribute.getName(); +// String attrvalue = child.getAttributeValue(attrname); +// map.put(lastname + "." + child.getName() + "." + attrname, attrvalue); +// } +// } +// } +// } +// } + + // 变压器/电抗器断路器局部放电 + public static String createCACData_byq_pd_h(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //油色谱 + public static String createCACData_YSP(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_YSP2(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_YSP3(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //微水接入 + public static String createCACData_Moisture(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021003 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //铁芯 + public static String createCACData_tx(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021004 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //顶层油 + public static String createCACData_yw(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021005 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //金属氧化物避雷器绝缘监测· + public static String createCACData_moa(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "023001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_eaif(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue, String code) { + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "" + code + " "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //电容型设备绝缘监测 + public static String createCACData_eia(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "022001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //SF6气体压力 + public static String createCACData_sf6pressure(String cacid, String sensorid, String equipmentid, String timestamp, String phase, Data_SF6_Qtyl item) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "024004 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + if (phase != null) { + cacdata += " "; + } + Float temperature = item.getTemperature(); + if (temperature != null) { + cacdata += " "; + } + Float absolutepressure = item.getAbsolutepressure(); + if (absolutepressure != null) { + cacdata += " "; + } + Float density = item.getDensity(); + if (density != null) { + cacdata += " "; + } + Float pressure20c = item.getPressure20c(); + if (pressure20c != null) { + cacdata += " "; + } + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //SF6 气体水分 + public static String createCACData_sf6moisture(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024005 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + + public static String createCACData_mlh(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "" + code + " "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_dmh(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "025001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //断路器局部放电 + public static String createCACData_pd_h(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "024001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //分合闸线圈电流波形 + public static String createCACData_DLQWave(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //负荷电流波形接 + public static String createCACData_FHDLQWave(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + + public static String createCACData_KGG(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "026001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_TMT(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "026002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_TMT1(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021012 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_sf6env(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024009 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_scur(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue, String code) { //电缆环流 + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "" + code + " "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_jdw(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue, String code) { //接地网 + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "" + code + " "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + + public static String test(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue, String code) { //接地网 + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "" + code + " "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //储能点机 + public static String createCACData_DLQChargeTime(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024006 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_environment(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_center(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_noise(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_ampli(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_ampli_day_rate(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_day_rate(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + +} diff --git a/src/main/java/com/shxy/i2/GenerateXmlbak.java b/src/main/java/com/shxy/i2/GenerateXmlbak.java new file mode 100644 index 0000000..8496eec --- /dev/null +++ b/src/main/java/com/shxy/i2/GenerateXmlbak.java @@ -0,0 +1,770 @@ +package com.shxy.i2; + +public class GenerateXmlbak { + +// //解析xml +// public static TreeMap xmlElements(String xmlDoc) throws JDOMException, IOException { +// if (xmlDoc!=null && !xmlDoc.equals("")) { +// Pattern p = Pattern.compile("\r|\n"); +// Matcher m = p.matcher(xmlDoc); +// xmlDoc = m.replaceAll(""); +// }//创建一个新的字符串 +// StringReader read = new StringReader(xmlDoc); +// //创建新的输入源SAX 解析器将使用 InputSource 对象来确定如何读取 XML 输入 +// InputSource source = new InputSource(read); +// //创建一个新的SAXBuilder +// SAXBuilder sb = new SAXBuilder(); +// TreeMap rtnMap = new TreeMap(); +// SAXBuilder builder = new SAXBuilder(); +// Document doc = (Document) builder.build(new StringReader(xmlDoc)); +// // 得到根节点 +// Element root = doc.getRootElement(); +// String rootName = root.getName(); +// rtnMap.put("root.name", rootName); +// // 调用递归函数,得到所有最底层元素的名称和值,加入map中 +// convert(root, rtnMap, rootName); +// return rtnMap; +// } +// public static void convert(Element e, Map map, String lastname) { +// if (e.getAttributes().size() > 0) { +// Iterator it_attr = e.getAttributes().iterator(); +// while (it_attr.hasNext()) { +// Attribute attribute = (Attribute) it_attr.next(); +// String attrname = attribute.getName(); +// String attrvalue = e.getAttributeValue(attrname); +// // map.put( attrname, attrvalue); +// map.put(lastname + "." + attrname, attrvalue); // key 根据根节点 进行生成 +// } +// } +// List children = e.getChildren(); +// Iterator it = children.iterator(); +// while (it.hasNext()) { +// Element child = (Element) it.next(); +// /* String name = lastname + "." + child.getName(); */ +// String name = child.getName(); +// // 如果有子节点,则递归调用 +// if (child.getChildren().size() > 0) { +// convert(child, map, lastname + "." + child.getName()); +// } else { +// // 如果没有子节点,则把值加入map +// map.put(name, child.getText()); +// // 如果该节点有属性,则把所有的属性值也加入map +// if (child.getAttributes().size() > 0) { +// Iterator attr = child.getAttributes().iterator(); +// while (attr.hasNext()) { +// Attribute attribute = (Attribute) attr.next(); +// String attrname = attribute.getName(); +// String attrvalue = child.getAttributeValue(attrname); +// map.put(lastname + "." + child.getName() + "." + attrname, attrvalue); +// } +// } +// } +// } +// } + + // 变压器/电抗器断路器局部放电 + public static String createCACData_byq_pd_h(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue,String code) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //油色谱 + public static String createCACData_YSP(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_YSP2(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + public static String createCACData_YSP3(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //微水接入 + public static String createCACData_Moisture(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021003 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //铁芯 + public static String createCACData_tx(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue){ + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021004 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //顶层油 + public static String createCACData_yw(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021005 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //金属氧化物避雷器绝缘监测· + public static String createCACData_moa(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue){ + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "023001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + public static String createCACData_eaif(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue,String code){ + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "" + code + " "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //电容型设备绝缘监测 + public static String createCACData_eia(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue){ + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "022001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //SF6气体压力 + public static String createCACData_sf6pressure(String cacid, String sensorid, String equipmentid, String timestamp,String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "024004 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //SF6 气体水分 + public static String createCACData_sf6moisture(String cacid, String sensorid, String equipmentid, String timestamp,String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024005 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + + public static String createCACData_mlh(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue,String code) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""+code+" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + public static String createCACData_dmh(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "025001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //断路器局部放电 + public static String createCACData_pd_h(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue,String code) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "024001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + //分合闸线圈电流波形 + public static String createCACData_DLQWave(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + //负荷电流波形接 + public static String createCACData_FHDLQWave(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + + + public static String createCACData_KGG(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "026001 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + public static String createCACData_TMT(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "026002 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + public static String createCACData_TMT1(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "021012 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + public static String createCACData_sf6env(String cacid, String sensorid, String equipmentid, String timestamp,String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024009 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + public static String createCACData_scur(String cacid, String sensorid, String equipmentid, String timestamp, String phase,String[][] datavalue,String code) + { //电缆环流 + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""+ code +" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + public static String createCACData_jdw(String cacid, String sensorid, String equipmentid, String timestamp, String phase,String[][] datavalue,String code) + { //接地网 + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""+ code +" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + + public static String test(String cacid, String sensorid, String equipmentid, String timestamp, String phase,String[][] datavalue,String code) + { //接地网 + String cacdata = ""; + cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""+ code +" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + //储能点机 + public static String createCACData_DLQChargeTime(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) + { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + //A相 + cacdata += " "; + cacdata += "024006 "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_environment(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_center(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_noise(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_ampli(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_ampli_day_rate(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + static String createSJZDData_day_rate(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) { + String cacdata = ""; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += "\"" + code + "\" "; + cacdata += "" + equipmentid + " "; + cacdata += "" + timestamp + " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += " "; + cacdata += ""; + cacdata += " "; + cacdata += " "; + return cacdata; + } + + + + +} diff --git a/src/main/java/com/shxy/i2/I2Application.java b/src/main/java/com/shxy/i2/I2Application.java new file mode 100644 index 0000000..aa34ea9 --- /dev/null +++ b/src/main/java/com/shxy/i2/I2Application.java @@ -0,0 +1,32 @@ +package com.shxy.i2; + +import lombok.extern.slf4j.Slf4j; +//import org.mybatis.spring.annotation.MapperScan; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; + +@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) +//@SpringBootApplication +@MapperScan("com.shxy.i2.dao") +@EnableAspectJAutoProxy(exposeProxy = true) +@Slf4j +@EnableConfigurationProperties +@ComponentScan(basePackages = {"com.shxy"}) +@EnableCaching +@EnableAsync +public class I2Application { + + public static void main(String[] args) { + SpringApplication.run(I2Application.class, args); + log.info("系统启动"); + } + +} diff --git a/src/main/java/com/shxy/i2/Tool/AsyncMethod.java b/src/main/java/com/shxy/i2/Tool/AsyncMethod.java new file mode 100644 index 0000000..f85bb4a --- /dev/null +++ b/src/main/java/com/shxy/i2/Tool/AsyncMethod.java @@ -0,0 +1,207 @@ +package com.shxy.i2.Tool; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.XML; +import com.shxy.i2.bean.SendDataBean; +import com.shxy.i2.constant.CommonStatus; +import com.shxy.i2.constant.Constant; +import com.shxy.i2.dao.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.cxf.endpoint.Client; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Slf4j +@Component +public class AsyncMethod { + @Autowired + private Data_Dlq_JbfdDao data_dlq_jbfdDao; + + @Autowired + private Data_Byq_JbfdDao data_byq_jbfdDao; + + @Autowired + private Data_SF6_QtylDao data_sf6_qtylDao; + + @Autowired + private Data_YspDao data_yspDao; + + @Autowired + private Data_WsDao data_wsDao; + + @Autowired + private Data_TxDao data_txDao; + + @Autowired + private Data_DcywDao data_dcywDao; + + @Autowired + private Data_Dr_JyjcDao data_dr_jyjcDao; + + @Autowired + private Data_Jsyhw_JyjcDao data_jsyhw_jyjcDao; + + @Autowired + private Data_FhzxqDao data_fhzxqDao; + + @Autowired + private Data_FhdlbxDao data_fhdlbxDao; + + @Autowired + private Data_SF6_QtsfDao data_sf6_qtsfDao; + + @Autowired + private Data_MicroclimateDao data_microclimateDao; + + @Autowired + private Data_CnjDao data_cnjDao; + + + @Async(value = "asyncServiceExecutor") + public void sendData(Client client, List idlist, String xml, String type) throws Exception { + Object[] objects = client.invoke("uploadCACData", xml); + String threadId = Thread.currentThread().getName(); + log.info("线程序号: " + threadId + "当前时间:" + new Date()); + if (objects != null && objects.length > 0) { + String string = String.valueOf(objects[0]); + log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); + JSONObject jsonObject = XML.toJSONObject(string); + if (jsonObject != null) { + JSONObject response = (JSONObject) jsonObject.get("response"); + if (response != null) { + JSONObject result = (JSONObject) response.get("result"); + if (result != null) { + Integer code = (Integer) result.get("code"); + if (code != null && code.intValue() == 0) { + log.info("上传成功"); + log.info("修改的id: " + idlist.toString()); + if (CollectionUtil.isNotEmpty(idlist)) { + if (StrUtil.equals(type, Constant.SF6_QTYL)) { + data_sf6_qtylDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.BYQ_JBFD)) { + data_byq_jbfdDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.DLQJBFD)) { + data_dlq_jbfdDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.YSP)) { + data_yspDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.WS)) { + data_wsDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.TX)) { + data_txDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.DCYW)) { + data_dcywDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.DRJYJC)) { + data_dr_jyjcDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.JSYHW)) { + data_jsyhw_jyjcDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.FHZXQ)) { + data_fhzxqDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.FHDLBX)) { + data_fhdlbxDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.CNJ)) { + data_cnjDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.SF6_QTSF)) { + data_sf6_qtsfDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.WQX)) { + data_microclimateDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } + + + } + } else { + log.info("上传失败"); + } + } + } + } + } + } + + + @Async(value = "asyncServiceExecutor") + public void sendJBFDData(Client client, ArrayList idlist, String xml, String type) throws Exception { + Object[] objects = client.invoke("uploadCACData", xml); + String threadId = Thread.currentThread().getName(); + log.info("线程序号: " + threadId + "当前时间:" + new Date()); +// log.info("上传的数据: " + xml); + if (objects != null && objects.length > 0) { + String string = String.valueOf(objects[0]); + log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); + JSONObject jsonObject = XML.toJSONObject(string); + if (jsonObject != null) { + JSONObject response = (JSONObject) jsonObject.get("response"); + if (response != null) { + JSONObject result = (JSONObject) response.get("result"); + if (result != null) { + Integer code = (Integer) result.get("code"); + if (code != null && code.intValue() == 0) { + log.info("上传成功"); + log.info("修改的id: " + idlist.toString()); + if (CollectionUtil.isNotEmpty(idlist)) { + if (StrUtil.equals(type, Constant.BYQ_JBFD)) { + data_byq_jbfdDao.updateDataList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.DLQJBFD)) { + data_dlq_jbfdDao.updateDataList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } else if (StrUtil.equals(type, Constant.YSP)) { + data_yspDao.updateDataList(CommonStatus.UPLOAD.value(), idlist, new Date()); + } + + + } + } else { + log.info("上传失败"); + } + } + } + } + } + } + + @Async(value = "asyncServiceExecutor") + public void sendJBFDData2(Client client, BigInteger maxid, ArrayList list1, String xml, String type) throws Exception { + Object[] objects = client.invoke("uploadCACData", xml); + String threadId = Thread.currentThread().getName(); + log.info("线程序号: " + threadId + "当前时间:" + new Date()); +// log.info("上传的数据: " + xml); + if (objects != null && objects.length > 0) { + String string = String.valueOf(objects[0]); + log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); + JSONObject jsonObject = XML.toJSONObject(string); + if (jsonObject != null) { + JSONObject response = (JSONObject) jsonObject.get("response"); + if (response != null) { + JSONObject result = (JSONObject) response.get("result"); + if (result != null) { + Integer code = (Integer) result.get("code"); + if (code != null && code.intValue() == 0) { + log.info("上传成功"); + log.info("修改的id: " + list1.toString()); + if (CollectionUtil.isNotEmpty(list1)) { + if (StrUtil.equals(type, Constant.BYQ_JBFD)) { + data_byq_jbfdDao.updateDataList2(CommonStatus.UPLOAD.value(), maxid,list1, new Date()); + } else if (StrUtil.equals(type, Constant.DLQJBFD)) { + data_dlq_jbfdDao.updateDataList2(CommonStatus.UPLOAD.value(),maxid, list1, new Date()); + } else if (StrUtil.equals(type, Constant.YSP)) { + data_yspDao.updateDataList2(CommonStatus.UPLOAD.value(), maxid, list1, new Date()); + } + + + } + } else { + log.info("上传失败"); + } + } + } + } + } + } + +} diff --git a/src/main/java/com/shxy/i2/Tool/GenerateI2Xml.java b/src/main/java/com/shxy/i2/Tool/GenerateI2Xml.java new file mode 100644 index 0000000..9df989e --- /dev/null +++ b/src/main/java/com/shxy/i2/Tool/GenerateI2Xml.java @@ -0,0 +1,43 @@ +package com.shxy.i2.Tool; + +import cn.hutool.core.util.StrUtil; +import com.shxy.i2.bean.AttrBean; +import com.shxy.i2.constant.Constant; + +import java.util.ArrayList; + +public class GenerateI2Xml { + + public static String generateCacXml(String type, String sensorid, String equipmentid, String timestamp, ArrayList attrlist) { + String cacdata = ""; + cacdata += " "; + cacdata += "" + type + " "; + cacdata += "" + equipmentid + " "; + if (StrUtil.isNotEmpty(timestamp)) { + cacdata += "" + timestamp + " "; + } + cacdata += " "; + for (AttrBean bean : attrlist) { + cacdata += " "; + } + cacdata += " "; + cacdata += ""; + return cacdata; + } + + public static String generateEndCacXml(ArrayList cacdatalist) { + String cacxml = ""; + cacxml += " "; + cacxml += " "; + cacxml += " "; + for (String str : cacdatalist) { + cacxml += str; + } +// cacxml += " "; +// cacxml += ""; + cacxml += " "; + cacxml += " "; + + return cacxml; + } +} diff --git a/src/main/java/com/shxy/i2/bean/AttrBean.java b/src/main/java/com/shxy/i2/bean/AttrBean.java new file mode 100644 index 0000000..f392f5d --- /dev/null +++ b/src/main/java/com/shxy/i2/bean/AttrBean.java @@ -0,0 +1,9 @@ +package com.shxy.i2.bean; + +import lombok.Data; + +@Data +public class AttrBean { + private String key; + private T value; +} diff --git a/src/main/java/com/shxy/i2/bean/SendDataBean.java b/src/main/java/com/shxy/i2/bean/SendDataBean.java new file mode 100644 index 0000000..9809fe2 --- /dev/null +++ b/src/main/java/com/shxy/i2/bean/SendDataBean.java @@ -0,0 +1,11 @@ +package com.shxy.i2.bean; + +import lombok.Data; + +import java.math.BigInteger; + +@Data +public class SendDataBean { + private Integer eqmid; + private BigInteger maxid; +} diff --git a/src/main/java/com/shxy/i2/configure/CxfClientConfig.java b/src/main/java/com/shxy/i2/configure/CxfClientConfig.java new file mode 100644 index 0000000..7f4af42 --- /dev/null +++ b/src/main/java/com/shxy/i2/configure/CxfClientConfig.java @@ -0,0 +1,35 @@ +//package com.shxy.i2.configure; +// +//import org.apache.cxf.endpoint.Client; +//import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; +//import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +// +//@Configuration +//public class CxfClientConfig { +// /** +// * 采用代理方式 +// * +// * @return NBAPlayerSoap +// */ +//// @Bean +//// public NBAPlayerSoap createAuthorPortTypeProxy() { +//// JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean(); +//// jaxWsProxyFactoryBean.setServiceClass(NBAPlayerSoap.class); +//// jaxWsProxyFactoryBean.setAddress(WsConst.SERVICE_ADDRESS); +//// return (NBAPlayerSoap) jaxWsProxyFactoryBean.create(); +//// } +// +// /** +// * 采用动态工厂方式 不需要指定服务接口 +// * "http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl" +// * +// */ +// @Bean +// public Client createDynamicClient() { +// JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); +// Client client = dcf.createClient("http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl"); +// return client; +// } +//} diff --git a/src/main/java/com/shxy/i2/configure/JaxWsClientConfig.java b/src/main/java/com/shxy/i2/configure/JaxWsClientConfig.java new file mode 100644 index 0000000..f55a840 --- /dev/null +++ b/src/main/java/com/shxy/i2/configure/JaxWsClientConfig.java @@ -0,0 +1,32 @@ +//package com.shxy.i2.configure; +// +//import lombok.extern.slf4j.Slf4j; +//import org.apache.cxf.endpoint.Client; +//import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; +//import org.apache.cxf.transport.http.HTTPConduit; +//import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +// +//@Configuration +//@Slf4j +//public class JaxWsClientConfig { +// +// @Bean("JaxWsClient") +// public Client client() { +// // 创建动态客户端 +// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); +// log.info("publicsecurity webService url : {}", "http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl"); +// //根据WebServices接口地址创建client +// Client client = clientFactory.createClient("http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl"); +// HTTPConduit conduit = (HTTPConduit) client.getConduit(); +// HTTPClientPolicy policy = new HTTPClientPolicy(); +// policy.setAllowChunking(false); +// // 连接服务器超时时间 10秒 +// policy.setConnectionTimeout(60000); +// // 等待服务器响应超时时间 20秒 +// policy.setReceiveTimeout(20000); +// conduit.setClient(policy); +// return client; +// } +//} diff --git a/src/main/java/com/shxy/i2/configure/ThreadPoolConfig.java b/src/main/java/com/shxy/i2/configure/ThreadPoolConfig.java new file mode 100644 index 0000000..b88f292 --- /dev/null +++ b/src/main/java/com/shxy/i2/configure/ThreadPoolConfig.java @@ -0,0 +1,37 @@ +package com.shxy.i2.configure; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.Executor; +import java.util.concurrent.ThreadPoolExecutor; + + +@Configuration +@EnableAsync +public class ThreadPoolConfig { + + /** + * 自定义线程池配置 + * + * @return + */ + @Bean(name = "asyncServiceExecutor") + public Executor asyncServiceExecutor() { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + //配置核心线程数 + executor.setCorePoolSize(20); + //配置最大线程数 + executor.setMaxPoolSize(200); + //配置队列大小 + executor.setQueueCapacity(1000000); + //配置线程池中的线程的名称前缀 + executor.setThreadNamePrefix("async-cron-table"); + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + executor.initialize(); + return executor; + } + +} diff --git a/src/main/java/com/shxy/i2/configure/WebServiceConfig.java b/src/main/java/com/shxy/i2/configure/WebServiceConfig.java new file mode 100644 index 0000000..6196ca1 --- /dev/null +++ b/src/main/java/com/shxy/i2/configure/WebServiceConfig.java @@ -0,0 +1,51 @@ +//package com.shxy.i2; +// +//import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.oxm.jaxb.Jaxb2Marshaller; +//import org.springframework.ws.client.core.WebServiceTemplate; +//import org.springframework.ws.transport.http.HttpUrlConnectionMessageSender; +// +//import javax.xml.ws.soap.SOAPBinding; +// +//@Configuration +//public class WebServiceConfig { +// +// @Bean(name = "webServiceTemplate") +// public WebServiceTemplate webServiceTemplate(Jaxb2Marshaller marshaller) { +// WebServiceTemplate webServiceTemplate = new WebServiceTemplate(); +// webServiceTemplate.setMarshaller(marshaller); +// webServiceTemplate.setUnmarshaller(marshaller); +// webServiceTemplate.setMessageSender(httpUrlConnectionMessageSender()); +// return webServiceTemplate; +// } +// +// @Bean(name="httpUrlConnectionMessageSender") +// public HttpUrlConnectionMessageSender httpUrlConnectionMessageSender() { +// return new HttpUrlConnectionMessageSender(); +// } +// +// @Bean +// public Jaxb2Marshaller marshaller() { +// Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); +// marshaller.setContextPath("com.example.demo"); +// return marshaller; +// } +// +// @Bean(name="testServiceClient") +// public TestService testServiceClient(Jaxb2Marshaller marshaller) { +// JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); +// factory.setServiceClass(TestService.class); +// factory.setAddress("http://localhost:8080/services/TestService"); +// factory.setServiceName(new QName("http://example.com/", "TestServicePort")); +// factory.setEndpointName(new QName("http://example.com/", "TestServiceSoap")); +// factory.setBindingId(SOAPBinding.SOAP11HTTP_BINDING); +// factory.setUnmarshaller(marshaller); +// factory.setMarshaller(marshaller); +// +// Object obj = factory.create(); +// return (TestService) obj; +// } +// +//} diff --git a/src/main/java/com/shxy/i2/constant/CommonStatus.java b/src/main/java/com/shxy/i2/constant/CommonStatus.java new file mode 100644 index 0000000..5323577 --- /dev/null +++ b/src/main/java/com/shxy/i2/constant/CommonStatus.java @@ -0,0 +1,29 @@ +package com.shxy.i2.constant; + + +/** + * 常用状态 + * "0---删除 1---生效中" + * + * @author 晶晶 + */ +public enum CommonStatus { + UNUPLOAD("UNUPLOAD", 0), UPLOAD("UPLOAD", 1); + + private String name; + private Integer value; + + CommonStatus(String name, Integer value) { + this.name = name; + this.value = value; + } + + @Override + public String toString() { + return this.value + "_" + this.name; + } + + public Integer value() { + return this.value; + } +} diff --git a/src/main/java/com/shxy/i2/constant/Constant.java b/src/main/java/com/shxy/i2/constant/Constant.java new file mode 100644 index 0000000..c2328b4 --- /dev/null +++ b/src/main/java/com/shxy/i2/constant/Constant.java @@ -0,0 +1,19 @@ +package com.shxy.i2.constant; + +public class Constant { + public static String Cacid = "changtai"; + public static String BYQ_JBFD = "021001"; + public static String YSP = "021002"; + public static String WS = "021003"; + public static String TX = "021004"; + public static String DCYW = "021005"; + public static String DRJYJC = "022001"; + public static String JSYHW = "023001"; + public static String DLQJBFD = "024001"; + public static String FHZXQ = "024002"; + public static String FHDLBX = "024003"; + public static String SF6_QTYL = "024004"; + public static String SF6_QTSF = "024005"; + public static String CNJ = "024006"; + public static String WQX = "025001"; +} diff --git a/src/main/java/com/shxy/i2/dao/Data_Byq_JbfdDao.java b/src/main/java/com/shxy/i2/dao/Data_Byq_JbfdDao.java new file mode 100644 index 0000000..e254d2c --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_Byq_JbfdDao.java @@ -0,0 +1,25 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.bean.SendDataBean; +import com.shxy.i2.entity.Data_Byq_Jbfd; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public interface Data_Byq_JbfdDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateDataList(@Param("isupload") Integer isupload, @Param("idlist") ArrayList id, @Param("updateTime") Date updateTime); + + int updateDataList2(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") ArrayList id, @Param("updateTime") Date updateTime); + + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_CnjDao.java b/src/main/java/com/shxy/i2/dao/Data_CnjDao.java new file mode 100644 index 0000000..5e6fe6f --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_CnjDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_Cnj; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_CnjDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_DcywDao.java b/src/main/java/com/shxy/i2/dao/Data_DcywDao.java new file mode 100644 index 0000000..9da6aa9 --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_DcywDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_Dcyw; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_DcywDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_Dlq_JbfdDao.java b/src/main/java/com/shxy/i2/dao/Data_Dlq_JbfdDao.java new file mode 100644 index 0000000..07ec473 --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_Dlq_JbfdDao.java @@ -0,0 +1,24 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.bean.SendDataBean; +import com.shxy.i2.entity.Data_Dlq_Jbfd; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public interface Data_Dlq_JbfdDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateDataList(@Param("isupload") Integer isupload, @Param("idlist") ArrayList id, @Param("updateTime") Date updateTime); + + int updateDataList2(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") ArrayList id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_Dr_JyjcDao.java b/src/main/java/com/shxy/i2/dao/Data_Dr_JyjcDao.java new file mode 100644 index 0000000..faad3fe --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_Dr_JyjcDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_Dr_Jyjc; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_Dr_JyjcDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_FhdlbxDao.java b/src/main/java/com/shxy/i2/dao/Data_FhdlbxDao.java new file mode 100644 index 0000000..2a602b3 --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_FhdlbxDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_Fhdlbx; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_FhdlbxDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_FhzxqDao.java b/src/main/java/com/shxy/i2/dao/Data_FhzxqDao.java new file mode 100644 index 0000000..551200e --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_FhzxqDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_Fhzxq; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_FhzxqDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_Jsyhw_JyjcDao.java b/src/main/java/com/shxy/i2/dao/Data_Jsyhw_JyjcDao.java new file mode 100644 index 0000000..63d2b55 --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_Jsyhw_JyjcDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_Jsyhw_Jyjc; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_Jsyhw_JyjcDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_MicroclimateDao.java b/src/main/java/com/shxy/i2/dao/Data_MicroclimateDao.java new file mode 100644 index 0000000..b874b17 --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_MicroclimateDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_Microclimate; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_MicroclimateDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_SF6_QtsfDao.java b/src/main/java/com/shxy/i2/dao/Data_SF6_QtsfDao.java new file mode 100644 index 0000000..abc4f1d --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_SF6_QtsfDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_SF6_Qtsf; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_SF6_QtsfDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_SF6_QtylDao.java b/src/main/java/com/shxy/i2/dao/Data_SF6_QtylDao.java new file mode 100644 index 0000000..a272879 --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_SF6_QtylDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_SF6_Qtyl; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_SF6_QtylDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_TxDao.java b/src/main/java/com/shxy/i2/dao/Data_TxDao.java new file mode 100644 index 0000000..58ce5e9 --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_TxDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_Tx; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_TxDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_WsDao.java b/src/main/java/com/shxy/i2/dao/Data_WsDao.java new file mode 100644 index 0000000..17552d6 --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_WsDao.java @@ -0,0 +1,18 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Data_Ws; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; + +public interface Data_WsDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Data_YspDao.java b/src/main/java/com/shxy/i2/dao/Data_YspDao.java new file mode 100644 index 0000000..daffd79 --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Data_YspDao.java @@ -0,0 +1,24 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.bean.SendDataBean; +import com.shxy.i2.entity.Data_Ysp; +import org.apache.ibatis.annotations.Param; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public interface Data_YspDao { + + List selectUpload(@Param("isupload") Integer isupload); + + int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime); + + int updateDataList(@Param("isupload") Integer isupload, @Param("idlist") ArrayList id, @Param("updateTime") Date updateTime); + + int updateDataList2(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") ArrayList id, @Param("updateTime") Date updateTime); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dao/Niec_SensorsDao.java b/src/main/java/com/shxy/i2/dao/Niec_SensorsDao.java new file mode 100644 index 0000000..e296d7d --- /dev/null +++ b/src/main/java/com/shxy/i2/dao/Niec_SensorsDao.java @@ -0,0 +1,11 @@ +package com.shxy.i2.dao; + +import com.shxy.i2.entity.Niec_Sensors; + +import java.util.List; + +public interface Niec_SensorsDao { + + List selectAll(); + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/dto/Data_SF6_QtylDetailDto.java b/src/main/java/com/shxy/i2/dto/Data_SF6_QtylDetailDto.java new file mode 100644 index 0000000..581ed1f --- /dev/null +++ b/src/main/java/com/shxy/i2/dto/Data_SF6_QtylDetailDto.java @@ -0,0 +1,31 @@ +package com.shxy.i2.dto; + +import lombok.Data; + +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_SF6_QtylDetailDto { + + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float temperature; + + private Float absolutepressure; + + private Float density; + + private Float pressure20c; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + +} diff --git a/src/main/java/com/shxy/i2/dto/Data_SF6_QtylDto.java b/src/main/java/com/shxy/i2/dto/Data_SF6_QtylDto.java new file mode 100644 index 0000000..056a0f5 --- /dev/null +++ b/src/main/java/com/shxy/i2/dto/Data_SF6_QtylDto.java @@ -0,0 +1,17 @@ +package com.shxy.i2.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class Data_SF6_QtylDto { + + private Integer eqmid; + + private List list; + + + + +} diff --git a/src/main/java/com/shxy/i2/entity/Data_Byq_Jbfd.java b/src/main/java/com/shxy/i2/entity/Data_Byq_Jbfd.java new file mode 100644 index 0000000..faa6736 --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Byq_Jbfd.java @@ -0,0 +1,33 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Byq_Jbfd implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float dischargecapacity; + + private Float dischargeposition; + + private Float pulsecount; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private byte[] dischargewaveform; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Cnj.java b/src/main/java/com/shxy/i2/entity/Data_Cnj.java new file mode 100644 index 0000000..dc1faf3 --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Cnj.java @@ -0,0 +1,27 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Cnj implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float chargetime; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Dcyw.java b/src/main/java/com/shxy/i2/entity/Data_Dcyw.java new file mode 100644 index 0000000..e272096 --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Dcyw.java @@ -0,0 +1,27 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Dcyw implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float oiltemperature; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Dlq_Jbfd.java b/src/main/java/com/shxy/i2/entity/Data_Dlq_Jbfd.java new file mode 100644 index 0000000..bb6f598 --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Dlq_Jbfd.java @@ -0,0 +1,34 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; +@Data +public class Data_Dlq_Jbfd implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private String phase; + + private Float dischargecapacity; + + private Float dischargeposition; + + private Float pulsecount; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private byte[] dischargewaveform; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Dr_Jyjc.java b/src/main/java/com/shxy/i2/entity/Data_Dr_Jyjc.java new file mode 100644 index 0000000..dd4ff0f --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Dr_Jyjc.java @@ -0,0 +1,37 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Dr_Jyjc implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float capacitance; + + private Float lossfactor; + + private Float unbalancecurrent; + + private Float unbalancevoltage; + + private Float totalcurrent; + + private Float systemvoltage; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Fhdlbx.java b/src/main/java/com/shxy/i2/entity/Data_Fhdlbx.java new file mode 100644 index 0000000..5b5c1af --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Fhdlbx.java @@ -0,0 +1,29 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Fhdlbx implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Integer action; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private byte[] loadwaveform; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Fhzxq.java b/src/main/java/com/shxy/i2/entity/Data_Fhzxq.java new file mode 100644 index 0000000..55d2fcc --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Fhzxq.java @@ -0,0 +1,29 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Fhzxq implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Integer action; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private byte[] coilwaveform; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Jsyhw_Jyjc.java b/src/main/java/com/shxy/i2/entity/Data_Jsyhw_Jyjc.java new file mode 100644 index 0000000..7c703a3 --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Jsyhw_Jyjc.java @@ -0,0 +1,35 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Jsyhw_Jyjc implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float systemvoltage; + + private Float totalcurrent; + + private Float resistivecurrent; + + private Float actioncount; + + private Date lastactiontime; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Microclimate.java b/src/main/java/com/shxy/i2/entity/Data_Microclimate.java new file mode 100644 index 0000000..d42f97a --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Microclimate.java @@ -0,0 +1,39 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Microclimate implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float airtemperature; + + private Float airpressure; + + private Float humidity; + + private Float precipitation; + + private Float wddir; + + private Float precipitationintensity; + + private Float radiationintensity; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_SF6_Qtsf.java b/src/main/java/com/shxy/i2/entity/Data_SF6_Qtsf.java new file mode 100644 index 0000000..dc8526e --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_SF6_Qtsf.java @@ -0,0 +1,29 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_SF6_Qtsf implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float temperature; + + private Float moisture; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_SF6_Qtyl.java b/src/main/java/com/shxy/i2/entity/Data_SF6_Qtyl.java new file mode 100644 index 0000000..29dcdbf --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_SF6_Qtyl.java @@ -0,0 +1,34 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_SF6_Qtyl implements Serializable { + + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float temperature; + + private Float absolutepressure; + + private Float density; + + private Float pressure20c; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Tx.java b/src/main/java/com/shxy/i2/entity/Data_Tx.java new file mode 100644 index 0000000..625f0a5 --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Tx.java @@ -0,0 +1,27 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Tx implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float totalcorecurrent; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Ws.java b/src/main/java/com/shxy/i2/entity/Data_Ws.java new file mode 100644 index 0000000..b795866 --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Ws.java @@ -0,0 +1,26 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; +@Data +public class Data_Ws implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float moisture; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Data_Ysp.java b/src/main/java/com/shxy/i2/entity/Data_Ysp.java new file mode 100644 index 0000000..6038233 --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Data_Ysp.java @@ -0,0 +1,45 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigInteger; +import java.util.Date; + +@Data +public class Data_Ysp implements Serializable { + private BigInteger id; + + private Integer eqmid; + + private Date acquisitiontime; + + private Float h2; + + private Float ch4; + + private Float c2h6; + + private Float c2h4; + + private Float c2h2; + + private Float co; + + private Float co2; + + private Float o2; + + private Float n2; + + private Float totalhydrocarbon; + + private Integer isupload; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/entity/Niec_Sensors.java b/src/main/java/com/shxy/i2/entity/Niec_Sensors.java new file mode 100644 index 0000000..64c22a1 --- /dev/null +++ b/src/main/java/com/shxy/i2/entity/Niec_Sensors.java @@ -0,0 +1,45 @@ +package com.shxy.i2.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class Niec_Sensors implements Serializable { + + private Integer id; + + private Integer parentId; + + private String siteId; + + private String sensorCode; + + private String equipmentId; + + private String phase; + + private String name; + + private Integer grpNo; + + private Integer status; + + private String equipmentType; + + private String systemCode; + + private String tableName; + + private String devidFieldName; + + private String dtimeFieldName; + + private Integer oneDtime; + + private Date createTime; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/service/Webservcies.java b/src/main/java/com/shxy/i2/service/Webservcies.java new file mode 100644 index 0000000..e5459a5 --- /dev/null +++ b/src/main/java/com/shxy/i2/service/Webservcies.java @@ -0,0 +1,11 @@ +package com.shxy.i2.service; + +public interface Webservcies { + + void uploadData(); + void uploadyspData(); + void uploadjfjcData(); + + +// void test(String str); +} diff --git a/src/main/java/com/shxy/i2/service/XydlI2Service.java b/src/main/java/com/shxy/i2/service/XydlI2Service.java new file mode 100644 index 0000000..77f7f8a --- /dev/null +++ b/src/main/java/com/shxy/i2/service/XydlI2Service.java @@ -0,0 +1,37 @@ +package com.shxy.i2.service; + +import com.shxy.i2.entity.Niec_Sensors; +import org.apache.cxf.endpoint.Client; + +import java.util.HashMap; + +public interface XydlI2Service { + + void upload_byq_jbfd(Client client, HashMap equipMap); + + void upload_sf6_qtyl(Client client, HashMap equipMap); + + void upload_dcyw(Client client, HashMap equipMap); + + void upload_fhdlbx(Client client, HashMap equipMap); + + void upload_fhzxq(Client client, HashMap equipMap); + + void upload_sf6_qtsf(Client client, HashMap equipMap); + + void upload_tx(Client client, HashMap equipMap); + + void upload_ws(Client client, HashMap equipMap); + + void upload_dr_jyjc(Client client, HashMap equipMap); + + void upload_jsyhw_jyjc(Client client, HashMap equipMap); + + void upload_microclimate(Client client, HashMap equipMap); + + void upload_dlq_jbfd(Client client, HashMap equipMap); + + void upload_ysp(Client client, HashMap equipMap); + + void upload_cnj(Client client, HashMap equipMap); +} diff --git a/src/main/java/com/shxy/i2/serviceimpl/WebServiceImpl.java b/src/main/java/com/shxy/i2/serviceimpl/WebServiceImpl.java new file mode 100644 index 0000000..d39d498 --- /dev/null +++ b/src/main/java/com/shxy/i2/serviceimpl/WebServiceImpl.java @@ -0,0 +1,131 @@ +package com.shxy.i2.serviceimpl; + +import com.shxy.i2.Tool.AsyncMethod; +import com.shxy.i2.dao.*; +import com.shxy.i2.entity.*; +import com.shxy.i2.service.Webservcies; +import com.shxy.i2.service.XydlI2Service; +import lombok.extern.slf4j.Slf4j; +import org.apache.cxf.endpoint.Client; +import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; +import org.apache.cxf.transport.http.HTTPConduit; +import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; + +@Service +@Slf4j +@EnableAsync +public class WebServiceImpl implements Webservcies { + + @Autowired + XydlI2Service xydlI2Service; + + @Autowired + AsyncMethod asyncMethod; + + @Autowired + private Niec_SensorsDao niec_sensorsDao; + + private static String address = "http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl"; + + /** + * 上传cac数据 + */ + @Override + public void uploadData() { + log.info("实时数据定时任务启动"); +// 动态客户端 + JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); + log.info("实时数据 publicsecurity webService url : {}", address); + //根据WebServices接口地址创建client + Client client = clientFactory.createClient(address); + HTTPConduit conduit = (HTTPConduit) client.getConduit(); + HTTPClientPolicy policy = new HTTPClientPolicy(); + policy.setAllowChunking(false); + // 连接服务器超时时间 60秒 + policy.setConnectionTimeout(60000); + // 等待服务器响应超时时间 60秒 + policy.setReceiveTimeout(30000); + conduit.setClient(policy); + + log.info("开始执行定时任务-查询数据库"); + HashMap equipMap = new HashMap(); + List niec_sensors = niec_sensorsDao.selectAll(); + for (Niec_Sensors item : niec_sensors) { + equipMap.put(item.getId(), item); + } + xydlI2Service.upload_sf6_qtyl(client, equipMap); + xydlI2Service.upload_dcyw(client, equipMap); + xydlI2Service.upload_fhdlbx(client, equipMap); + xydlI2Service.upload_fhzxq(client, equipMap); + xydlI2Service.upload_sf6_qtsf(client, equipMap); + xydlI2Service.upload_tx(client, equipMap); + xydlI2Service.upload_ws(client, equipMap); + xydlI2Service.upload_dr_jyjc(client, equipMap); + xydlI2Service.upload_jsyhw_jyjc(client, equipMap); + xydlI2Service.upload_microclimate(client, equipMap); + xydlI2Service.upload_cnj(client, equipMap); + log.info("实时数据定时任务结束"); + + } + + @Override + public void uploadyspData() { + log.info("油色谱数据定时任务启动"); + // 动态客户端 + JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); + log.info("油色谱数据 publicsecurity webService url : {}", address); + //根据WebServices接口地址创建client + Client client = clientFactory.createClient(address); + HTTPConduit conduit = (HTTPConduit) client.getConduit(); + HTTPClientPolicy policy = new HTTPClientPolicy(); + policy.setAllowChunking(false); + // 连接服务器超时时间 60秒 + policy.setConnectionTimeout(60000); + // 等待服务器响应超时时间 60秒 + policy.setReceiveTimeout(60000); + conduit.setClient(policy); + + log.info("开始执行定时任务-查询数据库"); + HashMap equipMap = new HashMap(); + List niec_sensors = niec_sensorsDao.selectAll(); + for (Niec_Sensors item : niec_sensors) { + equipMap.put(item.getId(), item); + } + xydlI2Service.upload_ysp(client, equipMap); + log.info("油色谱数据定时任务结束"); + } + + @Override + public void uploadjfjcData() { + + log.info("局放监测数据定时任务启动"); + // 动态客户端 + JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); + log.info("局放监测数据 publicsecurity webService url : {}", address); + //根据WebServices接口地址创建client + Client client = clientFactory.createClient(address); + HTTPConduit conduit = (HTTPConduit) client.getConduit(); + HTTPClientPolicy policy = new HTTPClientPolicy(); + policy.setAllowChunking(false); + // 连接服务器超时时间 60秒 + policy.setConnectionTimeout(60000); + // 等待服务器响应超时时间 60秒 + policy.setReceiveTimeout(60000); + conduit.setClient(policy); + HashMap equipMap = new HashMap(); + List niec_sensors = niec_sensorsDao.selectAll(); + for (Niec_Sensors item : niec_sensors) { + equipMap.put(item.getId(), item); + } + xydlI2Service.upload_dlq_jbfd(client, equipMap); + xydlI2Service.upload_byq_jbfd(client, equipMap); + log.info("局放监测数据定时任务结束"); + } + +} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/serviceimpl/WebServiceImplbak.java b/src/main/java/com/shxy/i2/serviceimpl/WebServiceImplbak.java new file mode 100644 index 0000000..ada0591 --- /dev/null +++ b/src/main/java/com/shxy/i2/serviceimpl/WebServiceImplbak.java @@ -0,0 +1,1660 @@ +//package com.shxy.i2.serviceimpl; +// +//import cn.hutool.core.collection.CollectionUtil; +//import cn.hutool.core.date.DatePattern; +//import cn.hutool.core.date.DateUtil; +//import cn.hutool.core.util.StrUtil; +//import cn.hutool.json.JSONObject; +//import cn.hutool.json.XML; +//import com.shxy.i2.Tool.GenerateI2Xml; +//import com.shxy.i2.bean.AttrBean; +//import com.shxy.i2.constant.CommonStatus; +//import com.shxy.i2.constant.Constant; +//import com.shxy.i2.dao.*; +//import com.shxy.i2.entity.*; +//import com.shxy.i2.service.Webservcies; +//import lombok.extern.slf4j.Slf4j; +//import org.apache.cxf.endpoint.Client; +//import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; +//import org.apache.cxf.transport.http.HTTPConduit; +//import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.scheduling.annotation.Async; +//import org.springframework.stereotype.Service; +// +//import java.math.BigInteger; +//import java.util.ArrayList; +//import java.util.Date; +//import java.util.HashMap; +//import java.util.List; +// +//@Service +//@Slf4j +//public class WebServiceImplbak implements Webservcies { +// +// //注入 +//// @Autowired +//// @Qualifier("JaxWsClient") +//// private Client client; +// +// @Autowired +// private Niec_SensorsDao niec_sensorsDao; +// +// @Autowired +// private Data_SF6_QtylDao data_sf6_qtylDao; +// +// @Autowired +// private Data_Byq_JbfdDao data_byq_jbfdDao; +// +// @Autowired +// private Data_CnjDao data_cnjDao; +// +// @Autowired +// private Data_DcywDao data_dcywDao; +// +// @Autowired +// private Data_Dlq_JbfdDao data_dlq_jbfdDao; +// +// @Autowired +// private Data_Dr_JyjcDao data_dr_jyjcDao; +// +// @Autowired +// private Data_FhdlbxDao data_fhdlbxDao; +// +// @Autowired +// private Data_FhzxqDao data_fhzxqDao; +// +// @Autowired +// private Data_Jsyhw_JyjcDao data_jsyhw_jyjcDao; +// +// @Autowired +// private Data_SF6_QtsfDao data_sf6_qtsfDao; +// +// @Autowired +// private Data_TxDao data_txDao; +// +// @Autowired +// private Data_WsDao data_wsDao; +// +// @Autowired +// private Data_YspDao data_yspDao; +// +// @Autowired +// private Data_MicroclimateDao data_microclimateDao; +// +// /** +// * 上传cac数据 +// */ +// @Override +// public void uploadData() { +// log.info("kaishi"); +// +//// 动态客户端 +// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); +// log.info("publicsecurity webService url : {}", "http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl"); +// //根据WebServices接口地址创建client +// Client client = clientFactory.createClient("http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl"); +// HTTPConduit conduit = (HTTPConduit) client.getConduit(); +// HTTPClientPolicy policy = new HTTPClientPolicy(); +// policy.setAllowChunking(false); +// // 连接服务器超时时间 60秒 +// policy.setConnectionTimeout(60000); +// // 等待服务器响应超时时间 60秒 +// policy.setReceiveTimeout(60000); +// conduit.setClient(policy); +// +// log.info("开始执行定时任务-查询数据库"); +// HashMap equipMap = new HashMap(); +// List niec_sensors = niec_sensorsDao.selectAll(); +// for (Niec_Sensors item : niec_sensors) { +// equipMap.put(item.getId(), item); +// } +// +// upload_byq_jbfd(client, equipMap); +// upload_cnj(client, equipMap); +// upload_dcyw(client, equipMap); +// upload_dlq_jbfd(client, equipMap); +// +// upload_fhdlbx(client, equipMap); +// upload_fhzxq(client, equipMap); +// +// upload_sf6_qtsf(client, equipMap); +// upload_sf6_qtyl(client, equipMap); +// upload_tx(client, equipMap); +// upload_ws(client, equipMap); +// +// upload_microclimate(client, equipMap); +// log.info("fsadsa"); +// +// } +// +// @Override +// public void uploadyspData() { +// log.info("kaishi3232"); +// // 动态客户端 +// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); +// //根据WebServices接口地址创建client +// Client client = clientFactory.createClient("http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl"); +// HTTPConduit conduit = (HTTPConduit) client.getConduit(); +// HTTPClientPolicy policy = new HTTPClientPolicy(); +// policy.setAllowChunking(false); +// // 连接服务器超时时间 60秒 +// policy.setConnectionTimeout(60000); +// // 等待服务器响应超时时间 60秒 +// policy.setReceiveTimeout(60000); +// conduit.setClient(policy); +// +// log.info("开始执行定时任务-查询数据库"); +// HashMap equipMap = new HashMap(); +// List niec_sensors = niec_sensorsDao.selectAll(); +// for (Niec_Sensors item : niec_sensors) { +// equipMap.put(item.getId(), item); +// } +// upload_ysp(client, equipMap); +// } +// +// @Override +// public void uploadjfjcData() { +// +// log.info("kaishi66666"); +// // 动态客户端 +// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); +// //根据WebServices接口地址创建client +// Client client = clientFactory.createClient("http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl"); +// HTTPConduit conduit = (HTTPConduit) client.getConduit(); +// HTTPClientPolicy policy = new HTTPClientPolicy(); +// policy.setAllowChunking(false); +// // 连接服务器超时时间 60秒 +// policy.setConnectionTimeout(60000); +// // 等待服务器响应超时时间 60秒 +// policy.setReceiveTimeout(60000); +// conduit.setClient(policy); +// +// log.info("开始执行定时任务-查询数据库"); +// HashMap equipMap = new HashMap(); +// List niec_sensors = niec_sensorsDao.selectAll(); +// for (Niec_Sensors item : niec_sensors) { +// equipMap.put(item.getId(), item); +// } +// upload_dr_jyjc(client, equipMap); +// upload_jsyhw_jyjc(client, equipMap); +// +// } +// +// @Override +// public void test(String str) { +// log.info("查询byq_jbfd的数据量:" + str); +// log.info("开始执行定时任务-查询数据库"); +// HashMap equipMap = new HashMap(); +// List niec_sensors = niec_sensorsDao.selectAll(); +// for (Niec_Sensors item : niec_sensors) { +// equipMap.put(item.getId(), item); +// } +// List list = data_sf6_qtylDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询sf6_qtyl的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +//// ArrayList idlist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList tempidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_SF6_Qtyl item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// +// tempidlist.add(item.getId()); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float temperature = item.getTemperature(); +// if (temperature != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Temperature"); +// attr.setValue(temperature); +// attrlist.add(attr); +// } +// Float absolutepressure = item.getAbsolutepressure(); +// if (absolutepressure != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("AbsolutePressure"); +// attr.setValue(absolutepressure); +// attrlist.add(attr); +// } +// Float density = item.getDensity(); +// if (density != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Density"); +// attr.setValue(density); +// attrlist.add(attr); +// } +// Float pressure20c = item.getPressure20c(); +// if (pressure20c != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Pressure20C"); +// attr.setValue(pressure20c); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTYL, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +//// Object[] objects = client.invoke("uploadCACData", xml); +//// if (objects != null && objects.length > 0) { +//// String string = String.valueOf(objects[0]); +//// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +//// JSONObject jsonObject = XML.toJSONObject(string); +//// if (jsonObject != null) { +//// JSONObject response = (JSONObject) jsonObject.get("response"); +//// if (response != null) { +//// JSONObject result = (JSONObject) response.get("result"); +//// if (result != null) { +//// Integer code = (Integer) result.get("code"); +//// if (code != null && code.intValue() == 0) { +////// if (CollectionUtil.isNotEmpty(tempidlist)) { +//////// idlist.addAll(tempidlist); +////// } +//// } else { +//// if (CollectionUtil.isNotEmpty(failtempidlist)) { +//// failidlist.addAll(failtempidlist); +//// } +//// +//// } +//// } +//// } +//// } +//// } +// failtempidlist.clear(); +// tempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +//// if (CollectionUtil.isNotEmpty(idlist)) { +// data_sf6_qtylDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +//// } +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到sf6_qtyl的数据"); +// } +// } +// +// +// private void upload_byq_jbfd(Client client, HashMap equipMap) { +// List list = data_byq_jbfdDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询byq_jbfd的数据量:" + list.size()); +// +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList idlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Byq_Jbfd item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float dischargecapacity = item.getDischargecapacity(); +// if (dischargecapacity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargeCapacity"); +// attr.setValue(dischargecapacity); +// attrlist.add(attr); +// } +// Float dischargeposition = item.getDischargeposition(); +// if (dischargeposition != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargePosition"); +// attr.setValue(dischargeposition); +// attrlist.add(attr); +// } +// Float pulsecount = item.getPulsecount(); +// if (pulsecount != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("PulseCount"); +// attr.setValue(pulsecount); +// attrlist.add(attr); +// } +// byte[] dischargewaveform = item.getDischargewaveform(); +// if (dischargewaveform != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargeWaveform"); +// attr.setValue(dischargewaveform); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.BYQ_JBFD, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// send(client, idlist, xml); +// idlist.clear(); +// cacdatalist.clear(); +// } +// +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询byq_jbfd的数据量"); +// } +// } +// +// @Async(value = "asyncServiceExecutor") +// public void send(Client client, ArrayList idlist, String xml) throws Exception { +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// data_byq_jbfdDao.updateList(CommonStatus.UPLOAD.value(), idlist, new Date()); +// } else { +// log.info("上传失败"); +// } +// } +// } +// } +// } +// } +// +// private void upload_cnj(Client client, HashMap equipMap) { +// List list = data_cnjDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询byq_jbfd的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Cnj item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float chargetime = item.getChargetime(); +// if (chargetime != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("ChargeTime"); +// attr.setValue(chargetime); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.CNJ, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// send(client, failidlist, failtempidlist, xml); +// failtempidlist.clear(); +// cacdatalist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_cnjDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询cnj的数据量"); +// } +// } +// +// private void upload_dcyw(Client client, HashMap equipMap) { +// List list = data_dcywDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询dcyw的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// +// for (int index = 0; index < list.size(); index++) { +// Data_Dcyw item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float oiltemperature = item.getOiltemperature(); +// if (oiltemperature != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("OilTemperature"); +// attr.setValue(oiltemperature); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.DCYW, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_dcywDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询dcyw的数据量"); +// } +// } +// +// private void upload_dlq_jbfd(Client client, HashMap equipMap) { +// List list = data_dlq_jbfdDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询dlq_jbfd的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Dlq_Jbfd item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float dischargecapacity = item.getDischargecapacity(); +// if (dischargecapacity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargeCapacity"); +// attr.setValue(dischargecapacity); +// attrlist.add(attr); +// } +// Float dischargeposition = item.getDischargeposition(); +// if (dischargeposition != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargePosition"); +// attr.setValue(dischargeposition); +// attrlist.add(attr); +// } +// Float pulsecount = item.getPulsecount(); +// if (pulsecount != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("PulseCount"); +// attr.setValue(pulsecount); +// attrlist.add(attr); +// } +// byte[] dischargewaveform = item.getDischargewaveform(); +// if (dischargewaveform != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargeWaveform"); +// attr.setValue(dischargewaveform); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.DLQJBFD, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_dlq_jbfdDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询dlq_jbfd的数据量"); +// } +// } +// +// private void upload_dr_jyjc(Client client, HashMap equipMap) { +// List list = data_dr_jyjcDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询dr_jyjc的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Dr_Jyjc item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float capacitance = item.getCapacitance(); +// if (capacitance != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Capacitance"); +// attr.setValue(capacitance); +// attrlist.add(attr); +// } +// Float lossfactor = item.getLossfactor(); +// if (lossfactor != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("LossFactor"); +// attr.setValue(lossfactor); +// attrlist.add(attr); +// } +// Float unbalancecurrent = item.getUnbalancecurrent(); +// if (unbalancecurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("UnbalanceCurrent"); +// attr.setValue(unbalancecurrent); +// attrlist.add(attr); +// } +// Float unbalancevoltage = item.getUnbalancevoltage(); +// if (unbalancevoltage != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("UnbalanceVoltage"); +// attr.setValue(unbalancevoltage); +// attrlist.add(attr); +// } +// Float totalcurrent = item.getTotalcurrent(); +// if (totalcurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("TotalCurrent"); +// attr.setValue(totalcurrent); +// attrlist.add(attr); +// } +// Float systemvoltage = item.getSystemvoltage(); +// if (systemvoltage != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("SystemVoltage"); +// attr.setValue(systemvoltage); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.DRJYJC, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_dr_jyjcDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询dr_jyjc的数据量"); +// } +// } +// +// private void upload_fhdlbx(Client client, HashMap equipMap) { +// List list = data_fhdlbxDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询fhdlbx的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Fhdlbx item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Integer action = item.getAction(); +// if (action != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Action"); +// attr.setValue(action); +// attrlist.add(attr); +// } +// byte[] loadwaveform = item.getLoadwaveform(); +// if (loadwaveform != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("LoadWaveform"); +// attr.setValue(loadwaveform); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.FHDLBX, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_fhdlbxDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询fhdlbx的数据量"); +// } +// } +// +// private void upload_fhzxq(Client client, HashMap equipMap) { +// List list = data_fhzxqDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询fhzxq的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Fhzxq item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Integer action = item.getAction(); +// if (action != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Action"); +// attr.setValue(action); +// attrlist.add(attr); +// } +// byte[] coilwaveform = item.getCoilwaveform(); +// if (coilwaveform != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("CoilWaveform"); +// attr.setValue(coilwaveform); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.FHZXQ, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_fhzxqDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询fhzxq的数据量"); +// } +// } +// +// private void upload_jsyhw_jyjc(Client client, HashMap equipMap) { +// List list = data_jsyhw_jyjcDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询jsyhw_jyjc的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Jsyhw_Jyjc item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float systemvoltage = item.getSystemvoltage(); +// if (systemvoltage != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("SystemVoltage"); +// attr.setValue(systemvoltage); +// attrlist.add(attr); +// } +// Float totalcurrent = item.getTotalcurrent(); +// if (totalcurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("TotalCurrent"); +// attr.setValue(totalcurrent); +// attrlist.add(attr); +// } +// Float resistivecurrent = item.getResistivecurrent(); +// if (resistivecurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("ResistiveCurrent"); +// attr.setValue(resistivecurrent); +// attrlist.add(attr); +// } +// Float actioncount = item.getActioncount(); +// if (actioncount != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("ActionCount"); +// attr.setValue(actioncount); +// attrlist.add(attr); +// } +// Date lastactiontime = item.getLastactiontime(); +// if (lastactiontime != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("LastActionTime"); +// attr.setValue(DateUtil.format(lastactiontime, DatePattern.NORM_DATETIME_PATTERN)); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.JSYHW, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// +// +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_jsyhw_jyjcDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询jsyhw_jyjc的数据量"); +// } +// } +// +// private void upload_sf6_qtsf(Client client, HashMap equipMap) { +// List list = data_sf6_qtsfDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询sf6_qtsf的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_SF6_Qtsf item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float temperature = item.getTemperature(); +// if (temperature != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Temperature"); +// attr.setValue(temperature); +// attrlist.add(attr); +// } +// Float moisture = item.getMoisture(); +// if (moisture != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Moisture"); +// attr.setValue(moisture); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTSF, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_sf6_qtsfDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询sf6_qtsf的数据量"); +// } +// } +// +// private void upload_sf6_qtyl(Client client, HashMap equipMap) { +// List list = data_sf6_qtylDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询sf6_qtyl的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_SF6_Qtyl item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float temperature = item.getTemperature(); +// if (temperature != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Temperature"); +// attr.setValue(temperature); +// attrlist.add(attr); +// } +// Float absolutepressure = item.getAbsolutepressure(); +// if (absolutepressure != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("AbsolutePressure"); +// attr.setValue(absolutepressure); +// attrlist.add(attr); +// } +// Float density = item.getDensity(); +// if (density != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Density"); +// attr.setValue(density); +// attrlist.add(attr); +// } +// Float pressure20c = item.getPressure20c(); +// if (pressure20c != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Pressure20C"); +// attr.setValue(pressure20c); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTYL, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_sf6_qtylDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到sf6_qtyl的数据"); +// } +// } +// +// private void upload_tx(Client client, HashMap equipMap) { +// List list = data_txDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询tx的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Tx item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float totalcorecurrent = item.getTotalcorecurrent(); +// if (totalcorecurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("TotalCoreCurrent"); +// attr.setValue(totalcorecurrent); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.TX, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_txDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到tx的数据"); +// } +// } +// +// private void upload_ws(Client client, HashMap equipMap) { +// List list = data_wsDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询ws的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Ws item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float moisture = item.getMoisture(); +// if (moisture != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Moisture"); +// attr.setValue(moisture); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.WS, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_wsDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到ws的数据"); +// } +// } +// +// private void upload_ysp(Client client, HashMap equipMap) { +// List list = data_yspDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询ysp的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Ysp item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float h2 = item.getH2(); +// if (h2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("H2"); +// attr.setValue(h2); +// attrlist.add(attr); +// } +// Float ch4 = item.getCh4(); +// if (ch4 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("CH4"); +// attr.setValue(ch4); +// attrlist.add(attr); +// } +// Float c2h6 = item.getC2h6(); +// if (c2h6 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("C2H6"); +// attr.setValue(c2h6); +// attrlist.add(attr); +// } +// Float c2h4 = item.getC2h4(); +// if (c2h4 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("C2H4"); +// attr.setValue(c2h4); +// attrlist.add(attr); +// } +// Float c2h2 = item.getC2h2(); +// if (c2h2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("C2H2"); +// attr.setValue(c2h2); +// attrlist.add(attr); +// } +// Float co = item.getCo(); +// if (co != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("CO"); +// attr.setValue(co); +// attrlist.add(attr); +// } +// Float co2 = item.getCo2(); +// if (co2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("CO2"); +// attr.setValue(co2); +// attrlist.add(attr); +// } +// Float o2 = item.getO2(); +// if (o2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("O2"); +// attr.setValue(o2); +// attrlist.add(attr); +// } +// Float n2 = item.getN2(); +// if (n2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("N2"); +// attr.setValue(n2); +// attrlist.add(attr); +// } +// Float totalhydrocarbon = item.getTotalhydrocarbon(); +// if (totalhydrocarbon != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("TotalHydrocarbon"); +// attr.setValue(totalhydrocarbon); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.YSP, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_yspDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到ysp的数据"); +// } +// } +// +// private void upload_microclimate(Client client, HashMap equipMap) { +// List list = data_microclimateDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询microclimate的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Microclimate item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float airtemperature = item.getAirtemperature(); +// if (airtemperature != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("AirTemperature"); +// attr.setValue(airtemperature); +// attrlist.add(attr); +// } +// Float airpressure = item.getAirpressure(); +// if (airpressure != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("AirPressure"); +// attr.setValue(airpressure); +// attrlist.add(attr); +// } +// Float humidity = item.getHumidity(); +// if (humidity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Humidity"); +// attr.setValue(humidity); +// attrlist.add(attr); +// } +// Float precipitation = item.getPrecipitation(); +// if (precipitation != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Precipitation"); +// attr.setValue(precipitation); +// attrlist.add(attr); +// } +// Float precipitationintensity = item.getPrecipitationintensity(); +// if (precipitationintensity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("PrecipitationIntensity"); +// attr.setValue(precipitationintensity); +// attrlist.add(attr); +// } +// Float radiationintensity = item.getRadiationintensity(); +// if (radiationintensity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("RadiationIntensity"); +// attr.setValue(radiationintensity); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.WQX, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_microclimateDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到microcimate的数据"); +// } +// } +//// if ((index != 0 && index % 19 == 0) || index == (list.size() - 1)) { +//// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +//// Object[] objects = client.invoke("uploadCACData", xml); +//// if (objects != null && objects.length > 0) { +//// String string = String.valueOf(objects[0]); +//// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +//// JSONObject jsonObject = XML.toJSONObject(string); +//// if (jsonObject != null) { +//// JSONObject response = (JSONObject) jsonObject.get("response"); +//// if (response != null) { +//// JSONObject result = (JSONObject) response.get("result"); +//// if (result != null) { +//// Integer code = (Integer) result.get("code"); +//// if (code != null && code.intValue() == 0) { +//// log.info("上传成功"); +//// } else { +//// log.info("上传失败"); +//// if (CollectionUtil.isNotEmpty(failtempidlist)) { +//// failidlist.addAll(failtempidlist); +//// } +//// } +//// } +//// } +//// } +//// } +//// failtempidlist.clear(); +//// cacdatalist.clear(); +//// } +//// if (index == (list.size() - 1)) { +//// BigInteger maxid = item.getId(); +//// data_sf6_qtylDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +//// } +// +//} \ No newline at end of file diff --git a/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImpl.java b/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImpl.java new file mode 100644 index 0000000..31848e0 --- /dev/null +++ b/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImpl.java @@ -0,0 +1,1152 @@ +package com.shxy.i2.serviceimpl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.shxy.i2.Tool.AsyncMethod; +import com.shxy.i2.Tool.GenerateI2Xml; +import com.shxy.i2.bean.AttrBean; +import com.shxy.i2.bean.SendDataBean; +import com.shxy.i2.constant.CommonStatus; +import com.shxy.i2.constant.Constant; +import com.shxy.i2.dao.*; +import com.shxy.i2.entity.*; +import com.shxy.i2.service.XydlI2Service; +import lombok.extern.slf4j.Slf4j; +import org.apache.cxf.endpoint.Client; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +@Service +@Slf4j +public class XydlI2ServiceImpl implements XydlI2Service { + + + @Autowired + private Data_SF6_QtylDao data_sf6_qtylDao; + + @Autowired + private Data_Byq_JbfdDao data_byq_jbfdDao; + + @Autowired + private Data_CnjDao data_cnjDao; + + @Autowired + private Data_DcywDao data_dcywDao; + + @Autowired + private Data_Dlq_JbfdDao data_dlq_jbfdDao; + + @Autowired + private Data_Dr_JyjcDao data_dr_jyjcDao; + + @Autowired + private Data_FhdlbxDao data_fhdlbxDao; + + @Autowired + private Data_FhzxqDao data_fhzxqDao; + + @Autowired + private Data_Jsyhw_JyjcDao data_jsyhw_jyjcDao; + + @Autowired + private Data_SF6_QtsfDao data_sf6_qtsfDao; + + @Autowired + private Data_TxDao data_txDao; + + @Autowired + private Data_WsDao data_wsDao; + + @Autowired + private Data_YspDao data_yspDao; + + @Autowired + private Data_MicroclimateDao data_microclimateDao; + + @Autowired + AsyncMethod asyncMethod; + + + @Override + public void upload_byq_jbfd(Client client, HashMap equipMap) { + List list = data_byq_jbfdDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询byq_jbfd的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + ArrayList list2 = new ArrayList<>(); + ArrayList eqmidlist = new ArrayList<>(); + BigInteger maxid = BigInteger.valueOf(0); + for (int index = 0; index < list.size(); index++) { + Data_Byq_Jbfd item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float dischargecapacity = item.getDischargecapacity(); + if (dischargecapacity != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("DischargeCapacity"); + attr.setValue(dischargecapacity); + attrlist.add(attr); + } + Float dischargeposition = item.getDischargeposition(); + if (dischargeposition != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("DischargePosition"); + attr.setValue(dischargeposition); + attrlist.add(attr); + } + Float pulsecount = item.getPulsecount(); + if (pulsecount != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("PulseCount"); + attr.setValue(pulsecount); + attrlist.add(attr); + } + byte[] dischargewaveform = item.getDischargewaveform(); + if (dischargewaveform != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("DischargeWaveform"); + attr.setValue(dischargewaveform); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.BYQ_JBFD, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + BigInteger id = item.getId(); + idlist.add(id); + SendDataBean sendDataBean = new SendDataBean(); + sendDataBean.setEqmid(item.getEqmid()); + sendDataBean.setMaxid(id); + list2.add(sendDataBean); + eqmidlist.add(item.getEqmid()); + if (id != null) { + int i = id.compareTo(maxid); + if (i == 1) { + maxid = id; + } + } + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); +// asyncMethod.sendJBFDData(client, list2, xml, Constant.BYQ_JBFD); + asyncMethod.sendJBFDData2(client,maxid, eqmidlist, xml, Constant.BYQ_JBFD); + idlist = new ArrayList<>(); + maxid = BigInteger.valueOf(0); + eqmidlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询byq_jbfd的数据量"); + } + } + + @Override + public void upload_cnj(Client client, HashMap equipMap) { + List list = data_cnjDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询byq_jbfd的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_Cnj item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float chargetime = item.getChargetime(); + if (chargetime != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("ChargeTime"); + attr.setValue(chargetime); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.CNJ, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.CNJ); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询cnj的数据量"); + } + } + + @Override + public void upload_dcyw(Client client, HashMap equipMap) { + List list = data_dcywDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询dcyw的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_Dcyw item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float oiltemperature = item.getOiltemperature(); + if (oiltemperature != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("OilTemperature"); + attr.setValue(oiltemperature); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.DCYW, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.DCYW); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询dcyw的数据量"); + } + } + + @Override + public void upload_dlq_jbfd(Client client, HashMap equipMap) { + List list = data_dlq_jbfdDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询dlq_jbfd的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + ArrayList list2 = new ArrayList<>(); + + ArrayList eqmidlist = new ArrayList<>(); + BigInteger maxid = BigInteger.valueOf(0); + for (int index = 0; index < list.size(); index++) { + Data_Dlq_Jbfd item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float dischargecapacity = item.getDischargecapacity(); + if (dischargecapacity != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("DischargeCapacity"); + attr.setValue(dischargecapacity); + attrlist.add(attr); + } + Float dischargeposition = item.getDischargeposition(); + if (dischargeposition != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("DischargePosition"); + attr.setValue(dischargeposition); + attrlist.add(attr); + } + Float pulsecount = item.getPulsecount(); + if (pulsecount != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("PulseCount"); + attr.setValue(pulsecount); + attrlist.add(attr); + } + byte[] dischargewaveform = item.getDischargewaveform(); + if (dischargewaveform != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("DischargeWaveform"); + attr.setValue(dischargewaveform); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.DLQJBFD, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + BigInteger id = item.getId(); + idlist.add(id); + SendDataBean sendDataBean = new SendDataBean(); + sendDataBean.setEqmid(item.getEqmid()); + sendDataBean.setMaxid(id); + list2.add(sendDataBean); + eqmidlist.add(item.getEqmid()); + if (id != null) { + int i = id.compareTo(maxid); + if (i == 1) { + maxid = id; + } + } + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); +// asyncMethod.sendJBFDData(client, list2, xml, Constant.DLQJBFD); + asyncMethod.sendJBFDData2(client,maxid, eqmidlist, xml, Constant.DLQJBFD); + maxid = BigInteger.valueOf(0); + eqmidlist = new ArrayList<>(); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询到dlq的数据"); + } + } + + @Override + public void upload_dr_jyjc(Client client, HashMap equipMap) { + List list = data_dr_jyjcDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询dr_jyjc的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_Dr_Jyjc item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float capacitance = item.getCapacitance(); + if (capacitance != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Capacitance"); + attr.setValue(capacitance); + attrlist.add(attr); + } + Float lossfactor = item.getLossfactor(); + if (lossfactor != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("LossFactor"); + attr.setValue(lossfactor); + attrlist.add(attr); + } + Float unbalancecurrent = item.getUnbalancecurrent(); + if (unbalancecurrent != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("UnbalanceCurrent"); + attr.setValue(unbalancecurrent); + attrlist.add(attr); + } + Float unbalancevoltage = item.getUnbalancevoltage(); + if (unbalancevoltage != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("UnbalanceVoltage"); + attr.setValue(unbalancevoltage); + attrlist.add(attr); + } + Float totalcurrent = item.getTotalcurrent(); + if (totalcurrent != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("TotalCurrent"); + attr.setValue(totalcurrent); + attrlist.add(attr); + } + Float systemvoltage = item.getSystemvoltage(); + if (systemvoltage != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("SystemVoltage"); + attr.setValue(systemvoltage); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.DRJYJC, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.DRJYJC); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询dr_jyjc的数据量"); + } + } + + @Override + public void upload_fhdlbx(Client client, HashMap equipMap) { + List list = data_fhdlbxDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询fhdlbx的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_Fhdlbx item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Integer action = item.getAction(); + if (action != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Action"); + attr.setValue(action); + attrlist.add(attr); + } + byte[] loadwaveform = item.getLoadwaveform(); + if (loadwaveform != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("LoadWaveform"); + attr.setValue(loadwaveform); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.FHDLBX, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.FHDLBX); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询fhdlbx的数据量"); + } + } + + @Override + public void upload_fhzxq(Client client, HashMap equipMap) { + List list = data_fhzxqDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询fhzxq的数据量:" + list.size()); + ArrayList idlist = new ArrayList<>(); + ArrayList cacdatalist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_Fhzxq item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Integer action = item.getAction(); + if (action != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Action"); + attr.setValue(action); + attrlist.add(attr); + } + byte[] coilwaveform = item.getCoilwaveform(); + if (coilwaveform != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("CoilWaveform"); + attr.setValue(coilwaveform); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.FHZXQ, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.FHZXQ); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询fhzxq的数据量"); + } + } + + @Override + public void upload_jsyhw_jyjc(Client client, HashMap equipMap) { + List list = data_jsyhw_jyjcDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询jsyhw_jyjc的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_Jsyhw_Jyjc item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float systemvoltage = item.getSystemvoltage(); + if (systemvoltage != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("SystemVoltage"); + attr.setValue(systemvoltage); + attrlist.add(attr); + } + Float totalcurrent = item.getTotalcurrent(); + if (totalcurrent != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("TotalCurrent"); + attr.setValue(totalcurrent); + attrlist.add(attr); + } + Float resistivecurrent = item.getResistivecurrent(); + if (resistivecurrent != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("ResistiveCurrent"); + attr.setValue(resistivecurrent); + attrlist.add(attr); + } + Float actioncount = item.getActioncount(); + if (actioncount != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("ActionCount"); + attr.setValue(actioncount); + attrlist.add(attr); + } + Date lastactiontime = item.getLastactiontime(); + if (lastactiontime != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("LastActionTime"); + attr.setValue(DateUtil.format(lastactiontime, DatePattern.NORM_DATETIME_PATTERN)); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.JSYHW, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.JSYHW); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询jsyhw_jyjc的数据量"); + } + } + + @Override + public void upload_sf6_qtsf(Client client, HashMap equipMap) { + List list = data_sf6_qtsfDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询sf6_qtsf的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_SF6_Qtsf item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float temperature = item.getTemperature(); + if (temperature != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Temperature"); + attr.setValue(temperature); + attrlist.add(attr); + } + Float moisture = item.getMoisture(); + if (moisture != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Moisture"); + attr.setValue(moisture); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTSF, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.SF6_QTSF); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询sf6_qtsf的数据量"); + } + } + + @Override + public void upload_sf6_qtyl(Client client, HashMap equipMap) { + List list = data_sf6_qtylDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询sf6_qtyl的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_SF6_Qtyl item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float temperature = item.getTemperature(); + if (temperature != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Temperature"); + attr.setValue(temperature); + attrlist.add(attr); + } + Float absolutepressure = item.getAbsolutepressure(); + if (absolutepressure != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("AbsolutePressure"); + attr.setValue(absolutepressure); + attrlist.add(attr); + } + Float density = item.getDensity(); + if (density != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Density"); + attr.setValue(density); + attrlist.add(attr); + } + Float pressure20c = item.getPressure20c(); + if (pressure20c != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Pressure20C"); + attr.setValue(pressure20c); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTYL, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.SF6_QTYL); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询到sf6_qtyl的数据"); + } + } + + @Override + public void upload_tx(Client client, HashMap equipMap) { + List list = data_txDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询tx的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_Tx item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float totalcorecurrent = item.getTotalcorecurrent(); + if (totalcorecurrent != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("TotalCoreCurrent"); + attr.setValue(totalcorecurrent); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.TX, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.TX); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询到tx的数据"); + } + } + + @Override + public void upload_ws(Client client, HashMap equipMap) { + List list = data_wsDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询ws的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_Ws item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float moisture = item.getMoisture(); + if (moisture != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Moisture"); + attr.setValue(moisture); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.WS, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.WS); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询到ws的数据"); + } + } + + @Override + public void upload_ysp(Client client, HashMap equipMap) { + List list = data_yspDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询ysp的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + ArrayList list2 = new ArrayList<>(); + + ArrayList eqmidlist = new ArrayList<>(); + BigInteger maxid = BigInteger.valueOf(0); + for (int index = 0; index < list.size(); index++) { + Data_Ysp item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float h2 = item.getH2(); + if (h2 != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("H2"); + attr.setValue(h2); + attrlist.add(attr); + } + Float ch4 = item.getCh4(); + if (ch4 != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("CH4"); + attr.setValue(ch4); + attrlist.add(attr); + } + Float c2h6 = item.getC2h6(); + if (c2h6 != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("C2H6"); + attr.setValue(c2h6); + attrlist.add(attr); + } + Float c2h4 = item.getC2h4(); + if (c2h4 != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("C2H4"); + attr.setValue(c2h4); + attrlist.add(attr); + } + Float c2h2 = item.getC2h2(); + if (c2h2 != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("C2H2"); + attr.setValue(c2h2); + attrlist.add(attr); + } + Float co = item.getCo(); + if (co != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("CO"); + attr.setValue(co); + attrlist.add(attr); + } + Float co2 = item.getCo2(); + if (co2 != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("CO2"); + attr.setValue(co2); + attrlist.add(attr); + } + Float o2 = item.getO2(); + if (o2 != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("O2"); + attr.setValue(o2); + attrlist.add(attr); + } + Float n2 = item.getN2(); + if (n2 != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("N2"); + attr.setValue(n2); + attrlist.add(attr); + } + Float totalhydrocarbon = item.getTotalhydrocarbon(); + if (totalhydrocarbon != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("TotalHydrocarbon"); + attr.setValue(totalhydrocarbon); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.YSP, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + BigInteger id = item.getId(); + idlist.add(id); + + SendDataBean sendDataBean = new SendDataBean(); + sendDataBean.setEqmid(item.getEqmid()); + sendDataBean.setMaxid(id); + list2.add(sendDataBean); + eqmidlist.add(item.getEqmid()); + if (id != null) { + int i = id.compareTo(maxid); + if (i == 1) { + maxid = id; + } + } + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); +// asyncMethod.sendJBFDData(client, list2, xml, Constant.YSP); + asyncMethod.sendJBFDData2(client,maxid, eqmidlist, xml, Constant.YSP); + maxid = BigInteger.valueOf(0); + eqmidlist = new ArrayList<>(); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询到ysp的数据"); + } + } + + @Override + public void upload_microclimate(Client client, HashMap equipMap) { + List list = data_microclimateDao.selectUpload(CommonStatus.UNUPLOAD.value()); + if (CollectionUtil.isNotEmpty(list)) { + log.info("查询microclimate的数据量:" + list.size()); + ArrayList cacdatalist = new ArrayList<>(); + ArrayList idlist = new ArrayList<>(); + for (int index = 0; index < list.size(); index++) { + Data_Microclimate item = list.get(index); + Niec_Sensors sensors = equipMap.get(item.getEqmid()); + String sensorid = sensors.getSensorCode(); + String equipmentid = sensors.getEquipmentId(); + String phase = sensors.getPhase(); + if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { + ArrayList attrlist = new ArrayList<>(); + try { + String timestamp = ""; + Date acquisitiontime = item.getAcquisitiontime(); + if (acquisitiontime != null) { + timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); + } + if (phase != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Phase"); + attr.setValue(phase); + attrlist.add(attr); + } + Float airtemperature = item.getAirtemperature(); + if (airtemperature != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("AirTemperature"); + attr.setValue(airtemperature); + attrlist.add(attr); + } + Float airpressure = item.getAirpressure(); + if (airpressure != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("AirPressure"); + attr.setValue(airpressure); + attrlist.add(attr); + } + Float humidity = item.getHumidity(); + if (humidity != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Humidity"); + attr.setValue(humidity); + attrlist.add(attr); + } + Float precipitation = item.getPrecipitation(); + if (precipitation != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("Precipitation"); + attr.setValue(precipitation); + attrlist.add(attr); + } + Float precipitationintensity = item.getPrecipitationintensity(); + if (precipitationintensity != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("PrecipitationIntensity"); + attr.setValue(precipitationintensity); + attrlist.add(attr); + } + Float radiationintensity = item.getRadiationintensity(); + if (radiationintensity != null) { + AttrBean attr = new AttrBean<>(); + attr.setKey("RadiationIntensity"); + attr.setValue(radiationintensity); + attrlist.add(attr); + } + String cacdata = GenerateI2Xml.generateCacXml(Constant.WQX, sensorid, equipmentid, timestamp, attrlist); + cacdatalist.add(cacdata); + idlist.add(item.getId()); + if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { + ArrayList list1 = new ArrayList<>(); + String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); + list1.addAll(idlist); + asyncMethod.sendData(client, list1, xml, Constant.WQX); + idlist = new ArrayList<>(); + cacdatalist = new ArrayList<>(); + } + } catch (Exception e) { + log.error("抛出了异常:{}" + e.getMessage()); + } + } + } + } else { + log.info("没有查询到microcimate的数据"); + } + } +} diff --git a/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImplbakkk.java b/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImplbakkk.java new file mode 100644 index 0000000..33716f6 --- /dev/null +++ b/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImplbakkk.java @@ -0,0 +1,1476 @@ +//package com.shxy.i2.serviceimpl; +// +//import cn.hutool.core.collection.CollectionUtil; +//import cn.hutool.core.date.DatePattern; +//import cn.hutool.core.date.DateUtil; +//import cn.hutool.core.util.StrUtil; +//import cn.hutool.json.JSONObject; +//import cn.hutool.json.XML; +//import com.shxy.i2.Tool.AsyncMethod; +//import com.shxy.i2.Tool.GenerateI2Xml; +//import com.shxy.i2.bean.AttrBean; +//import com.shxy.i2.bean.SendDataBean; +//import com.shxy.i2.constant.CommonStatus; +//import com.shxy.i2.constant.Constant; +//import com.shxy.i2.dao.*; +//import com.shxy.i2.entity.*; +//import com.shxy.i2.service.XydlI2Service; +//import lombok.extern.slf4j.Slf4j; +//import org.apache.cxf.endpoint.Client; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +// +//import java.math.BigInteger; +//import java.util.ArrayList; +//import java.util.Date; +//import java.util.HashMap; +//import java.util.List; +// +//@Service +//@Slf4j +//public class XydlI2ServiceImplbakkk implements XydlI2Service { +// +// +// @Autowired +// private Data_SF6_QtylDao data_sf6_qtylDao; +// +// @Autowired +// private Data_Byq_JbfdDao data_byq_jbfdDao; +// +// @Autowired +// private Data_CnjDao data_cnjDao; +// +// @Autowired +// private Data_DcywDao data_dcywDao; +// +// @Autowired +// private Data_Dlq_JbfdDao data_dlq_jbfdDao; +// +// @Autowired +// private Data_Dr_JyjcDao data_dr_jyjcDao; +// +// @Autowired +// private Data_FhdlbxDao data_fhdlbxDao; +// +// @Autowired +// private Data_FhzxqDao data_fhzxqDao; +// +// @Autowired +// private Data_Jsyhw_JyjcDao data_jsyhw_jyjcDao; +// +// @Autowired +// private Data_SF6_QtsfDao data_sf6_qtsfDao; +// +// @Autowired +// private Data_TxDao data_txDao; +// +// @Autowired +// private Data_WsDao data_wsDao; +// +// @Autowired +// private Data_YspDao data_yspDao; +// +// @Autowired +// private Data_MicroclimateDao data_microclimateDao; +// +// @Autowired +// AsyncMethod asyncMethod; +// +// private static String address = "http://localhost:8080/myService/api?wsdl"; +// +// @Override +// public void upload_byq_jbfd(Client client, HashMap equipMap) { +// List list = data_byq_jbfdDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询byq_jbfd的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList idlist = new ArrayList<>(); +// ArrayList senddatalist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Byq_Jbfd item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float dischargecapacity = item.getDischargecapacity(); +// if (dischargecapacity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargeCapacity"); +// attr.setValue(dischargecapacity); +// attrlist.add(attr); +// } +// Float dischargeposition = item.getDischargeposition(); +// if (dischargeposition != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargePosition"); +// attr.setValue(dischargeposition); +// attrlist.add(attr); +// } +// Float pulsecount = item.getPulsecount(); +// if (pulsecount != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("PulseCount"); +// attr.setValue(pulsecount); +// attrlist.add(attr); +// } +// byte[] dischargewaveform = item.getDischargewaveform(); +// if (dischargewaveform != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargeWaveform"); +// attr.setValue(dischargewaveform); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.BYQ_JBFD, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +//// send(client, idlist, xml); +// asyncMethod.sendData(client, idlist, xml, Constant.BYQ_JBFD); +// +// idlist.clear(); +// cacdatalist.clear(); +// } +// +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询byq_jbfd的数据量"); +// } +// } +// +// @Override +// public void upload_cnj(Client client, HashMap equipMap) { +// List list = data_cnjDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询byq_jbfd的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList idlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Cnj item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float chargetime = item.getChargetime(); +// if (chargetime != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("ChargeTime"); +// attr.setValue(chargetime); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.CNJ, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +//// send(client, idlist, xml); +// idlist.clear(); +// cacdatalist.clear(); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询cnj的数据量"); +// } +// } +// +// @Override +// public void upload_dcyw(Client client, HashMap equipMap) { +// List list = data_dcywDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询dcyw的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// +// for (int index = 0; index < list.size(); index++) { +// Data_Dcyw item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float oiltemperature = item.getOiltemperature(); +// if (oiltemperature != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("OilTemperature"); +// attr.setValue(oiltemperature); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.DCYW, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_dcywDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询dcyw的数据量"); +// } +// } +// +// @Override +// public void upload_dlq_jbfd(Client client, HashMap equipMap) { +// List list = data_dlq_jbfdDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询dlq_jbfd的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList idlist = new ArrayList<>(); +// ArrayList senddatalist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Dlq_Jbfd item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float dischargecapacity = item.getDischargecapacity(); +// if (dischargecapacity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargeCapacity"); +// attr.setValue(dischargecapacity); +// attrlist.add(attr); +// } +// Float dischargeposition = item.getDischargeposition(); +// if (dischargeposition != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargePosition"); +// attr.setValue(dischargeposition); +// attrlist.add(attr); +// } +// Float pulsecount = item.getPulsecount(); +// if (pulsecount != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("PulseCount"); +// attr.setValue(pulsecount); +// attrlist.add(attr); +// } +// byte[] dischargewaveform = item.getDischargewaveform(); +// if (dischargewaveform != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("DischargeWaveform"); +// attr.setValue(dischargewaveform); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.DLQJBFD, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// idlist.add(item.getId()); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// +// ArrayList list1 = new ArrayList<>(); +// list1.addAll(idlist); +// SendDataBean data = new SendDataBean(); +// data.setKey(xml); +// data.setIdlist(list1); +// senddatalist.add(data); +//// sendSF6_qtyl(client, idlist, xml); +// idlist.clear(); +// cacdatalist.clear(); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// log.info("dlq需要执行的数据量:" + senddatalist.size()); +// int num = 1; +// for (SendDataBean xml : senddatalist) { +// num++; +// try { +//// asyncMethod.sendData(client, xml.getIdlist(), xml.getKey(), num); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// } else { +// log.info("没有查询到dlq的数据"); +// } +// } +// +// // @Override +//// public void test(String string) { +//// log.info("开始执行定时任务-查询数据库"); +//// HashMap equipMap = new HashMap(); +//// List niec_sensors = niec_sensorsDao.selectAll(); +//// for (Niec_Sensors item : niec_sensors) { +//// equipMap.put(item.getId(), item); +//// } +//// List list = data_sf6_qtylDao.selectUpload(CommonStatus.UNUPLOAD.value()); +//// if (CollectionUtil.isNotEmpty(list)) { +//// log.info("查询sf6_qtyl的数据量:" + list.size()); +//// ArrayList cacdatalist = new ArrayList<>(); +//// ArrayList idlist = new ArrayList<>(); +//// ArrayList senddatalist = new ArrayList<>(); +//// for (int index = 0; index < list.size(); index++) { +//// Data_SF6_Qtyl item = list.get(index); +//// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +//// String sensorid = sensors.getSensorCode(); +//// String equipmentid = sensors.getEquipmentId(); +//// String phase = sensors.getPhase(); +//// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +//// ArrayList attrlist = new ArrayList<>(); +//// try { +//// String timestamp = ""; +//// Date acquisitiontime = item.getAcquisitiontime(); +//// if (acquisitiontime != null) { +//// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +//// } +//// if (phase != null) { +//// AttrBean attr = new AttrBean<>(); +//// attr.setKey("Phase"); +//// attr.setValue(phase); +//// attrlist.add(attr); +//// } +//// Float temperature = item.getTemperature(); +//// if (temperature != null) { +//// AttrBean attr = new AttrBean<>(); +//// attr.setKey("Temperature"); +//// attr.setValue(temperature); +//// attrlist.add(attr); +//// } +//// Float absolutepressure = item.getAbsolutepressure(); +//// if (absolutepressure != null) { +//// AttrBean attr = new AttrBean<>(); +//// attr.setKey("AbsolutePressure"); +//// attr.setValue(absolutepressure); +//// attrlist.add(attr); +//// } +//// Float density = item.getDensity(); +//// if (density != null) { +//// AttrBean attr = new AttrBean<>(); +//// attr.setKey("Density"); +//// attr.setValue(density); +//// attrlist.add(attr); +//// } +//// Float pressure20c = item.getPressure20c(); +//// if (pressure20c != null) { +//// AttrBean attr = new AttrBean<>(); +//// attr.setKey("Pressure20C"); +//// attr.setValue(pressure20c); +//// attrlist.add(attr); +//// } +//// String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTYL, sensorid, equipmentid, timestamp, attrlist); +//// cacdatalist.add(cacdata); +//// idlist.add(item.getId()); +//// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +//// +//// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +//// ArrayList list1 = new ArrayList<>(); +//// list1.addAll(idlist); +////// BeanUtil.copyProperties(idlist, list1); +//// SendDataBean data = new SendDataBean(); +//// data.setKey(xml); +//// data.setIdlist(list1); +//// senddatalist.add(data); +//// idlist.clear(); +//// cacdatalist.clear(); +//// } +//// } catch (Exception e) { +//// log.error("抛出了异常:{}" + e.getMessage()); +//// } +//// } +//// } +//// +//// log.info("sf6需要执行的数据量:" + senddatalist.size()); +//// int num = 1; +//// for (SendDataBean xml : senddatalist) { +//// num++; +//// try { +////// asyncMethod.sendSF6_qtyl( xml.getIdlist(), xml.getKey(),num); +//// } catch (Exception e) { +//// e.printStackTrace(); +//// } +//// } +//// +//// } else { +//// log.info("没有查询到sf6_qtyl的数据"); +//// } +//// } +// @Override +// public void upload_dr_jyjc(Client client, HashMap equipMap) { +// List list = data_dr_jyjcDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询dr_jyjc的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Dr_Jyjc item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float capacitance = item.getCapacitance(); +// if (capacitance != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Capacitance"); +// attr.setValue(capacitance); +// attrlist.add(attr); +// } +// Float lossfactor = item.getLossfactor(); +// if (lossfactor != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("LossFactor"); +// attr.setValue(lossfactor); +// attrlist.add(attr); +// } +// Float unbalancecurrent = item.getUnbalancecurrent(); +// if (unbalancecurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("UnbalanceCurrent"); +// attr.setValue(unbalancecurrent); +// attrlist.add(attr); +// } +// Float unbalancevoltage = item.getUnbalancevoltage(); +// if (unbalancevoltage != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("UnbalanceVoltage"); +// attr.setValue(unbalancevoltage); +// attrlist.add(attr); +// } +// Float totalcurrent = item.getTotalcurrent(); +// if (totalcurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("TotalCurrent"); +// attr.setValue(totalcurrent); +// attrlist.add(attr); +// } +// Float systemvoltage = item.getSystemvoltage(); +// if (systemvoltage != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("SystemVoltage"); +// attr.setValue(systemvoltage); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.DRJYJC, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_dr_jyjcDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询dr_jyjc的数据量"); +// } +// } +// +// @Override +// public void upload_fhdlbx(Client client, HashMap equipMap) { +// List list = data_fhdlbxDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询fhdlbx的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Fhdlbx item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Integer action = item.getAction(); +// if (action != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Action"); +// attr.setValue(action); +// attrlist.add(attr); +// } +// byte[] loadwaveform = item.getLoadwaveform(); +// if (loadwaveform != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("LoadWaveform"); +// attr.setValue(loadwaveform); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.FHDLBX, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_fhdlbxDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询fhdlbx的数据量"); +// } +// } +// +// @Override +// public void upload_fhzxq(Client client, HashMap equipMap) { +// List list = data_fhzxqDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询fhzxq的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Fhzxq item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Integer action = item.getAction(); +// if (action != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Action"); +// attr.setValue(action); +// attrlist.add(attr); +// } +// byte[] coilwaveform = item.getCoilwaveform(); +// if (coilwaveform != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("CoilWaveform"); +// attr.setValue(coilwaveform); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.FHZXQ, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_fhzxqDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询fhzxq的数据量"); +// } +// } +// +// @Override +// public void upload_jsyhw_jyjc(Client client, HashMap equipMap) { +// List list = data_jsyhw_jyjcDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询jsyhw_jyjc的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Jsyhw_Jyjc item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float systemvoltage = item.getSystemvoltage(); +// if (systemvoltage != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("SystemVoltage"); +// attr.setValue(systemvoltage); +// attrlist.add(attr); +// } +// Float totalcurrent = item.getTotalcurrent(); +// if (totalcurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("TotalCurrent"); +// attr.setValue(totalcurrent); +// attrlist.add(attr); +// } +// Float resistivecurrent = item.getResistivecurrent(); +// if (resistivecurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("ResistiveCurrent"); +// attr.setValue(resistivecurrent); +// attrlist.add(attr); +// } +// Float actioncount = item.getActioncount(); +// if (actioncount != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("ActionCount"); +// attr.setValue(actioncount); +// attrlist.add(attr); +// } +// Date lastactiontime = item.getLastactiontime(); +// if (lastactiontime != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("LastActionTime"); +// attr.setValue(DateUtil.format(lastactiontime, DatePattern.NORM_DATETIME_PATTERN)); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.JSYHW, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// +// +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_jsyhw_jyjcDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询jsyhw_jyjc的数据量"); +// } +// } +// +// @Override +// public void upload_sf6_qtsf(Client client, HashMap equipMap) { +// List list = data_sf6_qtsfDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询sf6_qtsf的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_SF6_Qtsf item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float temperature = item.getTemperature(); +// if (temperature != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Temperature"); +// attr.setValue(temperature); +// attrlist.add(attr); +// } +// Float moisture = item.getMoisture(); +// if (moisture != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Moisture"); +// attr.setValue(moisture); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTSF, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_sf6_qtsfDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询sf6_qtsf的数据量"); +// } +// } +// +// @Override +// public void upload_sf6_qtyl(Client client, HashMap equipMap) { +// List list = data_sf6_qtylDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询sf6_qtyl的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList idlist = new ArrayList<>(); +// ArrayList senddatalist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_SF6_Qtyl item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float temperature = item.getTemperature(); +// if (temperature != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Temperature"); +// attr.setValue(temperature); +// attrlist.add(attr); +// } +// Float absolutepressure = item.getAbsolutepressure(); +// if (absolutepressure != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("AbsolutePressure"); +// attr.setValue(absolutepressure); +// attrlist.add(attr); +// } +// Float density = item.getDensity(); +// if (density != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Density"); +// attr.setValue(density); +// attrlist.add(attr); +// } +// Float pressure20c = item.getPressure20c(); +// if (pressure20c != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Pressure20C"); +// attr.setValue(pressure20c); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTYL, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// idlist.add(item.getId()); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// ArrayList list1 = new ArrayList<>(); +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// list1.addAll(idlist); +// SendDataBean data = new SendDataBean(); +// data.setKey(xml); +// data.setIdlist(list1); +// +// asyncMethod.sendData(client, list1, xml, Constant.SF6_QTYL); +// senddatalist.add(data); +// idlist.clear(); +// cacdatalist.clear(); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +//// log.info("sf6需要执行的数据量:" + senddatalist.size()); +//// int num = 1; +//// for (SendDataBean xml : senddatalist) { +//// num++; +//// try { +//// asyncMethod.sendData(client, xml.getIdlist(), xml.getKey(), Constant.SF6_QTYL); +//// } catch (Exception e) { +//// e.printStackTrace(); +//// } +//// } +// +// } else { +// log.info("没有查询到sf6_qtyl的数据"); +// } +// } +// +// @Override +// public void upload_tx(Client client, HashMap equipMap) { +// List list = data_txDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询tx的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Tx item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float totalcorecurrent = item.getTotalcorecurrent(); +// if (totalcorecurrent != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("TotalCoreCurrent"); +// attr.setValue(totalcorecurrent); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.TX, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_txDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到tx的数据"); +// } +// } +// +// @Override +// public void upload_ws(Client client, HashMap equipMap) { +// List list = data_wsDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询ws的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Ws item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float moisture = item.getMoisture(); +// if (moisture != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Moisture"); +// attr.setValue(moisture); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.WS, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_wsDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到ws的数据"); +// } +// } +// +// @Override +// public void upload_ysp(Client client, HashMap equipMap) { +// List list = data_yspDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询ysp的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Ysp item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float h2 = item.getH2(); +// if (h2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("H2"); +// attr.setValue(h2); +// attrlist.add(attr); +// } +// Float ch4 = item.getCh4(); +// if (ch4 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("CH4"); +// attr.setValue(ch4); +// attrlist.add(attr); +// } +// Float c2h6 = item.getC2h6(); +// if (c2h6 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("C2H6"); +// attr.setValue(c2h6); +// attrlist.add(attr); +// } +// Float c2h4 = item.getC2h4(); +// if (c2h4 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("C2H4"); +// attr.setValue(c2h4); +// attrlist.add(attr); +// } +// Float c2h2 = item.getC2h2(); +// if (c2h2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("C2H2"); +// attr.setValue(c2h2); +// attrlist.add(attr); +// } +// Float co = item.getCo(); +// if (co != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("CO"); +// attr.setValue(co); +// attrlist.add(attr); +// } +// Float co2 = item.getCo2(); +// if (co2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("CO2"); +// attr.setValue(co2); +// attrlist.add(attr); +// } +// Float o2 = item.getO2(); +// if (o2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("O2"); +// attr.setValue(o2); +// attrlist.add(attr); +// } +// Float n2 = item.getN2(); +// if (n2 != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("N2"); +// attr.setValue(n2); +// attrlist.add(attr); +// } +// Float totalhydrocarbon = item.getTotalhydrocarbon(); +// if (totalhydrocarbon != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("TotalHydrocarbon"); +// attr.setValue(totalhydrocarbon); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.YSP, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_yspDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到ysp的数据"); +// } +// } +// +// @Override +// public void upload_microclimate(Client client, HashMap equipMap) { +// List list = data_microclimateDao.selectUpload(CommonStatus.UNUPLOAD.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// log.info("查询microclimate的数据量:" + list.size()); +// ArrayList cacdatalist = new ArrayList<>(); +// ArrayList failidlist = new ArrayList<>(); +// ArrayList failtempidlist = new ArrayList<>(); +// for (int index = 0; index < list.size(); index++) { +// Data_Microclimate item = list.get(index); +// Niec_Sensors sensors = equipMap.get(item.getEqmid()); +// String sensorid = sensors.getSensorCode(); +// String equipmentid = sensors.getEquipmentId(); +// String phase = sensors.getPhase(); +// if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) { +// ArrayList attrlist = new ArrayList<>(); +// try { +// String timestamp = ""; +// Date acquisitiontime = item.getAcquisitiontime(); +// if (acquisitiontime != null) { +// timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN); +// } +// if (phase != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Phase"); +// attr.setValue(phase); +// attrlist.add(attr); +// } +// Float airtemperature = item.getAirtemperature(); +// if (airtemperature != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("AirTemperature"); +// attr.setValue(airtemperature); +// attrlist.add(attr); +// } +// Float airpressure = item.getAirpressure(); +// if (airpressure != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("AirPressure"); +// attr.setValue(airpressure); +// attrlist.add(attr); +// } +// Float humidity = item.getHumidity(); +// if (humidity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Humidity"); +// attr.setValue(humidity); +// attrlist.add(attr); +// } +// Float precipitation = item.getPrecipitation(); +// if (precipitation != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("Precipitation"); +// attr.setValue(precipitation); +// attrlist.add(attr); +// } +// Float precipitationintensity = item.getPrecipitationintensity(); +// if (precipitationintensity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("PrecipitationIntensity"); +// attr.setValue(precipitationintensity); +// attrlist.add(attr); +// } +// Float radiationintensity = item.getRadiationintensity(); +// if (radiationintensity != null) { +// AttrBean attr = new AttrBean<>(); +// attr.setKey("RadiationIntensity"); +// attr.setValue(radiationintensity); +// attrlist.add(attr); +// } +// String cacdata = GenerateI2Xml.generateCacXml(Constant.WQX, sensorid, equipmentid, timestamp, attrlist); +// cacdatalist.add(cacdata); +// if ((index != 0 && index % 79 == 0) || index == (list.size() - 1)) { +// String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); +// Object[] objects = client.invoke("uploadCACData", xml); +// if (objects != null && objects.length > 0) { +// String string = String.valueOf(objects[0]); +// log.info("返回的长度 : " + objects.length + " 返回的对象 : " + string); +// JSONObject jsonObject = XML.toJSONObject(string); +// if (jsonObject != null) { +// JSONObject response = (JSONObject) jsonObject.get("response"); +// if (response != null) { +// JSONObject result = (JSONObject) response.get("result"); +// if (result != null) { +// Integer code = (Integer) result.get("code"); +// if (code != null && code.intValue() == 0) { +// log.info("上传成功"); +// } else { +// log.info("上传失败"); +// if (CollectionUtil.isNotEmpty(failtempidlist)) { +// failidlist.addAll(failtempidlist); +// } +// } +// } +// } +// } +// } +// failtempidlist.clear(); +// cacdatalist.clear(); +// } +// if (index == (list.size() - 1)) { +// BigInteger maxid = item.getId(); +// data_microclimateDao.updateByPrimaryKey(CommonStatus.UPLOAD.value(), maxid, failidlist, new Date()); +// } +// +// } catch (Exception e) { +// log.error("抛出了异常:{}" + e.getMessage()); +// } +// } +// } +// } else { +// log.info("没有查询到microcimate的数据"); +// } +// } +//} diff --git a/src/main/java/com/shxy/i2/timeTask/ScheduledTask.java b/src/main/java/com/shxy/i2/timeTask/ScheduledTask.java new file mode 100644 index 0000000..9cc5f4e --- /dev/null +++ b/src/main/java/com/shxy/i2/timeTask/ScheduledTask.java @@ -0,0 +1,58 @@ +package com.shxy.i2.timeTask; + +import com.shxy.i2.service.Webservcies; +import com.shxy.i2.service.XydlI2Service; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +/** + * @author jingjing + * @date 2023-11-16 15:06 + */ +@Component +@EnableScheduling +@Slf4j +@EnableAsync +public class ScheduledTask { + + + @Autowired + Webservcies webservcies; + + @Async(value = "asyncServiceExecutor") + @Scheduled(fixedDelay = 60 * 60 * 1000) + public void cacyspupload() { + webservcies.uploadyspData(); + } + + @Async(value = "asyncServiceExecutor") + @Scheduled(fixedDelay = 10 * 60 * 1000) + public void cacjfjcupload() { + webservcies.uploadjfjcData(); + } + + // @Scheduled(cron = "0 0/1 * * * ?") + @Scheduled(fixedDelay = 5 * 30 * 1000) + public void cacupload() { + webservcies.uploadData(); +// String str = "aaaa"; +// webservcies.test(str); + } + + // + // @Scheduled(cron = "0 * * * * ?") +// @Async(value = "asyncServiceExecutor") + + +// @Async(value = "asyncServiceExecutor") +// @Scheduled(fixedDelay = 10 * 60 * 1000) +// public void cacjfjcupload() { + +// webservcies.uploadjfjcData(); +// } +} diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 0000000..10f8deb --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,43 @@ +# Spring配置 +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/iec104?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: 123456 + type: com.alibaba.druid.pool.DruidDataSource + +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为8080 + port: 8094 + servlet: + # 应用的访问路径 + context-path: /api + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # 连接数满后的排队数,默认为100 + accept-count: 1000 + max-swallow-size: -1 # tomcat默认大小2M,超过2M的文件不会被捕获,需要调整此处大小为100MB或者-1即可 + threads: + # tomcat最大线程数,默认为200 + max: 800 + # Tomcat启动初始化的线程数,默认值10 + min-spare: 100 + +# 日志配置 +logging: + config: classpath:log4j2.xml + level: + com.shxy: trace + org.springframework: warn + +# MyBatis配置 +mybatis: + # 搜索指定包别名 + type-aliases-package: com.shxy.**.model + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapper-locations: classpath*:mappers/**/*Dao.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..6b51374 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,4 @@ +# Spring配置 +spring: + profiles: + active: test diff --git a/src/main/resources/generatorConfig.xml b/src/main/resources/generatorConfig.xml new file mode 100644 index 0000000..1d20e50 --- /dev/null +++ b/src/main/resources/generatorConfig.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
\ No newline at end of file diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml new file mode 100644 index 0000000..b16e25c --- /dev/null +++ b/src/main/resources/log4j2.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_Byq_JbfdDao.xml b/src/main/resources/mappers/Data_Byq_JbfdDao.xml new file mode 100644 index 0000000..be574bf --- /dev/null +++ b/src/main/resources/mappers/Data_Byq_JbfdDao.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, dischargeCapacity, dischargePosition, pulseCount, isupload, dischargeWaveform, + create_time, update_time + + + + + update data_byq_jbfd + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + update data_byq_jbfd + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + + + + + update data_byq_jbfd + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where isupload is null + + and ( + + ( + + eqmid = #{item.eqmid} + + + and id #{item.maxid} + + ) + + ) + + + + + + update data_byq_jbfd + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where isupload is null + and id #{maxid} + + and eqmid in + + #{id} + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_CnjDao.xml b/src/main/resources/mappers/Data_CnjDao.xml new file mode 100644 index 0000000..279d00e --- /dev/null +++ b/src/main/resources/mappers/Data_CnjDao.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + id, eqmid, acquisitionTime, chargeTime, isupload, create_time, update_time + + + + update data_cnj + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + + update data_cnj + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_DcywDao.xml b/src/main/resources/mappers/Data_DcywDao.xml new file mode 100644 index 0000000..1965475 --- /dev/null +++ b/src/main/resources/mappers/Data_DcywDao.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + id, eqmid, acquisitionTime, oilTemperature, isupload, create_time, update_time + + + + update data_dcyw + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + update data_dcyw + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_Dlq_JbfdDao.xml b/src/main/resources/mappers/Data_Dlq_JbfdDao.xml new file mode 100644 index 0000000..525b99f --- /dev/null +++ b/src/main/resources/mappers/Data_Dlq_JbfdDao.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, phase, dischargeCapacity, dischargePosition, pulseCount, dischargeWaveform, + isupload, create_time, update_time + + + + update data_dlq_jbfd + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + update data_dlq_jbfd + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + + + + update data_dlq_jbfd + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where isupload is null + + and ( + + ( + + eqmid = #{item.eqmid} + + + and id #{item.maxid} + + ) + + ) + + + + + + update data_dlq_jbfd + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where isupload is null + and id #{maxid} + + and eqmid in + + #{id} + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_Dr_JyjcDao.xml b/src/main/resources/mappers/Data_Dr_JyjcDao.xml new file mode 100644 index 0000000..c551914 --- /dev/null +++ b/src/main/resources/mappers/Data_Dr_JyjcDao.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, capacitance, lossFactor, unbalanceCurrent, unbalanceVoltage, + totalCurrent, systemVoltage, isupload, create_time, update_time + + + + update data_dr_jyjc + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + update data_dr_jyjc + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_FhdlbxDao.xml b/src/main/resources/mappers/Data_FhdlbxDao.xml new file mode 100644 index 0000000..6eda605 --- /dev/null +++ b/src/main/resources/mappers/Data_FhdlbxDao.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, action, isupload, loadWaveform, create_time, update_time + + + + update data_fhdlbx + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + update data_fhdlbx + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_Jsyhw_JyjcDao.xml b/src/main/resources/mappers/Data_Jsyhw_JyjcDao.xml new file mode 100644 index 0000000..0194abc --- /dev/null +++ b/src/main/resources/mappers/Data_Jsyhw_JyjcDao.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, systemVoltage, totalCurrent, resistiveCurrent, actionCount, + lastActionTime, isupload, create_time, update_time + + + + + update data_jsyhw_jyjc + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + update data_jsyhw_jyjc + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_MicroclimateDao.xml b/src/main/resources/mappers/Data_MicroclimateDao.xml new file mode 100644 index 0000000..af5b28c --- /dev/null +++ b/src/main/resources/mappers/Data_MicroclimateDao.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, airTemperature, airPressure, humidity, precipitation, + wddir, precipitationIntensity, radiationIntensity, isupload, create_time, update_time + + + + + + update data_microclimate + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + update data_microclimate + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_SF6_QtsfDao.xml b/src/main/resources/mappers/Data_SF6_QtsfDao.xml new file mode 100644 index 0000000..5d066fe --- /dev/null +++ b/src/main/resources/mappers/Data_SF6_QtsfDao.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, temperature, moisture, isupload, create_time, update_time + + + + + update data_sf6_qtsf + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + + update data_sf6_qtsf + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_SF6_QtylDao.xml b/src/main/resources/mappers/Data_SF6_QtylDao.xml new file mode 100644 index 0000000..a3020b7 --- /dev/null +++ b/src/main/resources/mappers/Data_SF6_QtylDao.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, temperature, absolutePressure, density, pressure20C, + isupload, create_time, update_time + + + + + + update data_sf6_qtyl + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + update data_sf6_qtyl + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_TxDao.xml b/src/main/resources/mappers/Data_TxDao.xml new file mode 100644 index 0000000..32b4e46 --- /dev/null +++ b/src/main/resources/mappers/Data_TxDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + id, eqmid, acquisitionTime, totalCoreCurrent, isupload, create_time, update_time + + + + + update data_tx + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + + update data_tx + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_WsDao.xml b/src/main/resources/mappers/Data_WsDao.xml new file mode 100644 index 0000000..4d90f3e --- /dev/null +++ b/src/main/resources/mappers/Data_WsDao.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + id, eqmid, acquisitionTime, moisture, isupload, create_time, update_time + + + + + update data_ws + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + update data_ws + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Data_YspDao.xml b/src/main/resources/mappers/Data_YspDao.xml new file mode 100644 index 0000000..c5b5ae8 --- /dev/null +++ b/src/main/resources/mappers/Data_YspDao.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, H2, CH4, C2H6, C2H4, C2H2, CO, CO2, O2, N2, TotalHydrocarbon, + isupload, create_time, update_time + + + + + update data_ysp + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + update data_ysp + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + + + update data_ysp + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where isupload is null + + and ( + + ( + + eqmid = #{item.eqmid} + + + and id #{item.maxid} + + ) + + ) + + + + + update data_ysp + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where isupload is null + and id #{maxid} + + and eqmid in + + #{id} + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/Niec_SensorsDao.xml b/src/main/resources/mappers/Niec_SensorsDao.xml new file mode 100644 index 0000000..703f470 --- /dev/null +++ b/src/main/resources/mappers/Niec_SensorsDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + id, parent_id, site_id, sensor_code, equipment_id,phase,name, grp_no, status, equipment_type, system_code, + table_name, devid_field_name, dtime_field_name, one_dtime, create_time + + + \ No newline at end of file diff --git a/src/main/resources/mappers/data_FhzxqDao.xml b/src/main/resources/mappers/data_FhzxqDao.xml new file mode 100644 index 0000000..91127c5 --- /dev/null +++ b/src/main/resources/mappers/data_FhzxqDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + id, eqmid, acquisitionTime, action, isupload,coilWaveform, create_time, update_time + + + + update data_fhzxq + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id #{maxid} + + and id not in + + #{id} + + + + + + + + update data_fhzxq + + + isupload = #{isupload,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where + id in + + #{id} + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mybatis-config.xml b/src/main/resources/mybatis/mybatis-config.xml new file mode 100644 index 0000000..297b2c7 --- /dev/null +++ b/src/main/resources/mybatis/mybatis-config.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/test/java/com/shxy/i2/I2ApplicationTests.java b/src/test/java/com/shxy/i2/I2ApplicationTests.java new file mode 100644 index 0000000..f41662c --- /dev/null +++ b/src/test/java/com/shxy/i2/I2ApplicationTests.java @@ -0,0 +1,87 @@ +//package com.shxy.i2; +// +//import com.shxy.i2.constant.CommonStatus; +//import com.shxy.i2.dao.Data_SF6_QtylDao; +//import com.shxy.i2.dao.Niec_SensorsDao; +//import com.shxy.i2.dto.Data_SF6_QtylDto; +//import com.shxy.i2.entity.Niec_Sensors; +//import com.shxy.i2.service.Webservcies; +//import org.junit.jupiter.api.Test; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.boot.test.context.SpringBootTest; +// +//import java.util.HashMap; +//import java.util.List; +// +//@SpringBootTest +//class I2ApplicationTests { +// +// @Autowired +// private Webservcies webservcies; +// +//// @Autowired +//// private TestService testServiceClient; +// +//// @Autowired +//// private Niec_SensorsDao niec_sensorsDao; +//// +//// @Autowired +//// private Data_SF6_QtylDao data_sf6_qtylDao; +// +// @Test +// void contextLoads() { +//// HashMap equipMap = new HashMap(); +//// List niec_sensors = niec_sensorsDao.selectAll(); +//// for (Niec_Sensors item : niec_sensors) { +//// equipMap.put(item.getId(), item); +//// } +//// List list = data_sf6_qtylDao.selectUpload(CommonStatus.UNUPLOAD.value()); +//// System.out.println("sdfadf"); +//// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); +////// log.info("publicsecurity webService url : {}", "http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl"); +//// //根据WebServices接口地址创建client +//// Client client = clientFactory.createClient("http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl"); +//// HTTPConduit conduit = (HTTPConduit) client.getConduit(); +//// HTTPClientPolicy policy = new HTTPClientPolicy(); +//// policy.setAllowChunking(false); +//// // 连接服务器超时时间 10秒 +//// policy.setConnectionTimeout(10000); +//// // 等待服务器响应超时时间 20秒 +//// policy.setReceiveTimeout(20000); +//// conduit.setClient(policy); +//// try { +//// //invoke(接口中的方法名称,方法的参数) +//// Object[] objects = client.invoke("qqCheckOnline", "1440265357"); +//// if (objects != null && objects.length > 0) { +//// String isOnlineStr = (String) objects[0]; +////// log.info(qqNumber + " is {}", isOnlineStr.equals("Y") ? "在线" : "离线"); +//// System.out.println("fsasd"); +//// } +//// } catch (Exception e) { +////// log.error("抛出了异常:{}" + e.getMessage()); +//// System.out.println("r334324"); +//// } +//// webservcies.checkOnline("1440265357"); +// +//// JSONObject jsonObject = XML.toJSONObject("\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// "\n" + +//// ""); +//// System.out.println(jsonObject.toString()); +// +// webservcies.uploadData(); +// +// } +// +// +//} diff --git a/src/test/java/com/shxy/i2/test.java b/src/test/java/com/shxy/i2/test.java new file mode 100644 index 0000000..9c3b298 --- /dev/null +++ b/src/test/java/com/shxy/i2/test.java @@ -0,0 +1,31 @@ +//package com.shxy.i2; +// +//import cn.hutool.core.util.XmlUtil; +//import cn.hutool.json.JSONObject; +//import cn.hutool.json.XML; +// +//import java.util.Map; +// +//public class test { +// public static void main(String[] args){ +// JSONObject jsonObject = XML.toJSONObject("\n" + +// "\n" + +// "\n" + +// "\n" + +// "\n" + +// "\n" + +// "\n" + +// "\n" + +// "\n" + +// "\n" + +// "\n" + +// "\n" + +// "\n" + +// ""); +// JSONObject response = (JSONObject) jsonObject.get("response"); +// +// JSONObject result = (JSONObject) response.get("result"); +// Integer code = (Integer) result.get("code"); +// System.out.println(jsonObject.toString()); +// } +//}