Browse Source

第一次 提交

gtj 1 năm trước cách đây
commit
7e12f4cc11

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

BIN
.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

+ 1 - 0
log/pmHW2.sh

@@ -0,0 +1 @@
+#!/bin/bash

psql -U postgres -d sqmmt -c "\copy dim_pm.in_pm_data_hw from '$1' with DELIMITER '|' null ''";

+ 1 - 0
log/pmHw.sh

@@ -0,0 +1 @@
+#!/bin/bash

psql -U postgres -d sqmmt -c "\copy dim_pm.in_pm_data_hw from '$1' with DELIMITER '|' null ''";

+ 20 - 0
log/redWite.log

@@ -0,0 +1,20 @@
+2022-09-08 16:00:56.524  INFO 15724 --- [main] com.tencent.RedwitCsvApplicationTests    : Starting RedwitCsvApplicationTests using Java 1.8.0_144 on DESKTOP-2FDDRNG with PID 15724 (started by DELL in C:\Users\DELL\Desktop\Complaints project\redwit_csv)
+2022-09-08 16:00:56.532  INFO 15724 --- [main] com.tencent.RedwitCsvApplicationTests    : No active profile set, falling back to 1 default profile: "default"
+2022-09-08 16:00:58.715  WARN 15724 --- [main] c.b.m.core.metadata.TableInfoHelper      : Can not find table primary key in Class: "com.tencent.pojo.LnPmDataHw".
+2022-09-08 16:00:59.561  INFO 15724 --- [main] com.tencent.RedwitCsvApplicationTests    : Started RedwitCsvApplicationTests in 3.346 seconds (JVM running for 4.256)
+2022-09-08 16:02:31.280  INFO 21740 --- [main] com.tencent.RedwitCsvApplicationTests    : Starting RedwitCsvApplicationTests using Java 1.8.0_144 on DESKTOP-2FDDRNG with PID 21740 (started by DELL in C:\Users\DELL\Desktop\Complaints project\redwit_csv)
+2022-09-08 16:02:31.281  INFO 21740 --- [main] com.tencent.RedwitCsvApplicationTests    : No active profile set, falling back to 1 default profile: "default"
+2022-09-08 16:02:33.196  WARN 21740 --- [main] c.b.m.core.metadata.TableInfoHelper      : Can not find table primary key in Class: "com.tencent.pojo.LnPmDataHw".
+2022-09-08 16:02:34.086  INFO 21740 --- [main] com.tencent.RedwitCsvApplicationTests    : Started RedwitCsvApplicationTests in 3.112 seconds (JVM running for 3.987)
+2022-09-08 16:03:52.126  INFO 21216 --- [main] com.tencent.RedwitCsvApplicationTests    : Starting RedwitCsvApplicationTests using Java 1.8.0_144 on DESKTOP-2FDDRNG with PID 21216 (started by DELL in C:\Users\DELL\Desktop\Complaints project\redwit_csv)
+2022-09-08 16:03:52.127  INFO 21216 --- [main] com.tencent.RedwitCsvApplicationTests    : No active profile set, falling back to 1 default profile: "default"
+2022-09-08 16:03:54.337  WARN 21216 --- [main] c.b.m.core.metadata.TableInfoHelper      : Can not find table primary key in Class: "com.tencent.pojo.LnPmDataHw".
+2022-09-08 16:03:55.269  INFO 21216 --- [main] com.tencent.RedwitCsvApplicationTests    : Started RedwitCsvApplicationTests in 3.497 seconds (JVM running for 4.505)
+2022-09-08 16:18:58.835  INFO 24552 --- [main] com.tencent.RedwitCsvApplicationTests    : Starting RedwitCsvApplicationTests using Java 1.8.0_144 on DESKTOP-2FDDRNG with PID 24552 (started by DELL in C:\Users\DELL\Desktop\Complaints project\redwit_csv)
+2022-09-08 16:18:58.838  INFO 24552 --- [main] com.tencent.RedwitCsvApplicationTests    : No active profile set, falling back to 1 default profile: "default"
+2022-09-08 16:19:00.842  WARN 24552 --- [main] c.b.m.core.metadata.TableInfoHelper      : Can not find table primary key in Class: "com.tencent.pojo.LnPmDataHw".
+2022-09-08 16:19:01.685  INFO 24552 --- [main] com.tencent.RedwitCsvApplicationTests    : Started RedwitCsvApplicationTests in 3.12 seconds (JVM running for 3.97)
+2022-09-08 16:21:00.507  INFO 24428 --- [main] com.tencent.RedwitCsvApplicationTests    : Starting RedwitCsvApplicationTests using Java 1.8.0_144 on DESKTOP-2FDDRNG with PID 24428 (started by DELL in C:\Users\DELL\Desktop\Complaints project\redwit_csv)
+2022-09-08 16:21:00.508  INFO 24428 --- [main] com.tencent.RedwitCsvApplicationTests    : No active profile set, falling back to 1 default profile: "default"
+2022-09-08 16:21:02.488  WARN 24428 --- [main] c.b.m.core.metadata.TableInfoHelper      : Can not find table primary key in Class: "com.tencent.pojo.LnPmDataHw".
+2022-09-08 16:21:03.323  INFO 24428 --- [main] com.tencent.RedwitCsvApplicationTests    : Started RedwitCsvApplicationTests in 3.069 seconds (JVM running for 3.932)

BIN
log/redWite.log.2022-09-01.0.gz


+ 316 - 0
mvnw

@@ -0,0 +1,316 @@
+#!/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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   M2_HOME - location of maven2's installed home dir
+#   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
+        export JAVA_HOME="`/usr/libexec/java_home`"
+      else
+        export JAVA_HOME="/Library/Java/Home"
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+  ## resolve links - $0 may be a link to maven's home
+  PRG="$0"
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+      PRG="$link"
+    else
+      PRG="`dirname "$PRG"`/$link"
+    fi
+  done
+
+  saveddir=`pwd`
+
+  M2_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  M2_HOME=`cd "$M2_HOME" && pwd`
+
+  cd "$saveddir"
+  # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --unix "$M2_HOME"`
+  [ -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 "$M2_HOME" ] &&
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME="`(cd "$JAVA_HOME"; 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; \\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
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# 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/.."; pwd`
+    fi
+    # end of workaround
+  done
+  echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    echo "$(tr -s '\n' ' ' < "$1")"
+  fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+##########################################################################################
+# 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.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
+    fi
+else
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+    fi
+    if [ -n "$MVNW_REPOURL" ]; then
+      jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+    else
+      jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+    fi
+    while IFS="=" read key value; do
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+      esac
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Downloading from: $jarUrl"
+    fi
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+    if $cygwin; then
+      wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+    fi
+
+    if command -v wget > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found wget ... using wget"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+        else
+            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+        fi
+    elif command -v curl > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found curl ... using curl"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            curl -o "$wrapperJarPath" "$jarUrl" -f
+        else
+            curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+        fi
+
+    else
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Falling back to using Java to download"
+        fi
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        # For Cygwin, switch paths to Windows format before running javac
+        if $cygwin; then
+          javaClass=`cygpath --path --windows "$javaClass"`
+        fi
+        if [ -e "$javaClass" ]; then
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Compiling MavenWrapperDownloader.java ..."
+                fi
+                # Compiling the Java class
+                ("$JAVA_HOME/bin/javac" "$javaClass")
+            fi
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                # Running the downloader
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Running MavenWrapperDownloader.java ..."
+                fi
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+  echo $MAVEN_PROJECTBASEDIR
+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 "$M2_HOME" ] &&
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
+  [ -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
+
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  $MAVEN_DEBUG_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.home=${M2_HOME}" \
+  "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 188 - 0
mvnw.cmd

@@ -0,0 +1,188 @@
+@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 Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@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 DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+
+FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperUrl" SET DOWNLOAD_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 DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+    )
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
+        echo Downloading from: %DOWNLOAD_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('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+		"}"
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Finished downloading %WRAPPER_JAR%
+    )
+)
+@REM End of extension
+
+@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%

