I2代码提交

master
liuguijing 2 years ago
commit 9cda928880

33
.gitignore vendored

@ -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/

Binary file not shown.

@ -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

308
mvnw vendored

@ -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 "$@"

205
mvnw.cmd vendored

@ -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%

@ -0,0 +1,193 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.shxy</groupId>
<artifactId>i2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>i2</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<xymanager.version>1.0.0</xymanager.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot-dependencies.version>2.5.6</spring-boot-dependencies.version>
<swagger.version>3.0.0</swagger.version>
<knife4j-spring-boot.version>3.0.2</knife4j-spring-boot.version>
<swagger-annotations.version>1.5.21</swagger-annotations.version>
<swagger-models.version>1.5.21</swagger-models.version>
<fastjson.version>1.2.79</fastjson.version>
<druid.version>1.2.8</druid.version>
<mybatis-spring-boot.version>2.2.0</mybatis-spring-boot.version>
<pagehelper.boot.version>1.4.0</pagehelper.boot.version>
<commons.fileupload.version>1.4</commons.fileupload.version>
<jwt.version>0.9.0</jwt.version>
<mybatisplus.version>3.2.0</mybatisplus.version>
<easyexcel.version>3.2.1</easyexcel.version>
</properties>
<dependencies>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot-dependencies.version}</version>
<type>pom</type>
</dependency>
<!-- SpringBoot 拦截器 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--mybatis-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring-boot.version}</version>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.27</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- 引入log4j2依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!--用于解决tomcat中log4j2-->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
<!--一个开源工具类 一个Java基础工具类对文件、流、加密解密、转码、正则、线程、XML等JDK方法进行封装组成各种Util工具类-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.20</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-web</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-web-services</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.5.5</version>
</dependency>
<!-- CXF webservice -->
<!-- <dependency>-->
<!-- <groupId>org.apache.cxf</groupId>-->
<!-- <artifactId>cxf-spring-boot-starter-jaxws</artifactId>-->
<!-- <version>3.4.5</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>paketobuildpacks/builder-jammy-base:latest</builder>
</image>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -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<String, String> 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<String, String> rtnMap = new TreeMap<String, String>();
// 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<String, String> 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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"DischargeCapacity\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"DischargePosition\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"PulseCount\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"DischargeWaveform\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//油色谱
public static String createCACData_YSP(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"H2\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"CH4\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"C2H6\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\" threshold=\"" + datavalue[2][2] + "\"/> ";
cacdata += "<attr name=\"C2H4\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\" threshold=\"" + datavalue[3][2] + "\"/> ";
cacdata += "<attr name=\"C2H2\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\" threshold=\"" + datavalue[4][2] + "\"/> ";
cacdata += "<attr name=\"CO\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\" threshold=\"" + datavalue[5][2] + "\"/> ";
cacdata += "<attr name=\"CO2\" value=\"" + datavalue[6][0] + "\" alarm=\"" + datavalue[6][1] + "\" threshold=\"" + datavalue[6][2] + "\"/> ";
cacdata += "<attr name=\"O2\" value=\"" + datavalue[7][0] + "\" alarm=\"" + datavalue[7][1] + "\" threshold=\"" + datavalue[7][2] + "\"/> ";
cacdata += "<attr name=\"N2\" value=\"" + datavalue[8][0] + "\" alarm=\"" + datavalue[8][1] + "\" threshold=\"" + datavalue[8][2] + "\"/> ";
cacdata += "<attr name=\"TotalHydrocarbon\" value=\"" + datavalue[9][0] + "\" alarm=\"" + datavalue[9][1] + "\" threshold=\"" + datavalue[9][2] + "\"/> ";
cacdata += "<attr name=\"GasPress\" value=\"" + datavalue[10][0] + "\" alarm=\"" + datavalue[10][1] + "\" threshold=\"" + datavalue[10][2] + "\"/> ";
cacdata += "<attr name=\"H2O\" value=\"" + datavalue[11][0] + "\" alarm=\"" + datavalue[11][1] + "\" threshold=\"" + datavalue[11][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_YSP2(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"H2\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"CH4\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"C2H6\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\" threshold=\"" + datavalue[2][2] + "\"/> ";
cacdata += "<attr name=\"C2H4\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\" threshold=\"" + datavalue[3][2] + "\"/> ";
cacdata += "<attr name=\"C2H2\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\" threshold=\"" + datavalue[4][2] + "\"/> ";
cacdata += "<attr name=\"CO\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\" threshold=\"" + datavalue[5][2] + "\"/> ";
cacdata += "<attr name=\"CO2\" value=\"" + datavalue[6][0] + "\" alarm=\"" + datavalue[6][1] + "\" threshold=\"" + datavalue[6][2] + "\"/> ";
cacdata += "<attr name=\"O2\" value=\"" + datavalue[7][0] + "\" alarm=\"" + datavalue[7][1] + "\" threshold=\"" + datavalue[7][2] + "\"/> ";
cacdata += "<attr name=\"N2\" value=\"" + datavalue[8][0] + "\" alarm=\"" + datavalue[8][1] + "\" threshold=\"" + datavalue[8][2] + "\"/> ";
cacdata += "<attr name=\"TotalHydrocarbon\" value=\"" + datavalue[9][0] + "\" alarm=\"" + datavalue[9][1] + "\" threshold=\"" + datavalue[9][2] + "\"/> ";
cacdata += "<attr name=\"CmbuGas\" value=\"" + datavalue[10][0] + "\" alarm=\"" + datavalue[10][1] + "\" threshold=\"" + datavalue[10][2] + "\"/> ";
cacdata += "<attr name=\"MicroMoisture\" value=\"" + datavalue[11][0] + "\" alarm=\"" + datavalue[11][1] + "\" threshold=\"" + datavalue[11][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_YSP3(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"CmbuGas\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"Temperature\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"Humidity\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\" threshold=\"" + datavalue[2][2] + "\"/> ";
cacdata += "<attr name=\"MicroMoisture\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\" threshold=\"" + datavalue[3][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//微水接入
public static String createCACData_Moisture(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021003</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Moisture\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" /> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//铁芯
public static String createCACData_tx(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021004</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"TotalCoreCurrent\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//顶层油
public static String createCACData_yw(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021005</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"OilTemperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//金属氧化物避雷器绝缘监测·
public static String createCACData_moa(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>023001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"SystemVoltage\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"TotalCurrent\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"ResistiveCurrent\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"ActionCount\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\"/> ";
cacdata += "<attr name=\"LastActionTime\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>" + code + "</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"MaxTmp\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"MinTmp\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"AvgTmp\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\" threshold=\"" + datavalue[2][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//电容型设备绝缘监测
public static String createCACData_eia(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>022001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Capacitance\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"LossFactor\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"UnbalanceCurrent\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"UnbalanceVoltage\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\"/> ";
cacdata += "<attr name=\"TotalCurrent\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\"/> ";
cacdata += "<attr name=\"SystemVoltage\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024004</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
if (phase != null) {
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
}
Float temperature = item.getTemperature();
if (temperature != null) {
cacdata += "<attr name=\"Temperature\" value=\"" + temperature + "\" alarm=\"FALSE\" /> ";
}
Float absolutepressure = item.getAbsolutepressure();
if (absolutepressure != null) {
cacdata += "<attr name=\"AbsolutePressure\" value=\"" + absolutepressure + "\" alarm=\"FALSE\" /> ";
}
Float density = item.getDensity();
if (density != null) {
cacdata += "<attr name=\"Density\" value=\"" + density + "\" alarm=\"FALSE\" /> ";
}
Float pressure20c = item.getPressure20c();
if (pressure20c != null) {
cacdata += "<attr name=\"Pressure20C\" value=\"" + pressure20c + "\" alarm=\"FALSE\" /> ";
}
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//SF6 气体水分
public static String createCACData_sf6moisture(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024005</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Temperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"Moisture\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_mlh(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>" + code + "</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"AirTemperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"AirPressure\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\" threshold=\"" + datavalue[3][2] + "\"/> ";
cacdata += "<attr name=\"Humidity\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"Precipitation\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\" threshold=\"" + datavalue[5][2] + "\"/> ";
cacdata += "<attr name=\"PrecipitationIntensity\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\"/> ";
cacdata += "<attr name=\"RadiationIntensity\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"wdgustspd\" value=\"" + datavalue[6][0] + "\" alarm=\"" + datavalue[6][1] + "\" threshold=\"" + datavalue[6][2] + "\"/> ";
cacdata += "<attr name=\"wddir\" value=\"" + datavalue[7][0] + "\" alarm=\"" + datavalue[7][1] + "\" threshold=\"" + datavalue[7][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_dmh(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>025001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"OilTemperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"DischargeCapacity\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"DischargePosition\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"PulseCount\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"DischargeWaveform\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\"/> ";
cacdata += "<attr name=\"PaDschAlm\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\"/> ";
cacdata += "<attr name=\"DschType\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//分合闸线圈电流波形
public static String createCACData_DLQWave(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Action\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"CoilWaveform\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//负荷电流波形接
public static String createCACData_FHDLQWave(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Action\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"LoadWaveform\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_KGG(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>026001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"OlTmpA\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"OlTmpB\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"OlTmpC\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"IlTmpA\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\"/> ";
cacdata += "<attr name=\"IlTmpB\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\"/> ";
cacdata += "<attr name=\"IlTmpC\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\"/> ";
cacdata += "<attr name=\"OntologyTmp\" value=\"" + datavalue[6][0] + "\" alarm=\"" + datavalue[6][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_TMT(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>026002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Tmp\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_TMT1(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021012</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"MaxTmp\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_sf6env(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024009</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Conc\" value=\"" + datavalue[0][0] + "\" alarm=\"FALSE\"/> ";
cacdata += "<attr name=\"OContent\" value=\"" + datavalue[1][0] + "\" alarm=\"FALSE\"/> ";
cacdata += "<attr name=\"Tmp\" value=\"" + datavalue[2][0] + "\" alarm=\"FALSE\"/> ";
cacdata += "<attr name=\"Dew\" value=\"" + datavalue[3][0] + "\" alarm=\"FALSE\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>" + code + "</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"TotalCoreCurrent\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"AlarmLevel\" value=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"threshold\" value=\"" + datavalue[1][0] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>" + code + "</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"resistance\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[1][0] + "\" threshold=\"" + datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String test(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue, String code) { //接地网
String cacdata = "";
cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>" + code + "</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"OilTemperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[1][0] + "\" threshold=\"" + datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//储能点机
public static String createCACData_DLQChargeTime(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024006</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"ChargeTime\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_environment(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"temperature\" value=\"" + data[0][0] + "\" alarm=\"" + data[0][1] + "\" threshold=\"" + data[0][2] + "\"/> ";
cacdata += "<attr name=\"humidity\" value=\"" + data[1][0] + "\" alarm=\"" + data[1][1] + "\" threshold=\"" + data[1][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_center(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"center\" value=\"" + data[0][0] + "\" alarm=\"" + data[0][1] + "\" threshold=\"" + data[0][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_noise(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"noise\" value=\"" + data[0][0] + "\" alarm=\"" + data[0][1] + "\" threshold=\"" + data[0][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_ampli(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"frequency\" value=\"" + data[0][0] + "\"/> ";
cacdata += "<attr name=\"amplitude\" value=\"" + data[1][0] + "\" alarm=\"" + data[1][1] + "\" threshold=\"" + data[1][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"frequency\" value=\"" + data[0][0] + "\"/> ";
cacdata += "<attr name=\"dailyRate(Yesterday)\" value=\"" + data[1][0] + "\" alarm=\"" + data[1][1] + "\" threshold=\"" + data[1][2] + "\"/> ";
cacdata += "<attr name=\"statisticalData(Yesterday)\" value=\"" + data[2][0] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_day_rate(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"dailyRate(Yesterday)\" value=\"" + data[0][0] + "\" alarm=\"" + data[0][1] + "\" threshold=\"" + data[0][2] + "\"/> ";
cacdata += "<attr name=\"statisticalData(Yesterday)\" value=\"" + data[1][0] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
}

@ -0,0 +1,770 @@
package com.shxy.i2;
public class GenerateXmlbak {
// //解析xml
// public static TreeMap<String, String> 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<String, String> rtnMap = new TreeMap<String, String>();
// 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<String, String> 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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"DischargeCapacity\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] +"\"/> ";
cacdata += "<attr name=\"DischargePosition\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"PulseCount\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"DischargeWaveform\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//油色谱
public static String createCACData_YSP(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"H2\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"CH4\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"C2H6\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\" threshold=\"" + datavalue[2][2] + "\"/> ";
cacdata += "<attr name=\"C2H4\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\" threshold=\"" + datavalue[3][2] + "\"/> ";
cacdata += "<attr name=\"C2H2\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\" threshold=\"" + datavalue[4][2] + "\"/> ";
cacdata += "<attr name=\"CO\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\" threshold=\"" + datavalue[5][2] + "\"/> ";
cacdata += "<attr name=\"CO2\" value=\"" + datavalue[6][0] + "\" alarm=\"" + datavalue[6][1] + "\" threshold=\"" + datavalue[6][2] + "\"/> ";
cacdata += "<attr name=\"O2\" value=\"" + datavalue[7][0] + "\" alarm=\"" + datavalue[7][1] + "\" threshold=\"" + datavalue[7][2] + "\"/> ";
cacdata += "<attr name=\"N2\" value=\"" + datavalue[8][0] + "\" alarm=\"" + datavalue[8][1] + "\" threshold=\"" + datavalue[8][2] + "\"/> ";
cacdata += "<attr name=\"TotalHydrocarbon\" value=\"" + datavalue[9][0] + "\" alarm=\"" + datavalue[9][1] + "\" threshold=\"" + datavalue[9][2] + "\"/> ";
cacdata += "<attr name=\"GasPress\" value=\"" + datavalue[10][0] + "\" alarm=\"" + datavalue[10][1] + "\" threshold=\"" + datavalue[10][2] + "\"/> ";
cacdata += "<attr name=\"H2O\" value=\"" + datavalue[11][0] + "\" alarm=\"" + datavalue[11][1] + "\" threshold=\"" + datavalue[11][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_YSP2(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"H2\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"CH4\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"C2H6\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\" threshold=\"" + datavalue[2][2] + "\"/> ";
cacdata += "<attr name=\"C2H4\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\" threshold=\"" + datavalue[3][2] + "\"/> ";
cacdata += "<attr name=\"C2H2\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\" threshold=\"" + datavalue[4][2] + "\"/> ";
cacdata += "<attr name=\"CO\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\" threshold=\"" + datavalue[5][2] + "\"/> ";
cacdata += "<attr name=\"CO2\" value=\"" + datavalue[6][0] + "\" alarm=\"" + datavalue[6][1] + "\" threshold=\"" + datavalue[6][2] + "\"/> ";
cacdata += "<attr name=\"O2\" value=\"" + datavalue[7][0] + "\" alarm=\"" + datavalue[7][1] + "\" threshold=\"" + datavalue[7][2] + "\"/> ";
cacdata += "<attr name=\"N2\" value=\"" + datavalue[8][0] + "\" alarm=\"" + datavalue[8][1] + "\" threshold=\"" + datavalue[8][2] + "\"/> ";
cacdata += "<attr name=\"TotalHydrocarbon\" value=\"" + datavalue[9][0] + "\" alarm=\"" + datavalue[9][1] + "\" threshold=\"" + datavalue[9][2] + "\"/> ";
cacdata += "<attr name=\"CmbuGas\" value=\"" + datavalue[10][0] + "\" alarm=\"" + datavalue[10][1] + "\" threshold=\"" + datavalue[10][2] + "\"/> ";
cacdata += "<attr name=\"MicroMoisture\" value=\"" + datavalue[11][0] + "\" alarm=\"" + datavalue[11][1] + "\" threshold=\"" + datavalue[11][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_YSP3(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"CmbuGas\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"Temperature\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"Humidity\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\" threshold=\"" + datavalue[2][2] + "\"/> ";
cacdata += "<attr name=\"MicroMoisture\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\" threshold=\"" + datavalue[3][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//微水接入
public static String createCACData_Moisture(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021003</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Moisture\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" /> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//铁芯
public static String createCACData_tx(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue){
String cacdata = "";
cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021004</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"TotalCoreCurrent\" value=\""+ datavalue[0][0] + "\" alarm=\"" +datavalue[0][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//顶层油
public static String createCACData_yw(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021005</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"OilTemperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//金属氧化物避雷器绝缘监测·
public static String createCACData_moa(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue){
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>023001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\""+phase+"\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"SystemVoltage\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"TotalCurrent\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"ResistiveCurrent\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"ActionCount\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\"/> ";
cacdata += "<attr name=\"LastActionTime\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>" + code + "</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\""+phase+"\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"MaxTmp\" value=\""+ datavalue[0][0] + "\" alarm=\"" +datavalue[0][1] + "\" threshold=\"" +datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"MinTmp\" value=\""+ datavalue[1][0] + "\" alarm=\"" +datavalue[1][1] + "\" threshold=\"" +datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"AvgTmp\" value=\""+ datavalue[2][0] + "\" alarm=\"" +datavalue[2][1] + "\" threshold=\"" +datavalue[2][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//电容型设备绝缘监测
public static String createCACData_eia(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue){
String cacdata = "";
cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>022001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Capacitance\" value=\""+ datavalue[0][0] + "\" alarm=\"" +datavalue[0][1] + "\" threshold=\"" +datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"LossFactor\" value=\""+ datavalue[1][0] + "\" alarm=\"" +datavalue[1][1] + "\" threshold=\"" +datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"UnbalanceCurrent\" value=\""+ datavalue[2][0] + "\" alarm=\"" +datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"UnbalanceVoltage\" value=\""+ datavalue[3][0] + "\" alarm=\"" +datavalue[3][1] + "\"/> ";
cacdata += "<attr name=\"TotalCurrent\" value=\""+ datavalue[4][0] + "\" alarm=\"" +datavalue[4][1] + "\"/> ";
cacdata += "<attr name=\"SystemVoltage\" value=\""+ datavalue[5][0] + "\" alarm=\"" +datavalue[5][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//SF6气体压力
public static String createCACData_sf6pressure(String cacid, String sensorid, String equipmentid, String timestamp,String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024004</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\""+phase+"\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Temperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"AbsolutePressure\" value=\"" + (datavalue[1][0] +900)+ "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"Density\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"Pressure20C\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//SF6 气体水分
public static String createCACData_sf6moisture(String cacid, String sensorid, String equipmentid, String timestamp,String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024005</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\""+phase+"\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Temperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"Moisture\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_mlh(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue,String code)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>"+code+"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"AirTemperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "<attr name=\"AirPressure\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\" threshold=\"" + datavalue[3][2] + "\"/> ";
cacdata += "<attr name=\"Humidity\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\" threshold=\"" + datavalue[1][2] + "\"/> ";
cacdata += "<attr name=\"Precipitation\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\" threshold=\"" + datavalue[5][2] + "\"/> ";
cacdata += "<attr name=\"PrecipitationIntensity\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\"/> ";
cacdata += "<attr name=\"RadiationIntensity\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"wdgustspd\" value=\"" + datavalue[6][0] + "\" alarm=\"" + datavalue[6][1] + "\" threshold=\"" + datavalue[6][2] + "\"/> ";
cacdata += "<attr name=\"wddir\" value=\"" + datavalue[7][0] + "\" alarm=\"" + datavalue[7][1] + "\" threshold=\"" + datavalue[7][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_dmh(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>025001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"OilTemperature\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"DischargeCapacity\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] +"\"/> ";
cacdata += "<attr name=\"DischargePosition\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"PulseCount\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"DischargeWaveform\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\"/> ";
cacdata += "<attr name=\"PaDschAlm\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\"/> ";
cacdata += "<attr name=\"DschType\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//分合闸线圈电流波形
public static String createCACData_DLQWave(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Action\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"CoilWaveform\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//负荷电流波形接
public static String createCACData_FHDLQWave(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Action\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"LoadWaveform\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_KGG(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>026001</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"OlTmpA\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"OlTmpB\" value=\"" + datavalue[1][0] + "\" alarm=\"" + datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"OlTmpC\" value=\"" + datavalue[2][0] + "\" alarm=\"" + datavalue[2][1] + "\"/> ";
cacdata += "<attr name=\"IlTmpA\" value=\"" + datavalue[3][0] + "\" alarm=\"" + datavalue[3][1] + "\"/> ";
cacdata += "<attr name=\"IlTmpB\" value=\"" + datavalue[4][0] + "\" alarm=\"" + datavalue[4][1] + "\"/> ";
cacdata += "<attr name=\"IlTmpC\" value=\"" + datavalue[5][0] + "\" alarm=\"" + datavalue[5][1] + "\"/> ";
cacdata += "<attr name=\"OntologyTmp\" value=\"" + datavalue[6][0] + "\" alarm=\"" + datavalue[6][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_TMT(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>026002</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Tmp\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_TMT1(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>021012</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"MaxTmp\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\" threshold=\"" + datavalue[0][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String createCACData_sf6env(String cacid, String sensorid, String equipmentid, String timestamp,String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024009</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\""+phase+"\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"Conc\" value=\"" + datavalue[0][0] + "\" alarm=\"FALSE\"/> ";
cacdata += "<attr name=\"OContent\" value=\"" + datavalue[1][0] + "\" alarm=\"FALSE\"/> ";
cacdata += "<attr name=\"Tmp\" value=\"" + datavalue[2][0] + "\" alarm=\"FALSE\"/> ";
cacdata += "<attr name=\"Dew\" value=\"" + datavalue[3][0] + "\" alarm=\"FALSE\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>"+ code +"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"TotalCoreCurrent\" value=\""+ datavalue[0][0] + "\" alarm=\"" +datavalue[1][1] + "\"/> ";
cacdata += "<attr name=\"AlarmLevel\" value=\""+ datavalue[0][1] + "\"/> ";
cacdata += "<attr name=\"threshold\" value=\""+ datavalue[1][0] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>"+ code +"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"resistance\" value=\""+ datavalue[0][0] + "\" alarm=\"" +datavalue[1][0] + "\" threshold=\"" +datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
public static String test(String cacid, String sensorid, String equipmentid, String timestamp, String phase,String[][] datavalue,String code)
{ //接地网
String cacdata = "";
cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>"+ code +"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"OilTemperature\" value=\""+ datavalue[0][0] + "\" alarm=\"" +datavalue[1][0] + "\" threshold=\"" +datavalue[1][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
//储能点机
public static String createCACData_DLQChargeTime(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] datavalue)
{
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
//A相
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>024006</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\" alarm=\"FALSE\" /> ";
cacdata += "<attr name=\"ChargeTime\" value=\"" + datavalue[0][0] + "\" alarm=\"" + datavalue[0][1] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_environment(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"temperature\" value=\"" + data[0][0] + "\" alarm=\"" + data[0][1] + "\" threshold=\"" + data[0][2] + "\"/> ";
cacdata += "<attr name=\"humidity\" value=\"" + data[1][0] + "\" alarm=\"" + data[1][1] + "\" threshold=\"" + data[1][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_center(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"center\" value=\"" + data[0][0] + "\" alarm=\"" + data[0][1] + "\" threshold=\"" + data[0][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_noise(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"noise\" value=\"" + data[0][0] + "\" alarm=\"" + data[0][1] + "\" threshold=\"" + data[0][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_ampli(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"frequency\" value=\"" + data[0][0] + "\"/> ";
cacdata += "<attr name=\"amplitude\" value=\"" + data[1][0] + "\" alarm=\"" + data[1][1] + "\" threshold=\"" + data[1][2] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
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 += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"frequency\" value=\"" + data[0][0] + "\"/> ";
cacdata += "<attr name=\"dailyRate(Yesterday)\" value=\"" + data[1][0] + "\" alarm=\"" + data[1][1] + "\" threshold=\"" + data[1][2] + "\"/> ";
cacdata += "<attr name=\"statisticalData(Yesterday)\" value=\"" + data[2][0] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
static String createSJZDData_day_rate(String cacid, String sensorid, String equipmentid, String timestamp, String phase, String[][] data, String code) {
String cacdata = "";
cacdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacdata += "<request> ";
cacdata += "<monitordata cacid=\"" + cacid + "\" datanodenum=\"1\"> ";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>\"" + code + "\"</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
cacdata += "<attrs> ";
cacdata += "<attr name=\"Phase\" value=\"" + phase + "\"/> ";
cacdata += "<attr name=\"dailyRate(Yesterday)\" value=\"" + data[0][0] + "\" alarm=\"" + data[0][1] + "\" threshold=\"" + data[0][2] + "\"/> ";
cacdata += "<attr name=\"statisticalData(Yesterday)\" value=\"" + data[1][0] + "\"/> ";
cacdata += "</attrs> ";
cacdata += "</datanode>";
cacdata += "</monitordata> ";
cacdata += "</request> ";
return cacdata;
}
}

@ -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("系统启动");
}
}

@ -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<BigInteger> 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<SendDataBean> 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<Integer> 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("上传失败");
}
}
}
}
}
}
}

@ -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<AttrBean> attrlist) {
String cacdata = "";
cacdata += "<datanode sensorid=\"" + sensorid + "\"> ";
cacdata += "<type>" + type + "</type> ";
cacdata += "<equipmentid>" + equipmentid + "</equipmentid> ";
if (StrUtil.isNotEmpty(timestamp)) {
cacdata += "<timestamp>" + timestamp + "</timestamp> ";
}
cacdata += "<attrs> ";
for (AttrBean bean : attrlist) {
cacdata += "<attr name=\"" + bean.getKey() + "\" value=\"" + bean.getValue() + "\" alarm=\"FALSE\" /> ";
}
cacdata += "</attrs> ";
cacdata += "</datanode>";
return cacdata;
}
public static String generateEndCacXml(ArrayList<String> cacdatalist) {
String cacxml = "";
cacxml += "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
cacxml += "<request> ";
cacxml += "<monitordata cacid=\"" + Constant.Cacid + "\" datanodenum=\"" + cacdatalist.size() + "\"> ";
for (String str : cacdatalist) {
cacxml += str;
}
// cacxml += "</attrs> ";
// cacxml += "</datanode>";
cacxml += "</monitordata> ";
cacxml += "</request> ";
return cacxml;
}
}

@ -0,0 +1,9 @@
package com.shxy.i2.bean;
import lombok.Data;
@Data
public class AttrBean<T> {
private String key;
private T value;
}

@ -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;
}

@ -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;
// }
//}

@ -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;
// }
//}

@ -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;
}
}

@ -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;
// }
//
//}

@ -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;
}
}

@ -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";
}

@ -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<Data_Byq_Jbfd> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateDataList(@Param("isupload") Integer isupload, @Param("idlist") ArrayList<SendDataBean> id, @Param("updateTime") Date updateTime);
int updateDataList2(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") ArrayList<Integer> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Cnj> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Dcyw> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Dlq_Jbfd> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateDataList(@Param("isupload") Integer isupload, @Param("idlist") ArrayList<SendDataBean> id, @Param("updateTime") Date updateTime);
int updateDataList2(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") ArrayList<Integer> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Dr_Jyjc> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Fhdlbx> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Fhzxq> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Jsyhw_Jyjc> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Microclimate> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_SF6_Qtsf> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_SF6_Qtyl> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Tx> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Ws> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
}

@ -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<Data_Ysp> selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List<BigInteger> id, @Param("updateTime") Date updateTime);
int updateDataList(@Param("isupload") Integer isupload, @Param("idlist") ArrayList<SendDataBean> id, @Param("updateTime") Date updateTime);
int updateDataList2(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") ArrayList<Integer> id, @Param("updateTime") Date updateTime);
}

@ -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<Niec_Sensors> selectAll();
}

@ -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;
}

@ -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<Data_SF6_QtylDetailDto> list;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -0,0 +1,11 @@
package com.shxy.i2.service;
public interface Webservcies {
void uploadData();
void uploadyspData();
void uploadjfjcData();
// void test(String str);
}

@ -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<Integer, Niec_Sensors> equipMap);
void upload_sf6_qtyl(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_dcyw(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_fhdlbx(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_fhzxq(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_sf6_qtsf(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_tx(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_ws(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_dr_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_jsyhw_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_microclimate(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_dlq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_ysp(Client client, HashMap<Integer, Niec_Sensors> equipMap);
void upload_cnj(Client client, HashMap<Integer, Niec_Sensors> equipMap);
}

@ -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<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> 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<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> 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<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> 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("局放监测数据定时任务结束");
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -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();
// }
}

@ -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

@ -0,0 +1,4 @@
# Spring配置
spring:
profiles:
active: test

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<classPathEntry
location="D:\WorkTool\IntellijIdea\maven_repository\mysql\mysql-connector-java\8.0.27\mysql-connector-java-8.0.27.jar"/>
<context id="sqlserverTables" targetRuntime="MyBatis3">
<!-- 生成的pojo将implements Serializable-->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
<commentGenerator>
<!-- 是否去除自动生成的注释 true false:否 -->
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!-- 数据库链接URL、用户名、密码 -->
<!-- driverClass="com.mysql.jdbc.Driver"-->
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/cacdb?userUnicode=true&amp;characterEncoding=utf8"
userId="root"
password="123456">
</jdbcConnection>
<!--
默认false把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer
true把JDBC DECIMAL 和 NUMERIC 类型解析为java.math.BigDecimal
-->
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!--
生成model模型对应的包路径以及文件存放路径(targetProject)targetProject可以指定具体的路径,如./src/main/java
也可以使用“MAVEN”来自动生成这样生成的代码会在target/generatord-source目录下
-->
<javaModelGenerator targetPackage="com.shxy.i2.entity"
targetProject="D:/Project/JAVAProject/i2/src/main/java">
<property name="enableSubPackages" value="true"/>
<!-- 从数据库返回的值被清理前后的空格 -->
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!--对应的mapper.xml文件 -->
<sqlMapGenerator targetPackage="mappers" targetProject="./src/main/resources">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!-- 对应的Mapper接口类文件 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.shxy.i2.dao"
targetProject="./src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- <table tableName="data_sf6_qtyl"-->
<!-- domainObjectName="Data_SF6_Qtyl"-->
<!-- mapperName="Data_SF6_QtylDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="niec_sensors"-->
<!-- domainObjectName="Niec_Sensors"-->
<!-- mapperName="Niec_SensorsDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_byq_jbfd"-->
<!-- domainObjectName="Data_Byq_Jbfd"-->
<!-- mapperName="Data_Byq_JbfdDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_cnj"-->
<!-- domainObjectName="Data_Cnj"-->
<!-- mapperName="Data_CnjDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_dcyw"-->
<!-- domainObjectName="Data_Dcyw"-->
<!-- mapperName="Data_DcywDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_dlq_jbfd"-->
<!-- domainObjectName="Data_Dlq_Jbfd"-->
<!-- mapperName="Data_Dlq_JbfdDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_dr_jyjc"-->
<!-- domainObjectName="Data_Dr_Jyjc"-->
<!-- mapperName="Data_Dr_JyjcDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_fhdlbx"-->
<!-- domainObjectName="Data_Fhdlbx"-->
<!-- mapperName="Data_FhdlbxDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_fhzxq"-->
<!-- domainObjectName="Data_Fhzxq"-->
<!-- mapperName="data_FhzxqDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_jsyhw_jyjc"-->
<!-- domainObjectName="Data_Jsyhw_Jyjc"-->
<!-- mapperName="Data_Jsyhw_JyjcDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_sf6_qtsf"-->
<!-- domainObjectName="Data_SF6_Qtsf"-->
<!-- mapperName="Data_SF6_QtsfDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_tx"-->
<!-- domainObjectName="Data_Tx"-->
<!-- mapperName="Data_TxDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_ws"-->
<!-- domainObjectName="Data_Ws"-->
<!-- mapperName="Data_WsDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="data_ysp"-->
<!-- domainObjectName="Data_Ysp"-->
<!-- mapperName="Data_YspDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="data_microclimate"
domainObjectName="Data_Microclimate"
mapperName="Data_MicroclimateDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
</context>
</generatorConfiguration>

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Configuration后面的status这个用于设置log4j2自身内部的信息输出可以不设置
当设置成trace时可以看到log4j2内部各种详细输出
-->
<!-- monitorIntervalLog4j能够自动检测修改配置 文件和重新配置本身,设置间隔秒数 -->
<configuration monitorInterval="5">
<!-- 日志级别以及优先级排序: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL -->
<!-- 变量配置 -->
<Properties>
<!--
格式化输出:
%d表示日期
%thread表示线程名
%-5level级别从左显示5个字符宽度
%msg日志消息%n是换行符
%logger{36} 表示 Logger 名字最长36个字符
-->
<property name="LOG_PATTERN"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight{%-5level}[%thread] %style{%logger{36}}{cyan} : %msg%n"/>
<!-- 定义日志存储的路径,不要配置相对路径 -->
<property name="FILE_PATH" value="/var/log/xyi2logs/"/>
<property name="FILE_NAME" value="xyi2log"/>
</Properties>
<appenders>
<console name="Console" target="SYSTEM_OUT">
<!--输出日志的格式-->
<PatternLayout pattern="${LOG_PATTERN}" disableAnsi="false" noConsoleNoAnsi="false"/>
<!--控制台只输出level及其以上级别的信息onMatch其他的直接拒绝onMismatch-->
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
</console>
<!--
  这个会打印出所有的info及以下级别的信息每次大小超过size
  则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档
-->
<RollingFile name="RollingFileInfo" fileName="${FILE_PATH}/${FILE_NAME}-info.log"
filePattern="${FILE_PATH}/${FILE_NAME}-INFO-%d{yyyy-MM-dd}.log">
<!--控制台只输出level及以上级别的信息onMatch其他的直接拒绝onMismatch-->
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="${LOG_PATTERN}"/>
<Policies>
<!--interval属性用来指定多久滚动一次默认是1 hour-->
<TimeBasedTriggeringPolicy interval="1"/>
<!-- <SizeBasedTriggeringPolicy size="20MB"/>-->
</Policies>
<!-- DefaultRolloverStrategy属性如不设置则默认为最多同一文件夹下7个文件开始覆盖 -->
<!-- <DefaultRolloverStrategy max="15"/>-->
</RollingFile>
<!-- 这个会打印出所有的warn及以下级别的信息每次大小超过size则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
<RollingFile name="RollingFileWarn" fileName="${FILE_PATH}/${FILE_NAME}-warn.log"
filePattern="${FILE_PATH}/${FILE_NAME}-WARN-%d{yyyy-MM-dd}.log">
<!--控制台只输出level及以上级别的信息onMatch其他的直接拒绝onMismatch-->
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="${LOG_PATTERN}"/>
<Policies>
<!--interval属性用来指定多久滚动一次默认是1 hour-->
<TimeBasedTriggeringPolicy interval="1"/>
<!-- <SizeBasedTriggeringPolicy size="20MB"/>-->
</Policies>
<!-- DefaultRolloverStrategy属性如不设置则默认为最多同一文件夹下7个文件开始覆盖-->
<!-- <DefaultRolloverStrategy max="15"/>-->
</RollingFile>
<!-- 这个会打印出所有的error及以下级别的信息每次大小超过size则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
<RollingFile name="RollingFileError" fileName="${FILE_PATH}/${FILE_NAME}-error.log"
filePattern="${FILE_PATH}/${FILE_NAME}-ERROR-%d{yyyy-MM-dd}.log">
<!--控制台只输出level及以上级别的信息onMatch其他的直接拒绝onMismatch-->
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="${LOG_PATTERN}"/>
<Policies>
<!--interval属性用来指定多久滚动一次默认是1 hour-->
<TimeBasedTriggeringPolicy interval="1"/>
<!-- <SizeBasedTriggeringPolicy size="20MB"/>-->
</Policies>
<!-- DefaultRolloverStrategy属性如不设置则默认为最多同一文件夹下7个文件开始覆盖-->
<!-- <DefaultRolloverStrategy max="15"/>-->
</RollingFile>
</appenders>
<!--Logger节点用来单独指定日志的形式比如要为指定包下的class指定不同的日志级别等。-->
<!--然后定义loggers只有定义了logger并引入的appenderappender才会生效-->
<loggers>
<!--过滤掉spring和mybatis的一些无用的DEBUG信息-->
<!-- <logger name="org.mybatis" level="info">-->
<!-- <AppenderRef ref="Console"/>-->
<!-- </logger>-->
<!-- &lt;!&ndash;监控系统信息&ndash;&gt;-->
<!-- &lt;!&ndash;若是additivity设为false则 子Logger 只会在自己的appender里输出而不会在 父Logger 的appender里输出。&ndash;&gt;-->
<!-- <Logger name="org.springframework" level="info">-->
<!-- <AppenderRef ref="Console"/>-->
<!-- </Logger>-->
<root level="info">
<appender-ref ref="Console"/>
<appender-ref ref="RollingFileInfo"/>
<appender-ref ref="RollingFileWarn"/>
<appender-ref ref="RollingFileError"/>
</root>
</loggers>
</configuration>

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_Byq_JbfdDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Byq_Jbfd">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="dischargeCapacity" jdbcType="REAL" property="dischargecapacity"/>
<result column="dischargePosition" jdbcType="REAL" property="dischargeposition"/>
<result column="pulseCount" jdbcType="REAL" property="pulsecount"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="dischargeWaveform" jdbcType="LONGVARBINARY" property="dischargewaveform"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, dischargeCapacity, dischargePosition, pulseCount, isupload, dischargeWaveform,
create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
<!-- select-->
<!-- <include refid="Base_Column_List"/>-->
<!-- from data_byq_jbfd-->
<!-- where isupload is null or isupload = #{isupload}-->
SELECT
t1.id, t1.eqmid, t1.acquisitionTime, t1.dischargeCapacity, t1.dischargePosition, t1.pulseCount, t1.isupload,
t1.dischargeWaveform,
t1.create_time, t1.update_time
FROM
data_byq_jbfd t1
INNER JOIN ( SELECT MAX( id ) AS id FROM data_byq_jbfd where isupload is null or isupload = #{isupload} GROUP BY
eqmid ) t2 ON t1.id = t2.id
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Byq_Jbfd">
update data_byq_jbfd
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_byq_jbfd
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
<update id="updateDataList">
update data_byq_jbfd
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where isupload is null
<if test="idlist != null and idlist.size > 0">
and (
<foreach collection="idlist" item="item" index="index" separator="or">
(
<if test="item.eqmid != null">
eqmid = #{item.eqmid}
</if>
<if test="item.maxid != null">
and id <![CDATA[<=]]> #{item.maxid}
</if>
)
</foreach>
)
</if>
</update>
<update id="updateDataList2">
update data_byq_jbfd
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where isupload is null
and id <![CDATA[<=]]> #{maxid}
<if test="idlist != null and idlist.size > 0">
and eqmid in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
</mapper>

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_CnjDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Cnj">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="chargeTime" jdbcType="REAL" property="chargetime"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, chargeTime, isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_cnj
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Cnj">
update data_cnj
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_cnj
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_DcywDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Dcyw">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="oilTemperature" jdbcType="REAL" property="oiltemperature"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, oilTemperature, isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_dcyw
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Dcyw">
update data_dcyw
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_dcyw
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_Dlq_JbfdDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Dlq_Jbfd">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="phase" jdbcType="VARCHAR" property="phase"/>
<result column="dischargeCapacity" jdbcType="REAL" property="dischargecapacity"/>
<result column="dischargePosition" jdbcType="REAL" property="dischargeposition"/>
<result column="pulseCount" jdbcType="REAL" property="pulsecount"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="dischargeWaveform" jdbcType="LONGVARBINARY" property="dischargewaveform"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, phase, dischargeCapacity, dischargePosition, pulseCount, dischargeWaveform,
isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
<!-- select-->
<!-- <include refid="Base_Column_List"/>-->
<!-- from data_dlq_jbfd-->
<!-- where isupload is null or isupload = #{isupload}-->
SELECT
t1.id, t1.eqmid, t1.acquisitionTime,t1.phase, t1.dischargeCapacity, t1.dischargePosition, t1.pulseCount,
t1.isupload,
t1.dischargeWaveform,
t1.create_time, t1.update_time
FROM
data_dlq_jbfd t1
INNER JOIN ( SELECT MAX( id ) AS id FROM data_dlq_jbfd where isupload is null or isupload = #{isupload} GROUP BY
eqmid ) t2 ON t1.id = t2.id
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Dlq_Jbfd">
update data_dlq_jbfd
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_dlq_jbfd
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
<update id="updateDataList">
update data_dlq_jbfd
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where isupload is null
<if test="idlist != null and idlist.size > 0">
and (
<foreach collection="idlist" item="item" index="index" separator="or">
(
<if test="item.eqmid != null">
eqmid = #{item.eqmid}
</if>
<if test="item.maxid != null">
and id <![CDATA[<=]]> #{item.maxid}
</if>
)
</foreach>
)
</if>
</update>
<update id="updateDataList2">
update data_dlq_jbfd
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where isupload is null
and id <![CDATA[<=]]> #{maxid}
<if test="idlist != null and idlist.size > 0">
and eqmid in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
</mapper>

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_Dr_JyjcDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Dr_Jyjc">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="capacitance" jdbcType="REAL" property="capacitance"/>
<result column="lossFactor" jdbcType="REAL" property="lossfactor"/>
<result column="unbalanceCurrent" jdbcType="REAL" property="unbalancecurrent"/>
<result column="unbalanceVoltage" jdbcType="REAL" property="unbalancevoltage"/>
<result column="totalCurrent" jdbcType="REAL" property="totalcurrent"/>
<result column="systemVoltage" jdbcType="REAL" property="systemvoltage"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, capacitance, lossFactor, unbalanceCurrent, unbalanceVoltage,
totalCurrent, systemVoltage, isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_dr_jyjc
where isupload is null or isupload = #{isupload} order by id desc limit 1
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Dr_Jyjc">
update data_dr_jyjc
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_dr_jyjc
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_FhdlbxDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Fhdlbx">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="action" jdbcType="INTEGER" property="action"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="loadWaveform" jdbcType="LONGVARBINARY" property="loadwaveform"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, action, isupload, loadWaveform, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_fhdlbx
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Fhdlbx">
update data_fhdlbx
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_fhdlbx
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_Jsyhw_JyjcDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Jsyhw_Jyjc">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="systemVoltage" jdbcType="REAL" property="systemvoltage"/>
<result column="totalCurrent" jdbcType="REAL" property="totalcurrent"/>
<result column="resistiveCurrent" jdbcType="REAL" property="resistivecurrent"/>
<result column="actionCount" jdbcType="REAL" property="actioncount"/>
<result column="lastActionTime" jdbcType="TIMESTAMP" property="lastactiontime"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, systemVoltage, totalCurrent, resistiveCurrent, actionCount,
lastActionTime, isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_jsyhw_jyjc
where isupload is null or isupload = #{isupload} order by id desc limit 1
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Jsyhw_Jyjc">
update data_jsyhw_jyjc
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_jsyhw_jyjc
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_MicroclimateDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Microclimate">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="airTemperature" jdbcType="REAL" property="airtemperature"/>
<result column="airPressure" jdbcType="REAL" property="airpressure"/>
<result column="humidity" jdbcType="REAL" property="humidity"/>
<result column="precipitation" jdbcType="REAL" property="precipitation"/>
<result column="wddir" jdbcType="REAL" property="wddir"/>
<result column="precipitationIntensity" jdbcType="REAL" property="precipitationintensity"/>
<result column="radiationIntensity" jdbcType="REAL" property="radiationintensity"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, airTemperature, airPressure, humidity, precipitation,
wddir, precipitationIntensity, radiationIntensity, isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_microclimate
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Microclimate">
update data_microclimate
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_microclimate
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_SF6_QtsfDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_SF6_Qtsf">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="temperature" jdbcType="REAL" property="temperature"/>
<result column="moisture" jdbcType="REAL" property="moisture"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, temperature, moisture, isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_sf6_qtsf
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_SF6_Qtsf">
update data_sf6_qtsf
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_sf6_qtsf
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_SF6_QtylDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_SF6_Qtyl">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="temperature" jdbcType="REAL" property="temperature"/>
<result column="absolutePressure" jdbcType="REAL" property="absolutepressure"/>
<result column="density" jdbcType="REAL" property="density"/>
<result column="pressure20C" jdbcType="REAL" property="pressure20c"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<resultMap id="listResultMap" type="com.shxy.i2.dto.Data_SF6_QtylDto">
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<collection property="list" javaType="ArrayList" ofType="com.shxy.i2.dto.Data_SF6_QtylDetailDto">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="temperature" jdbcType="REAL" property="temperature"/>
<result column="absolutePressure" jdbcType="REAL" property="absolutepressure"/>
<result column="density" jdbcType="REAL" property="density"/>
<result column="pressure20C" jdbcType="REAL" property="pressure20c"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</collection>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, temperature, absolutePressure, density, pressure20C,
isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_sf6_qtyl
where isupload is null or isupload = #{isupload}
</select>
<select id="selectUploadList" resultMap="listResultMap">
select
<include refid="Base_Column_List"/>
from data_sf6_qtyl
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_SF6_Qtyl">
update data_sf6_qtyl
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_sf6_qtyl
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_TxDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Tx">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="totalCoreCurrent" jdbcType="REAL" property="totalcorecurrent"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, totalCoreCurrent, isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_tx
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Tx">
update data_tx
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_tx
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_WsDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Ws">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="moisture" jdbcType="REAL" property="moisture"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, moisture, isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_ws
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Ws">
update data_ws
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_ws
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_YspDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Ysp">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="H2" jdbcType="REAL" property="h2"/>
<result column="CH4" jdbcType="REAL" property="ch4"/>
<result column="C2H6" jdbcType="REAL" property="c2h6"/>
<result column="C2H4" jdbcType="REAL" property="c2h4"/>
<result column="C2H2" jdbcType="REAL" property="c2h2"/>
<result column="CO" jdbcType="REAL" property="co"/>
<result column="CO2" jdbcType="REAL" property="co2"/>
<result column="O2" jdbcType="REAL" property="o2"/>
<result column="N2" jdbcType="REAL" property="n2"/>
<result column="TotalHydrocarbon" jdbcType="REAL" property="totalhydrocarbon"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, H2, CH4, C2H6, C2H4, C2H2, CO, CO2, O2, N2, TotalHydrocarbon,
isupload, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
<!-- select-->
<!-- <include refid="Base_Column_List"/>-->
<!-- from data_ysp-->
<!-- where isupload is null or isupload = #{isupload} order by id desc limit 1-->
SELECT
t1.id, t1.eqmid, t1.acquisitionTime, t1.H2, t1.CH4, t1.C2H6, t1.C2H4, t1.C2H2,t1.CO, t1.CO2, t1.O2, t1.N2,
t1.TotalHydrocarbon,
t1.isupload, t1.create_time, t1.update_time
FROM
data_ysp t1
INNER JOIN ( SELECT MAX( id ) AS id FROM data_ysp where isupload is null or isupload = #{isupload} GROUP BY
eqmid ) t2 ON t1.id = t2.id
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Ysp">
update data_ysp
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_ysp
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
<update id="updateDataList">
update data_ysp
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where isupload is null
<if test="idlist != null and idlist.size > 0">
and (
<foreach collection="idlist" item="item" index="index" separator="or">
(
<if test="item.eqmid != null">
eqmid = #{item.eqmid}
</if>
<if test="item.maxid != null">
and id <![CDATA[<=]]> #{item.maxid}
</if>
)
</foreach>
)
</if>
</update>
<update id="updateDataList2">
update data_ysp
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where isupload is null
and id <![CDATA[<=]]> #{maxid}
<if test="idlist != null and idlist.size > 0">
and eqmid in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
</mapper>

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Niec_SensorsDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Niec_Sensors">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="parent_id" jdbcType="INTEGER" property="parentId"/>
<result column="site_id" jdbcType="VARCHAR" property="siteId"/>
<result column="sensor_code" jdbcType="VARCHAR" property="sensorCode"/>
<result column="equipment_id" jdbcType="VARCHAR" property="equipmentId"/>
<result column="phase" jdbcType="VARCHAR" property="phase"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="grp_no" jdbcType="INTEGER" property="grpNo"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="equipment_type" jdbcType="VARCHAR" property="equipmentType"/>
<result column="system_code" jdbcType="VARCHAR" property="systemCode"/>
<result column="table_name" jdbcType="VARCHAR" property="tableName"/>
<result column="devid_field_name" jdbcType="VARCHAR" property="devidFieldName"/>
<result column="dtime_field_name" jdbcType="VARCHAR" property="dtimeFieldName"/>
<result column="one_dtime" jdbcType="INTEGER" property="oneDtime"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap>
<sql id="Base_Column_List">
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
</sql>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from niec_sensors
</select>
</mapper>

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.i2.dao.Data_FhzxqDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Fhzxq">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="action" jdbcType="INTEGER" property="action"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="coilWaveform" jdbcType="LONGVARBINARY" property="coilwaveform"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, action, isupload,coilWaveform, create_time, update_time
</sql>
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_fhzxq
where isupload is null or isupload = #{isupload}
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Fhzxq">
update data_fhzxq
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_fhzxq
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局参数 -->
<settings>
<!-- 使全局的映射器启用或禁用缓存 -->
<setting name="cacheEnabled" value="true" />
<!-- 允许JDBC 支持自动生成主键 -->
<setting name="useGeneratedKeys" value="true" />
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
<setting name="defaultExecutorType" value="SIMPLE" />
<!-- 指定 MyBatis 所用日志的具体实现 -->
<setting name="logImpl" value="SLF4J" />
<!-- 使用驼峰命名法转换字段 -->
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
</settings>
</configuration>

@ -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<Integer, Niec_Sensors> equipMap = new HashMap();
//// List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
//// for (Niec_Sensors item : niec_sensors) {
//// equipMap.put(item.getId(), item);
//// }
//// List<Data_SF6_QtylDto> 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("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
//// "<response>\n" +
//// "<result code=\"0\" />\n" +
//// "<commands>\n" +
//// "<command objid=\"26M00090990000987\" type=\"SETCONFIG\">\n" +
//// "<action name=\"CAGIP\" value=\"10.144.98.101\" />\n" +
//// "<action name=\"CURTIME\" value=\"2011-04-10 22:10:11\" />\n" +
//// "</command>\n" +
//// "<command objid=\"26M00090990000986\" type=\"SETCONFIG\">\n" +
//// "<action name=\"MAINTIME\" value=\"20\" />\n" +
//// "<action name=\"SAMPLECOUNT\" value=\"15\" />\n" +
//// "</command>\n" +
//// "</commands>\n" +
//// "</response>");
//// System.out.println(jsonObject.toString());
//
// webservcies.uploadData();
//
// }
//
//
//}

@ -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("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
// "<response>\n" +
// "<result code=\"0\" />\n" +
// "<commands>\n" +
// "<command objid=\"26M00090990000987\" type=\"SETCONFIG\">\n" +
// "<action name=\"CAGIP\" value=\"10.144.98.101\" />\n" +
// "<action name=\"CURTIME\" value=\"2011-04-10 22:10:11\" />\n" +
// "</command>\n" +
// "<command objid=\"26M00090990000986\" type=\"SETCONFIG\">\n" +
// "<action name=\"MAINTIME\" value=\"20\" />\n" +
// "<action name=\"SAMPLECOUNT\" value=\"15\" />\n" +
// "</command>\n" +
// "</commands>\n" +
// "</response>");
// JSONObject response = (JSONObject) jsonObject.get("response");
//
// JSONObject result = (JSONObject) response.get("result");
// Integer code = (Integer) result.get("code");
// System.out.println(jsonObject.toString());
// }
//}
Loading…
Cancel
Save