+ 93 - 0
pom.xml

@@ -0,0 +1,93 @@
+<?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.7.0</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.tencent</groupId>
+    <artifactId>redwit_csv</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>redwit_csv</name>
+    <description>Demo project for Spring Boot</description>
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <version>2.6.7</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.76</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-csv</artifactId>
+            <version>1.9.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.jcraft</groupId>
+            <artifactId>jsch</artifactId>
+            <version>0.1.54</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.ethz.ganymed</groupId>
+            <artifactId>ganymed-ssh2</artifactId>
+            <version>build210</version>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-params</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 94 - 0
src/main/java/com/tencent/RedwitCsvApplication.java

@@ -0,0 +1,94 @@
+package com.tencent;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+import java.io.IOException;
+@SpringBootApplication
+@EnableScheduling
+public class RedwitCsvApplication {
+
+    public static void main(String[] args) throws IOException {
+        SpringApplication.run(RedwitCsvApplication.class, args);
+
+    }
+/*
+
+  //读取F:\2022-05-20.csv的文件
+   public static void redCsv()throws IOException {
+       //准备文件路径
+       String filePath="F:\\2022-05-20.csv";
+       //创建列头
+       CSVFormat csvFormat = CSVFormat.DEFAULT.builder().setHeader().build();
+       //创建一个读取io fileReader
+       FileReader fileReader = new FileReader(filePath);
+
+       //创建csvParser对象
+       CSVParser csvRecords = new CSVParser(fileReader, csvFormat);
+       List<CSVRecord> records = csvRecords.getRecords();
+       if (null!=records){
+           for (int i=1;i<records.size();i++){
+               Map<String, String> stringStringMap = records.get(i).toMap();
+               for (String s : stringStringMap.keySet()) {
+                   String s1 = JSONObject.toJSONString(stringStringMap);
+                   System.out.println();
+               }
+              */
+/* CSVRecord strings = records.get(i);
+               System.out.println(strings);
+                System.out.println("======================================"+i+"==========================================");
+                System.out.println("province:"+records.get(i).get("province"));
+                System.out.println("city:"+records.get(i).get("city"));
+                System.out.println("faultPhen:"+records.get(i).get("faultPhen"));
+                System.out.println("faultTime:"+records.get(i).get("faultTime"));
+                System.out.println("cplLevel:"+records.get(i).get("cplLevel"));
+                System.out.println("repeatFlag:"+records.get(i).get("repeatFlag"));
+                System.out.println("acceptTime:"+records.get(i).get("acceptTime"));
+                System.out.println("cplAddress:"+records.get(i).get("cplAddress"));
+                System.out.println("cplContent:"+records.get(i).get("cplContent"));
+                System.out.println("acceptUserId:"+records.get(i).get("acceptUserId"));
+                System.out.println("acceptChannel:"+records.get(i).get("acceptChannel"));
+                System.out.println("acceptDep:"+records.get(i).get("acceptDep"));
+                System.out.println("acceptNo:"+records.get(i).get("acceptNo"));
+                System.out.println("callingNo:"+records.get(i).get("callingNo"));
+                System.out.println("expectTime:"+records.get(i).get("expectTime"));
+                System.out.println("custName:"+records.get(i).get("custName"));
+                System.out.println("custLevel:"+records.get(i).get("custLevel"));
+                System.out.println("custBrand:"+records.get(i).get("custBrand"));
+                System.out.println("requestReplyTime:"+records.get(i).get("requestReplyTime"));
+                System.out.println("fromSystem:"+records.get(i).get("fromSystem"));
+                System.out.println("kfSn:"+records.get(i).get("kfSn"));
+                System.out.println("orderTitle:"+records.get(i).get("orderTitle"));
+                System.out.println("pkgName:"+records.get(i).get("pkgName"));
+                System.out.println("countyCode:"+records.get(i).get("countyCode"));
+                System.out.println("networkType:"+records.get(i).get("networkType"));
+                System.out.println("custTel:"+records.get(i).get("custTel"));
+                System.out.println("dealTaskId:"+records.get(i).get("dealTaskId"));
+                System.out.println("longitude:"+records.get(i).get("longitude"));
+                System.out.println("latitude:"+records.get(i).get("latitude"));
+                System.out.println("workorderNo:"+records.get(i).get("workorderNo"));
+                System.out.println("gridNum:"+records.get(i).get("gridNum"));
+                System.out.println("gridName:"+records.get(i).get("gridName"));
+                System.out.println("complaintNumber:"+records.get(i).get("complaintNumber"));
+                System.out.println("kfopinion:"+records.get(i).get("kfopinion"));
+               System.out.println("============================="+i+"=======================");*//*
+
+           }
+       }
+        csvRecords.close();
+        fileReader.close();
+
+       //创建CsvFomat
+   }
+
+   //写入csv文件
+   public void wite_csv(){
+
+   }
+*/
+
+
+
+}
+

+ 23 - 0
src/main/java/com/tencent/controller/HwController.java

@@ -0,0 +1,23 @@
+package com.tencent.controller;
+import com.tencent.service.HwService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.io.IOException;
+@RestController
+@RequestMapping("/Hw")
+public class HwController {
+/*    @Autowired
+    private HwService hwService;
+    @PostMapping("/redHwCsv")
+    public void redHwCsv(@RequestParam String fileReadHwPath,@RequestParam String fileWriteHwPath) throws IOException {
+        hwService.readHwCsv();
+    }
+    @PostMapping("/redZxCsv")
+    public void redZxCsv(@RequestParam String fileReadZxCsv,@RequestParam String fileWriteZxPath) throws IOException {
+        hwService.readZxCsv();
+    }
+    @PostMapping("/redFhCsv")
+    public void RedFhCsv(@RequestParam String fileReadFhPath,@RequestParam String fileWithFhPath) throws IOException {
+        hwService.readFhCsv();
+    }*/
+}

+ 10 - 0
src/main/java/com/tencent/dao/HwDao.java

@@ -0,0 +1,10 @@
+package com.tencent.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.tencent.pojo.LnPmDataHw;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface HwDao extends BaseMapper<LnPmDataHw> {
+
+}

+ 33 - 0
src/main/java/com/tencent/pojo/LnPmDataFh.java

@@ -0,0 +1,33 @@
+package com.tencent.pojo;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@TableName("dim_pm.in_pm_data_fh")
+public class LnPmDataFh {
+
+  private String sdate;
+  private String subName;
+  private String subrackName;
+  private String shelfId;
+  private String hexSlotId;
+  private String slotId;
+  private String portName;
+  private Double outPower;
+  private Double inPower;
+  private Double outPowerMax;
+  private Double outPowerMin;
+  private Double inPowerMax;
+  private Double inPowerMin;
+  private Double voaValue;
+
+
+
+}

+ 32 - 0
src/main/java/com/tencent/pojo/LnPmDataHw.java

@@ -0,0 +1,32 @@
+package com.tencent.pojo;
+
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+@TableName("dim_pm.in_pm_data_hw")
+public class LnPmDataHw {
+  //@TableField(fill = FieldFill.INSERT)
+  private String sdate;
+  private String subName;
+  private String equipmentId;
+  private String shelfId;
+  private String slotId;
+  private Double outPower;
+  private Double inPower;
+  private Double outPowerMax;
+  private Double outPowerMin;
+  private Double inPowerMax;
+  private Double inPowerMin;
+
+
+
+}

+ 25 - 0
src/main/java/com/tencent/pojo/LnPmDataZx.java

@@ -0,0 +1,25 @@
+package com.tencent.pojo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@TableName("dim_pm.in_pm_data_zx")
+public class LnPmDataZx {
+  private String sdate;
+  private String neLocation;
+  private String equipmentId;
+  private String subName;
+  private String measurementObject;
+  private String shelfId;
+  private String slotId;
+  private Double outPower;
+  private Double inPower;
+  private Double outPowerMax;
+  private Double outPowerMin;
+  private Double inPowerMax;
+  private Double inPowerMin;
+
+}

+ 5 - 0
src/main/java/com/tencent/service/HwService.java

@@ -0,0 +1,5 @@
+package com.tencent.service;
+
+public interface HwService {
+
+}

+ 777 - 0
src/main/java/com/tencent/service/HwServiceImpl.java

@@ -0,0 +1,777 @@
+package com.tencent.service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.tencent.dao.HwDao;
+import com.tencent.pojo.LnPmDataFh;
+import com.tencent.pojo.LnPmDataHw;
+import com.tencent.pojo.LnPmDataZx;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.csv.CSVPrinter;
+import org.apache.commons.csv.CSVRecord;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+import java.io.*;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+@Service
+@Log4j2
+public class HwServiceImpl extends ServiceImpl<HwDao, LnPmDataHw> implements HwService {
+    @Value("${huawei.directory}")
+    private String huaweiDirectory;
+    @Value("${huawei.performance.files}")
+    private String HuaweiPerformanceFiles;
+    @Value("${huawei.performance.read}")
+    private String huaweiPerformanceRead;
+    @Value("${huawei.performance.write}")
+    private String huaweiPerformanceWrite;
+     @Value("${huaweince.performance.files}")
+     private String huaweincePerformanceFiles;
+     @Value("${huaweince.performance.read}")
+     private String huaweincePerformanceRead;
+     @Value("${zhongxing.directory}")
+     private String zhongxingDirectory;
+     @Value("${zhongxing.performance.files}")
+     private String zhongxingPerformanceFiles;
+    @Value("${zhongxing.performance.read}")
+    private String zhongxingPerformanceRead;
+    @Value("${zhongxing.performance.write}")
+     private String zhongxingPerformanceWrite;
+    @Value("${fenghuo.directory}")
+    private String fenghuoDirectory;
+    @Value("${fenghuo.performance.files}")
+    private String fenghuoPerformanceFiles;
+    @Value("${fenghuo.performance.read}")
+    private String fenghuoPerformanceRead;
+    @Value("${fenghuo.performance.write}")
+    private String fenghuoPerformanceWrite;
+
+    //hw文件所需静态常量
+    private static final  String ZONG_SHUCHU_ZUIJINZHI="总输出光功率最近值";
+    private static final String ZONG_SHURU_ZUIJINZHI="总输入光功率最近值";
+    private static final String ZONG_SHUCHU_ZUIDAZHI="总输出光功率最大值";
+    private static final String ZONG_SHUCHU_ZUIXIAOZHI="总输出光功率最小值";
+    private static final String ZONG_SHURU_ZUIDAZHI="总输入光功率最大值";
+    private static final String ZONG_SHURU_ZUIXIAOZHI="总输入光功率最小值";
+    //hwNCE文件所需静态常量
+    private static final  String SHUCHU_DANGQIANZHI="输出光功率当前值";
+    private static final String SHURU_DANGQIANZHI="输入光功率当前值";
+    private static final String SHUCHU_ZUIDAZHI="输出光功率最大值";
+    private static final String SHUCHU_ZUIXIAOZHI="输出光功率最小值";
+    private static final String SHURU_ZUIDAZHI="输入光功率最大值";
+    private static final String SHURU_ZUIXIAOZHI="输入光功率最小值";
+    //烽火文件所需静态常量
+    private static final  String SHUCHU_GUANGGONGLV="输出光功率";
+    private static final String SHURU_GUANGGONGLV="输入光功率";
+    private static final String SHUCHU_GUANGGONGLVFENGZHI="输出光功率峰值";
+    private static final String SHUCHU_GUANGGONGLVGUZHI="输出光功率谷值";
+    private static final String SHURU_FENGZHI="输入光功率峰值";
+    private static final String SHURU_GUZHI="输入光功率谷值";
+    private static final String VOA_SUAIJIANZHI="VOA衰减值";
+    private static final String CHUANSHU_SHUCHU_GUANGUANGGONGLV="传输层激光器输出光功率";
+    private static final String CHUANSHU_SHURUGUANGGONGLV="传输层输入光功率";
+    private static final String KEBIAN_SUAIJIANLIANG="可变衰减器的衰减量";
+    private static final String DANGQIANZHI="当前值";
+    private final HwDao hwDao;
+    @Autowired
+    public HwServiceImpl(HwDao hwDao) {
+        this.hwDao = hwDao;
+    }
+    //@Scheduled(cron = "0/15 * * * * ?")
+    @Scheduled(cron = "0 0 13 * * ?")
+    public  void scan() throws IOException {
+        File file = new File(huaweiDirectory);
+        String[] list = file.list();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+        String format = dateFormat.format(new Date());
+        for (String s : list) {
+            //----------------------华为性能--------------
+            if (s.equals(HuaweiPerformanceFiles+format+".txt")){
+                String fileReadHwPath=huaweiPerformanceRead+format+".txt";
+                String fileWriteHwPath=huaweiPerformanceWrite;
+                readHwCsv(fileReadHwPath,fileWriteHwPath);
+            }
+            //NCE性能------------------------------
+            if (s.equals(huaweincePerformanceFiles+format+".txt")){
+                String fileReadHwPath=huaweincePerformanceRead+format+".txt";
+                String fileWriteHwPath=huaweiPerformanceWrite;
+                readHwNCECsv(fileReadHwPath,fileWriteHwPath);
+            }
+        }
+        File file1 = new File(zhongxingDirectory);
+        String[] list1 = file1.list();
+        for (String s : list1) {
+            //------------------中兴性能数据-------------------
+            if (s.equals(zhongxingPerformanceFiles+format+".csv")){
+                String fileReadZxCsv=zhongxingPerformanceRead+format+".csv";
+                String fileWriteZxPath=zhongxingPerformanceWrite;
+                readZxCsv(fileReadZxCsv,fileWriteZxPath);
+            }
+        }
+
+        File file2 = new File(fenghuoDirectory);
+        String[] name = file2.list();
+        for (String s : name) {
+            //--------------------烽火性能数据——---------------------------
+            if (s.equals(fenghuoPerformanceFiles+format+".txt")){
+                String fileReadFhPath=fenghuoPerformanceRead+format+".txt";
+                String fileWithFhPath=fenghuoPerformanceWrite;
+                readFhCsv(fileReadFhPath,fileWithFhPath);
+            }
+        }
+    }
+    /**
+     * in_pm_data_hw 数据读取
+     *
+     */
+    public static  void readHwCsv(String fileReadHwPath,String fileWriteHwPath) throws IOException {
+        CSVFormat build = CSVFormat.DEFAULT.withFirstRecordAsHeader().builder().setHeader("ONEID", "ONEName", "NEID", "NEName", "NEType", "ShelfID",
+                "BrdID", "BrdType", "BrdName", "PortID", "PortNO", "PortName", "MOType", "FBName", "PathID",
+                "EventID", "EventName", "Period", "EndTime", "Value", "UnitName", "PMParameterName", "PMLocationID",
+                "PMLocation", "UpLevel", "DownLevel", "ResultOfLevel").setDelimiter("\t").build();
+        FileReader fileReader = new FileReader(fileReadHwPath);
+        CSVParser csvRecords = build.parse(fileReader);
+        Iterator<CSVRecord> iterator = csvRecords.iterator();
+        ArrayList<LnPmDataHw> objects = new ArrayList<>();
+        while (iterator.hasNext()) {
+            CSVRecord next = iterator.next();
+            if (next.get("PortName").contains("PA") || next.get("PortName").contains("BA")) {
+            } else {
+                if (next.get("BrdName").contains("OA") || next.get("BrdName").contains("OB") || next.get("BrdName").contains("PA")
+                        || next.get("BrdName").contains("ONA") || next.get("BrdName").
+                        contains("OLA") || next.get("BrdName").contains("DAPXF")) {
+                    LnPmDataHw lnPmDataHw = new LnPmDataHw();
+                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                    String format = dateFormat.format(new Date());
+                    lnPmDataHw.setSdate(format);
+                    String oneName = next.get("NEName");
+                    //objects.add(0,oneName);
+                    lnPmDataHw.setSubName(oneName);
+                    lnPmDataHw.setShelfId(next.get("ShelfID"));
+                    lnPmDataHw.setSlotId(next.get("BrdID"));
+                    String[] split = oneName.split("\t");
+                    String[] split1 = split[split.length - 1].split("-");
+                    String split2 = split1[0];
+                    for (int i = 0; i < split.length; i++) {
+                        if (split[i].contains("工程态")) {
+                            Pattern compile = Pattern.compile("([\\u4e00-\\u9fa5]+)");
+                            Matcher matcher = compile.matcher(split[i]);
+                            String s = matcher.replaceAll("").trim();
+                            lnPmDataHw.setEquipmentId(s);
+                            if (s.charAt(s.length() - 1) == '-') {
+                                String[] split3 = s.split("-");
+                                lnPmDataHw.setEquipmentId(split3[0]);
+                            }
+                        } else if (split[i].contains("邯郸") && Integer.parseInt(split2) < 1000) {
+                            String substring = split[i].substring(0, 8).trim();
+                            lnPmDataHw.setEquipmentId(substring);
+                        } else {
+                            lnPmDataHw.setEquipmentId(split2);
+                        }
+                    }
+                    if (next.get(16).contains(ZONG_SHUCHU_ZUIJINZHI) || next.get(16).contains(SHUCHU_DANGQIANZHI)){
+                        lnPmDataHw.setOutPower(Double.parseDouble(next.get(19)));
+                    } else if (next.get(16).contains(ZONG_SHURU_ZUIJINZHI) || next.get(16).contains(SHURU_DANGQIANZHI)) {
+                        lnPmDataHw.setInPower(Double.parseDouble(next.get(19)));
+                    } else if (next.get(16).contains(ZONG_SHUCHU_ZUIDAZHI) || next.get(16).contains(SHUCHU_ZUIDAZHI)) {
+                        lnPmDataHw.setOutPowerMax(Double.parseDouble(next.get(19)));
+                    } else if (next.get(16).contains(ZONG_SHUCHU_ZUIXIAOZHI) || next.get(16).contains(SHUCHU_ZUIXIAOZHI)) {
+                        lnPmDataHw.setOutPowerMin(Double.parseDouble(next.get(19)));
+                    } else if (next.get(16).contains(ZONG_SHURU_ZUIDAZHI) || next.get(16).contains(SHURU_ZUIDAZHI)) {
+                        lnPmDataHw.setInPowerMax(Double.parseDouble(next.get(19)));
+                    } else if (next.get(16).contains(ZONG_SHURU_ZUIXIAOZHI) || next.get(16).contains(SHURU_ZUIXIAOZHI)){
+                        lnPmDataHw.setInPowerMin(Double.parseDouble(next.get(19)));
+                    }
+                    objects.add(lnPmDataHw);
+                }
+             }
+       }
+        writeHwCsv(objects, fileWriteHwPath,fileReadHwPath);
+    }
+    /**
+     * in_pm_data_hw 数据导出
+     *
+     *
+     */
+    public static void writeHwCsv(List<LnPmDataHw> data, String fileWriteHwPath, String fileReadHwPath) throws IOException {
+        String NEW_LINE_SEPARATOR = "\n";
+        OutputStreamWriter gbk = new OutputStreamWriter((new FileOutputStream(new File(fileWriteHwPath))), "UTF-8");
+        CSVFormat formator = CSVFormat.DEFAULT.withRecordSeparator(NEW_LINE_SEPARATOR).builder().setDelimiter("|").build();
+        CSVPrinter csvPrinter = new CSVPrinter(gbk, formator);
+        for (LnPmDataHw dataHw : data) {
+            if (dataHw != null) {
+                csvPrinter.printRecord(dataHw.getSdate(),
+                        dataHw.getSubName(), dataHw.getEquipmentId(),
+                        dataHw.getShelfId(), dataHw.getSlotId(),
+                        dataHw.getOutPower(), dataHw.getInPower(),
+                        dataHw.getOutPowerMax(), dataHw.getOutPowerMin(),
+                        dataHw.getInPowerMax(), dataHw.getInPowerMin());
+            }
+        }
+        csvPrinter.close();
+        excuteHwCommand(fileWriteHwPath,fileReadHwPath);
+    }
+    /**
+     * in_pm_data_hw 调用shell脚本入库
+     *
+     */
+    public static void excuteHwCommand(String fileWriteHwPath,String fileReadHwPath) {
+        // String command="psql -U postgres -d sqmmt -c \"\\copy dim_pm.in_pm_data_hw from '"+fileWriteHwPath+"' with DELIMITER '|' null ''\";";
+        String command = "sh /data/gtj/pm/sh/pmHw.sh " + fileWriteHwPath;
+        Runtime r = Runtime.getRuntime();
+        Process p;
+        try {
+            p = r.exec(command);
+            BufferedReader br = new BufferedReader(
+                    new InputStreamReader(p.getInputStream()));
+            String inline;
+            while ((inline = br.readLine()) != null) {
+                log.info(inline);
+            }
+            log.info("------------性能pm华为----出错信息--------");
+            BufferedReader br_error = new BufferedReader(
+                    new InputStreamReader(p.getErrorStream()));
+            while ((inline = br_error.readLine()) != null) {
+                log.info(inline);
+            }
+            File file = new File(fileReadHwPath);
+            File file2 = new File("/data/gtj/pm/file/hw/" + file.getName());
+            if (file.renameTo(file2)){
+                file.delete();
+                log.info("---HW性能--读文件删除成功----");
+            }
+            File file1 = new File(fileWriteHwPath);
+            if (file1.delete()){
+                log.info("---HW性能--写文件删除成功----");
+            }else {
+                log.info("---HW性能--写文件删除失败-----");
+            }
+            log.info(fileReadHwPath+"---性能pm华为--入库成功----------");
+            br.close();
+            br_error.close();
+            timePmHw();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+    /**
+     * in_pm_data_hwNCE 数据读取
+     *
+     */
+    public static  void readHwNCECsv(String fileReadHwPath,String fileWriteHwPath) throws IOException {
+        CSVFormat build = CSVFormat.DEFAULT.withFirstRecordAsHeader().builder().setHeader("oneid", "onename", "neid", "nename", "netype", "shelfid",
+                "brdid", "brdtype", "brdname", "portid", "portno", "portname", "motype", "fbname", "pathid",
+                "eventid", "eventname", "period", "endtime", "value", "unitname", "pmparametername", "pmlocationid",
+                "pmlocation", "uplevel", "downlevel", "resultoflevel").setDelimiter("^").build();
+        FileReader fileReader = new FileReader(fileReadHwPath);
+        CSVParser csvRecords = build.parse(fileReader);
+        Iterator<CSVRecord> iterator = csvRecords.iterator();
+        ArrayList<LnPmDataHw> objects = new ArrayList<>();
+        while (iterator.hasNext()) {
+            CSVRecord next = iterator.next();
+            if (next.get("portname").contains("PA") || next.get("portname").contains("BA")) {
+            } else {
+                if (next.get("brdname").contains("OA") || next.get("brdname").contains("OB") || next.get("brdname").contains("PA")
+                        || next.get("brdname").contains("ONA") || next.get("brdname").
+                        contains("OLA") || next.get("brdname").contains("DAPXF")) {
+                    LnPmDataHw lnPmDataHw = new LnPmDataHw();
+                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                    String format = dateFormat.format(new Date());
+                    lnPmDataHw.setSdate(format);
+                    String oneName = next.get("nename");
+                    //objects.add(0,oneName);
+                    lnPmDataHw.setSubName(oneName);
+                    lnPmDataHw.setShelfId(next.get("shelfid"));
+                    lnPmDataHw.setSlotId(next.get("brdid"));
+                    String nename = next.get("nename");
+                    if (null!=nename){
+                        String[] split = nename.split("-");
+                        if (split[0].contains("工程态")){
+                            lnPmDataHw.setEquipmentId(split[0].substring(3).trim());
+                        }else {
+                            lnPmDataHw.setEquipmentId(split[0].trim());
+                        }
+                    }
+
+                    if (next.get("eventname").contains(SHUCHU_DANGQIANZHI)) {
+                        lnPmDataHw.setOutPower(Double.parseDouble(next.get(19)));
+                    } else if (next.get("eventname").contains(SHURU_DANGQIANZHI)) {
+                        //objects.add(5,next.get(19));
+                        lnPmDataHw.setInPower(Double.parseDouble(next.get(19)));
+                    } else if (next.get("eventname").contains(SHUCHU_ZUIDAZHI)) {
+                        // objects.add(6,next.get(19));
+                        double v = Double.parseDouble(next.get(19));
+                        lnPmDataHw.setOutPowerMax(Double.parseDouble(next.get(19)));
+                    } else if (next.get("eventname").contains(SHUCHU_ZUIXIAOZHI)) {
+                        // objects.add(7,next.get(19));
+                        lnPmDataHw.setOutPowerMin(Double.parseDouble(next.get(19)));
+                    } else if (next.get("eventname").contains(SHURU_ZUIDAZHI)) {
+                        //objects.add(8,next.get(19));
+                        lnPmDataHw.setInPowerMax(Double.parseDouble(next.get(19)));
+                    } else if (next.get("eventname").contains(SHURU_ZUIXIAOZHI)) {
+                        lnPmDataHw.setInPowerMin(Double.parseDouble(next.get(19)));
+                    }
+                    objects.add(lnPmDataHw);
+                }
+            }
+        }
+        writeHwNCECsv(objects, fileWriteHwPath,fileReadHwPath);
+    }
+    /**
+     * in_pm_data_hwNCE 数据导出
+     *
+     *
+     */
+    public static void writeHwNCECsv(List<LnPmDataHw> data, String fileWriteHwPath, String fileReadHwPath) throws IOException {
+        String NEW_LINE_SEPARATOR = "\n";
+        OutputStreamWriter gbk = new OutputStreamWriter((new FileOutputStream(new File(fileWriteHwPath))), "UTF-8");
+        CSVFormat formator = CSVFormat.DEFAULT.withRecordSeparator(NEW_LINE_SEPARATOR).builder().setDelimiter("|").build();
+        CSVPrinter csvPrinter = new CSVPrinter(gbk, formator);
+        for (LnPmDataHw dataHw : data) {
+            if (dataHw != null) {
+                csvPrinter.printRecord(dataHw.getSdate(),
+                        dataHw.getSubName(), dataHw.getEquipmentId(),
+                        dataHw.getShelfId(), dataHw.getSlotId(),
+                        dataHw.getOutPower(), dataHw.getInPower(),
+                        dataHw.getOutPowerMax(), dataHw.getOutPowerMin(),
+                        dataHw.getInPowerMax(), dataHw.getInPowerMin());
+            }
+        }
+        csvPrinter.close();
+        excuteHwCommandNCE(fileWriteHwPath,fileReadHwPath);
+    }
+    /**
+     * in_pm_data_hwNCE 调用shell脚本入库
+     *
+     */
+    public static void excuteHwCommandNCE(String fileWriteHwPath,String fileReadHwPath) {
+        // String command="psql -U postgres -d sqmmt -c \"\\copy dim_pm.in_pm_data_hw from '"+fileWriteHwPath+"' with DELIMITER '|' null ''\";";
+        String command = "sh /data/gtj/pm/sh/pmHwNCE.sh " + fileWriteHwPath;
+        Runtime r = Runtime.getRuntime();
+        Process p;
+        try {
+            p = r.exec(command);
+            BufferedReader br = new BufferedReader(
+                    new InputStreamReader(p.getInputStream()));
+            String inline;
+            while ((inline = br.readLine()) != null) {
+                log.info(inline);
+            }
+            log.info("------------性能pm华为----出错信息--------");
+            BufferedReader br_error = new BufferedReader(
+                    new InputStreamReader(p.getErrorStream()));
+            while ((inline = br_error.readLine()) != null) {
+                log.info(inline);
+            }
+            File file = new File(fileReadHwPath);
+            File file2 = new File("/data/gtj/pm/file/hw/" + file.getName());
+            if (file.renameTo(file2)){
+                file.delete();
+                log.info("---HW性能--读文件删除成功----");
+            }
+            File file1 = new File(fileWriteHwPath);
+            if (file1.delete()){
+                log.info("---HW性能--写文件删除成功----");
+            }else {
+                log.info("---HW性能--写文件删除失败-----");
+            }
+            log.info(fileReadHwPath+"---性能pm华为--入库成功----------");
+            br.close();
+            br_error.close();
+            timePmHw();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * in_update_timestamp
+     * 各表时间戳数据汇总
+     * in_pm_data_hwNCE 时间字段入库
+     */
+    public static void timePmHw() {
+        // String command="psql -U postgres -d sqmmt -c \"\\copy dim_pm.in_pm_data_hw from '"+fileWriteHwPath+"' with DELIMITER '|' null ''\";";
+        String command = "sh /data/gtj/pm/sh/timestampPmHwNCE.sh";
+        Runtime r = Runtime.getRuntime();
+        Process p;
+        try {
+            p = r.exec(command);
+            BufferedReader br = new BufferedReader(
+                    new InputStreamReader(p.getInputStream()));
+            String inline;
+            while ((inline = br.readLine()) != null) {
+                log.info(inline);
+            }
+            log.info("---------性能pm华为汇总时间-------出错信息--------");
+            BufferedReader br_error = new BufferedReader(
+                    new InputStreamReader(p.getErrorStream()));
+            while ((inline = br_error.readLine()) != null) {
+                log.info(inline);
+            }
+            br.close();
+            br_error.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+    /**
+     * in_pm_data_zx 数据导入
+     *
+     *
+     */
+    public static void readZxCsv(String fileReadZxCsv, String fileWriteZxPath) throws IOException {
+        InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(new File(fileReadZxCsv)), "GBK");
+        CSVFormat build = CSVFormat.DEFAULT.withFirstRecordAsHeader().builder().setHeader("序号", "开始时间", "结束时间", "查询粒度", "网元位置", "测量对象位置", "" +
+                        "输出光功率(dBm)", "最大输出光功率(dBm)", "最小输出光功率(dBm)", "平均输出光功率(dBm)", "输入光功率(dBm)"
+                , "最大输入光功率(dBm)", "最小输入光功率(dBm)", "平均输入光功率(dBm)", "中心波长(nm)", "中心波长最大值(nm)"
+                , "中心波长最小值(nm)", "中心波长平均值(nm)", "光信噪比(dB)", "光信噪比最大值(dB)", "" +
+                        "光信噪比最小值(dB)", "光信噪比平均值(dB)", "中心波长偏移(nm)", "最大中心波长偏移(nm)", "最小中心波长偏移(nm)", "" +
+                        "平均中心波长偏移(nm)", "FEC纠错前误码率", "FEC纠错后误码率", "SM严重误码秒比", "SM 远端严重误码秒比", "" +
+                        "PM严重误码秒比", "PM 远端严重误码秒比", "单板环境温度(℃)", "单板环境温度值最大值(℃)", "单板环境温度值最小值(℃)", "" +
+                        "单板环境温度值平均值(℃)", "模块温度(℃)", "最大模块温度(℃)", "最小模块温度(℃)", "平均模块温度(℃)", "泵浦激光器1偏置电流(mA)", "泵浦激光器2偏置电流(mA)", "大功率泵浦激光器偏置电流(mA)", "" +
+                        "泵浦激光器2偏置电流最大值(mA)", "泵浦激光器2偏置电流最小值(mA)", "泵浦激光器2偏置电流平均值(mA)", "" +
+                        "泵浦激光器1温度偏移平均值(℃)", "泵浦激光器1温度偏移最小值(℃)", "" +
+                        "泵浦激光器1温度偏移最大值(℃)", "(mA)", "泵浦激光器1偏置电流最小值(mA)", "泵浦激光器1偏置电流平均值(mA)").setDelimiter(",").build();
+        CSVParser csvRecords = new CSVParser(inputStreamReader, build);
+        Iterator<CSVRecord> iterator = csvRecords.iterator();
+        ArrayList<LnPmDataZx> lnPmDataZxes = new ArrayList<>();
+        while (iterator.hasNext()) {
+            CSVRecord next = iterator.next();
+            if (!next.get("测量对象位置").contains("内部")){
+            if (next.get("测量对象位置").contains("EOBA") || next.get("测量对象位置").contains("EONA")
+                    || next.get("测量对象位置").contains("EOPA") || next.get("测量对象位置").contains("SEOBA") || next.get("测量对象位置").contains("SEOPA")) {
+                //赋值NeLocation
+                LnPmDataZx lnPmDataZx = new LnPmDataZx();
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                String format = dateFormat.format(new Date());
+                lnPmDataZx.setSdate(format);
+                lnPmDataZx.setNeLocation(next.get(4));
+                String s = next.get(4);
+                if (!s.contains("OA")) {
+                    String s1 = next.get(4);
+                    lnPmDataZx.setNeLocation(s1);
+                }
+                //通过下标 获取网元位置
+                String neLocation = next.get(4);
+                String[] split = neLocation.split(",");
+                // System.out.println(split.length);
+                String[] split1 = split[split.length - 1].split("-");
+                //赋值equipment_id
+                lnPmDataZx.setEquipmentId(split1[0]);
+                //赋值sub_name
+                lnPmDataZx.setSubName(split[split.length - 1]);
+                //赋值测量对象
+                String measurementObject = next.get(5);
+                lnPmDataZx.setMeasurementObject(measurementObject);
+                String[] split2 = measurementObject.split("-");
+                String slotId = null;
+                String shelfId = null;
+                if (split2.length > 3) {
+                    shelfId = split2[1];
+                    int index = split2[2].lastIndexOf("]");
+                    slotId = split2[2].substring(0, index);
+                }
+                lnPmDataZx.setShelfId(shelfId);
+                lnPmDataZx.setSlotId(slotId);
+                try {
+                    lnPmDataZx.setOutPower(Double.parseDouble(next.get(9)));
+                } catch (NumberFormatException e) {
+                    lnPmDataZx.setOutPower(null);
+                }
+                try {
+                    lnPmDataZx.setInPower(Double.parseDouble(next.get(13)));
+                } catch (NumberFormatException e) {
+                    lnPmDataZx.setInPower(null);
+                }
+                try {
+                    lnPmDataZx.setOutPowerMax(Double.parseDouble(next.get(7)));
+                } catch (NumberFormatException e) {
+                    lnPmDataZx.setOutPowerMax(null);
+                }
+                try {
+                    lnPmDataZx.setOutPowerMin(Double.parseDouble(next.get(8)));
+                } catch (NumberFormatException e) {
+                    lnPmDataZx.setOutPowerMin(null);
+                }
+                try {
+                    lnPmDataZx.setInPowerMax(Double.parseDouble(next.get(11)));
+                } catch (NumberFormatException e) {
+                    lnPmDataZx.setInPowerMax(null);
+                }
+                try {
+                    lnPmDataZx.setInPowerMin(Double.parseDouble(next.get(12)));
+                } catch (NumberFormatException e) {
+                    lnPmDataZx.setInPowerMin(null);
+                }
+                lnPmDataZxes.add(lnPmDataZx);
+            }
+         }
+      }
+        writeZxCsv(lnPmDataZxes, fileWriteZxPath,fileReadZxCsv);
+    }
+    /**
+     * in_pm_data_zx 数据 导出
+     *
+     */
+    public static void writeZxCsv(List<LnPmDataZx> data, String fileWriteZxPath, String fileReadZxCsv) throws IOException {
+        String NEW_LINE_SEPARATOR = "\n";
+        try {
+            OutputStreamWriter gbk = new OutputStreamWriter((new FileOutputStream(new File(fileWriteZxPath))), "UTF-8");
+            CSVFormat formator = CSVFormat.DEFAULT.withRecordSeparator(NEW_LINE_SEPARATOR).builder().setDelimiter("|").build();
+            CSVPrinter csvPrinter = new CSVPrinter(gbk, formator);
+            //csvPrinter.printRecord(header);
+            for (LnPmDataZx dataHw : data) {
+                if (dataHw != null) {
+                    csvPrinter.printRecord(dataHw.getSdate(), dataHw.getNeLocation(),
+                            dataHw.getEquipmentId(), dataHw.getSubName(), dataHw.getMeasurementObject(),
+                            dataHw.getShelfId(), dataHw.getSlotId(),
+                            dataHw.getOutPower(), dataHw.getInPower(),
+                            dataHw.getOutPowerMax(), dataHw.getOutPowerMin(),
+                            dataHw.getInPowerMax(), dataHw.getInPowerMin());
+                }
+            }
+            csvPrinter.close();
+            excuteZxCommand2(fileWriteZxPath,fileReadZxCsv);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    /**
+     * in_pm_data_zx 调用shell脚本入库
+     *
+     */
+    public static void excuteZxCommand2(String fileWriteZxPath,String fileReadZxCsv) {
+        String command = "sh /data/gtj/pm/sh/pmZx.sh " + fileWriteZxPath;
+        Runtime r = Runtime.getRuntime();
+        Process p;
+        try {
+            p = r.exec(command);
+            BufferedReader br = new BufferedReader(
+                    new InputStreamReader(p.getInputStream()));
+            String inline;
+            while ((inline = br.readLine()) != null) {
+                log.info(inline);
+            }
+            log.info("--------性能pm中兴入库--------出错信息--------");
+            BufferedReader br_error = new BufferedReader(
+                    new InputStreamReader(p.getErrorStream()));
+            while ((inline = br_error.readLine()) != null) {
+                log.info(inline);
+            }
+            File file = new File(fileReadZxCsv);
+            File file2 = new File("/data/gtj/pm/file/zx/" + file.getName());
+            if (file.renameTo(file2)){
+                file.delete();
+                log.info("---------ZX性能--读文件 删除成功");
+            }
+            File file1 = new File(fileWriteZxPath);
+            if (file1.delete()){
+                log.info("--------ZX性能---写文件 删除成功");
+            }else {
+                log.info("-------ZX性能---写文件 删除失败");
+            }
+            br.close();
+            br_error.close();
+            timePmZx();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+    /**
+     * in_update_timestamp
+     * 各表时间戳数据汇总
+     * in_pm_data_zx 时间字段入库
+     */
+    public static void timePmZx() {
+        String command = "sh /data/gtj/pm/sh/timestampPmZx.sh";
+        Runtime r = Runtime.getRuntime();
+        Process p;
+        try {
+            p = r.exec(command);
+            BufferedReader br = new BufferedReader(
+                    new InputStreamReader(p.getInputStream()));
+            String inline;
+            while ((inline = br.readLine()) != null) {
+                log.info(inline);
+            }
+            log.info("---------汇总时间中兴-------出错信息--------");
+            BufferedReader br_error = new BufferedReader(
+                    new InputStreamReader(p.getErrorStream()));
+            while ((inline = br_error.readLine()) != null) {
+                log.info(inline);
+            }
+            br.close();
+            br_error.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+    /**
+     * in_pm_data_fh 数据导入
+     */
+    public static  void readFhCsv(String fileReadFhPath,String fileWithFhPath) throws IOException {
+                InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(new File(fileReadFhPath)), "UTF-8");
+        CSVFormat build = CSVFormat.RFC4180.withFirstRecordAsHeader().builder().setHeader("逻辑域", "性能源", "网元名称", "网元类型", "单盘名称",
+                "单盘类型", "槽位号", "线路号", "性能英文代码",
+                "性能名称", "开始时间", "结束时间", "单位",
+                "性能分组", "基准值", "预警门限", "告警门限", "当前值", "性能状态", "" +
+                        "端口名称", "管理地址").setDelimiter(",").build();
+        CSVParser csvRecords = new CSVParser(inputStreamReader, build);
+        List<CSVRecord> records = csvRecords.getRecords();
+        ArrayList<LnPmDataFh> objects = new ArrayList<>();
+        for (int i = 0; i < records.size(); i++) {
+            if (i > 4) {
+                if (records.get(i).get("单盘名称").contains("OA") || records.get(i).get("单盘名称").contains("OB")
+                        || records.get(i).get("单盘名称").contains("PA") || records.get(i).get("单盘名称").contains("ONA") ||
+                        records.get(i).get("单盘名称").contains("OLA") || records.get(i).get("单盘名称").contains("DAPXF")) {
+                    LnPmDataFh lnPmDataFh = new LnPmDataFh();
+                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                    String format = dateFormat.format(new Date());
+                    lnPmDataFh.setSdate(format);
+                    //获取网元名称
+                    lnPmDataFh.setSubName(records.get(i).get(2).trim());
+                    //获取单盘名称
+                    lnPmDataFh.setSubrackName(records.get(i).get(4).trim());
+                    //光放板子架默认0
+                    lnPmDataFh.setShelfId("0");
+                    //槽位号
+                    lnPmDataFh.setHexSlotId(records.get(i).get(6).trim());
+                    //槽位号 16进制转换10进制
+                    String s = records.get(i).get(6);
+                    long l = Long.parseLong(s, 16);
+                    lnPmDataFh.setSlotId(l + "".trim());
+                    //端口名称
+                    lnPmDataFh.setPortName(records.get(i).get(19).trim());
+                    if (records.get(i).get(9).equals(SHUCHU_GUANGGONGLV) ) {
+                        lnPmDataFh.setOutPower(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    } else if (records.get(i).get(9).equals(SHURU_GUANGGONGLV) ) {
+                        lnPmDataFh.setInPower(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    } else if (records.get(i).get(9).equals(SHUCHU_GUANGGONGLVFENGZHI)) {
+                        lnPmDataFh.setOutPowerMax(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    } else if (records.get(i).get(9).equals(SHUCHU_GUANGGONGLVGUZHI)) {
+                        lnPmDataFh.setOutPowerMin(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    } else if (records.get(i).get(9).equals(SHURU_FENGZHI)) {
+                        lnPmDataFh.setInPowerMax(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    } else if (records.get(i).get(9).equals(SHURU_GUZHI)) {
+                        lnPmDataFh.setInPowerMin(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    } else if (records.get(i).get(9).equals(VOA_SUAIJIANZHI)) {
+                        lnPmDataFh.setVoaValue(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    }else if (records.get(i).get(9).equals(CHUANSHU_SHUCHU_GUANGUANGGONGLV)){
+                        lnPmDataFh.setOutPower(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    }else if (records.get(i).get(9).equals(CHUANSHU_SHURUGUANGGONGLV)){
+                        lnPmDataFh.setInPower(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    }else if (records.get(i).get(9).equals(KEBIAN_SUAIJIANLIANG)){
+                        lnPmDataFh.setVoaValue(Double.parseDouble(records.get(i).get(DANGQIANZHI).trim()));
+                    }
+                    objects.add(lnPmDataFh);
+                }
+            }
+        }
+            writeFhCsv(objects, fileWithFhPath,fileReadFhPath);
+    }
+    /**
+     * in_pm_data_fh 数据导出
+     *
+     */
+    public static void writeFhCsv(List<LnPmDataFh> data, String fileWithFhPath, String fileReadFhPath) throws IOException {
+        String NEW_LINE_SEPARATOR = "\n";
+        try {
+            OutputStreamWriter gbk = new OutputStreamWriter((new FileOutputStream(new File(fileWithFhPath))), "UTF-8");
+            CSVFormat formator = CSVFormat.DEFAULT.withRecordSeparator(NEW_LINE_SEPARATOR).builder().setDelimiter("|").build();
+            CSVPrinter csvPrinter = new CSVPrinter(gbk, formator);
+            for (LnPmDataFh dataHw : data) {
+                if (dataHw != null) {
+                    csvPrinter.printRecord(dataHw.getSdate(), dataHw.getSubName(),
+                            dataHw.getSubrackName(), dataHw.getShelfId(), dataHw.getHexSlotId(), dataHw.getSlotId(),
+                            dataHw.getPortName(), dataHw.getOutPower(), dataHw.getInPower(),
+                            dataHw.getOutPowerMax(), dataHw.getOutPowerMin(),
+                            dataHw.getInPowerMax(), dataHw.getInPowerMin(), dataHw.getVoaValue());
+                }
+            }
+            csvPrinter.close();
+            excuteFhCommand2(fileWithFhPath,fileReadFhPath);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * in_pm_data_fh 调用 shell脚本入库
+     *
+     */
+    public static void excuteFhCommand2(String fileWithFhPath,String fileReadFhPath) {
+        String command = "sh /data/gtj/pm/sh/pmFh.sh " + fileWithFhPath;
+        Runtime r = Runtime.getRuntime();
+        Process p;
+        try {
+            p = r.exec(command);
+            BufferedReader br = new BufferedReader(
+                    new InputStreamReader(p.getInputStream()));
+            String inline;
+            while ((inline = br.readLine()) != null) {
+                log.info(inline);
+            }
+            log.info("-------------pm烽火数据---入库--出错信息--------");
+            BufferedReader br_error = new BufferedReader(
+                    new InputStreamReader(p.getErrorStream()));
+            while ((inline = br_error.readLine()) != null) {
+                log.info(inline);
+            }
+            File file = new File(fileReadFhPath);
+            File file2 = new File("/data/gtj/pm/file/fh/"+file.getName());
+            if (file.renameTo(file2)){
+                file.delete();
+                log.info("---------FH性能---读文件删除成功");
+            }else {
+                log.info("--------FH性能----读文件删除失败");
+            }
+            File file1 = new File(fileWithFhPath);
+            if (file1.delete()){
+                log.info("--------FH性能--写文件删除成功");
+            }
+            br.close();
+            br_error.close();
+            timePmFh();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+    /**
+     * in_update_timestamp
+     * 各表时间戳数据汇总
+     * in_pm_data_fh 调用 shell脚本 时间字段入库
+     */
+    public static void timePmFh() {
+        String command = "sh /data/gtj/pm/sh/timestampPmFh.sh";
+        Runtime r = Runtime.getRuntime();
+        Process p;
+        try {
+            p = r.exec(command);
+            BufferedReader br = new BufferedReader(
+                    new InputStreamReader(p.getInputStream()));
+            String inline;
+            while ((inline = br.readLine()) != null) {
+                log.info(inline);
+            }
+            log.info("---------pm烽火数据---汇总时间----出错信息--------");
+            BufferedReader br_error = new BufferedReader(
+                    new InputStreamReader(p.getErrorStream()));
+            while ((inline = br_error.readLine()) != null) {
+                log.info(inline);
+            }
+            br.close();
+            br_error.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+}
+
+

+ 29 - 0
src/main/resources/application.properties

@@ -0,0 +1,29 @@
+server.port=12002
+
+logging.level.root=info
+logging.level.com.nokia=debug
+logging.file.name=log/redWite.log
+
+spring.datasource.driver-class-name=org.postgresql.Driver
+spring.datasource.url=jdbc:postgresql://133.96.94.49:5432/sqmmt
+spring.datasource.username=pmparse
+spring.datasource.password=CS_yh@!0801
+
+#\u534E\u4E3A\u6587\u4EF6\u8DEF\u5F84
+huawei.directory=/data/gtj/pm/hw
+huawei.performance.files=\u534E\u4E3A\u6027\u80FD\u6570\u636E-1541523616937877505-D-
+huawei.performance.read=/data/gtj/pm/hw/\u534E\u4E3A\u6027\u80FD\u6570\u636E-1541523616937877505-D-
+huawei.performance.write=/data/gtj/pm/hw/hw.csv
+#\u534E\u4E3ANCE\u6587\u4EF6\u8DEF\u5F84
+huaweince.performance.files=\u534E\u4E3A\u6027\u80FD\u6570\u636E_NCE-1556947576550666241-D-
+huaweince.performance.read=/data/gtj/pm/hw/\u534E\u4E3A\u6027\u80FD\u6570\u636E_NCE-1556947576550666241-D-
+#\u4E2D\u5174\u6587\u4EF6\u8DEF\u5F84
+zhongxing.directory=/data/gtj/pm/zx
+zhongxing.performance.files=\u4E2D\u5174\u6027\u80FD\u6570\u636E-1543860666701725697-D-
+zhongxing.performance.read=/data/gtj/pm/zx/\u4E2D\u5174\u6027\u80FD\u6570\u636E-1543860666701725697-D-
+zhongxing.performance.write=/data/gtj/pm/zx/zx.csv
+#\u70FD\u706B\u6587\u4EF6\u8DEF\u5F84
+fenghuo.directory=/data/gtj/pm/fh
+fenghuo.performance.files=\u70FD\u706B\u6027\u80FD\u6570\u636E-1546316104835878913-D-
+fenghuo.performance.read=/data/gtj/pm/fh/\u70FD\u706B\u6027\u80FD\u6570\u636E-1546316104835878913-D-
+fenghuo.performance.write=/data/gtj/pm/fh/fh.csv

+ 70 - 0
src/test/java/com/tencent/GongTest.java

@@ -0,0 +1,70 @@
+package com.tencent;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.SneakyThrows;
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.csv.CSVRecord;
+import org.junit.jupiter.api.Test;
+import org.springframework.web.client.RestTemplate;
+
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+public class GongTest {
+
+    @Test
+    @SneakyThrows
+    public void test() {
+
+       // String url = "http://133.96.94.108:8044/service2/optimization/mainAction/casHandler?";
+        RestTemplate restTemplate = new RestTemplate();
+        String filePath = "F:\\2022-05-20.csv";
+        CSVFormat format = CSVFormat.DEFAULT.builder().setHeader().build();
+        InputStreamReader reader = new InputStreamReader(new FileInputStream(filePath), "gbk");
+        CSVParser parse = format.parse(reader);
+        int count = 0;
+        for (CSVRecord record : parse) {
+            Map<String, String> map = record.toMap();
+            try {
+                DateFormat format2 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+                System.out.println(JSONObject.toJSON(map));
+                // 需要在csv中把时间字符串的格式修改一下
+                Map<String, Object> map1 = new HashMap<>();
+                Map<String, Object> map2 = new HashMap<>();
+                map1.put("request", map2);
+                Map<String, Object> map3 = new HashMap<>();
+                map3.put("data", map);
+                Map<String, Object> map4 = new HashMap<>();
+                map2.put("body", map3);
+                map2.put("head", map4);
+                map4.put("from", "kf");
+                map4.put("reqTime", format2.format(new Date()));
+                map4.put("to", "mcs");
+                System.out.println("map------"+map);
+                System.out.println("map1------"+map1);
+                System.out.println("map2------"+map2);
+                System.out.println("map3------"+map3);
+                System.out.println("map4------"+map4);
+               /* String s = restTemplate.postForObject(url, JSONObject.toJSON(map1), String.class);
+                System.out.println(s);*/
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    @Test
+    public void GongTest(){
+        Long time = new Date().getTime();
+        Long timeDate=time-345600000;
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+        String format = dateFormat.format(timeDate);
+        System.out.println(format);
+    }
+}

+ 47 - 0
src/test/java/com/tencent/RedwitCsvApplicationTests.java

@@ -0,0 +1,47 @@
+package com.tencent;
+
+import com.tencent.service.HwServiceImpl;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+class RedwitCsvApplicationTests {
+    @Resource
+    private HwServiceImpl hwService1;
+
+    @Test
+    void TestScan() throws IOException {
+        hwService1.scan();
+    }
+
+    @Test
+    void TestHw() throws IOException {
+        String fileReadHwPath="C:\\Users\\DELL\\Desktop\\华为性能数据-1541523616937877505-D-20220820.txt";
+        String fileWriteHwPath="C:\\Users\\DELL\\Desktop\\华为性能数据-1541523616937877505-D-20220820.txt.csv";
+      HwServiceImpl.readHwCsv(fileReadHwPath,fileWriteHwPath);
+    }
+
+
+    @Test
+    void readHwNCECsv() throws IOException {
+        String fileReadHwPath="C:\\Users\\DELL\\Desktop\\华为性能数据-1541523616937877505-D-20220904.txt";
+        String fileWriteHwPath="C:\\Users\\DELL\\Desktop\\Pm_HW0904.csv";
+       /* String  fileReadHwPath="C:\\Users\\DELL\\Desktop\\华为性能数据_NCE-1556947576550666241-D-20220904.txt";
+        String fileWriteHwPath="C:\\Users\\DELL\\Desktop\\Pm_NCE0904.csv";*/
+        HwServiceImpl.readHwCsv(fileReadHwPath,fileWriteHwPath);
+    }
+
+    @Test
+    public void redFh() throws IOException {
+        String fileReadZxCsv="C:\\Users\\DELL\\Desktop\\中兴性能数据-1543860666701725697-D-20220904.csv";
+        String fileWriteZxPath="C:\\Users\\DELL\\Desktop\\Zx_FH0904.csv";
+        HwServiceImpl.readZxCsv(fileReadZxCsv,fileWriteZxPath);
+    }
+
+}