diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3b41682 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/mvnw text eol=lf +*.cmd text eol=crlf diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..d58dfb7 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,19 @@ +# 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 +# +# http://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. +wrapperVersion=3.3.2 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..1a56d7b --- /dev/null +++ b/compose.yaml @@ -0,0 +1,21 @@ +services: + mongodb: + image: 'mongo:latest' + environment: + - 'MONGO_INITDB_DATABASE=mydatabase' + - 'MONGO_INITDB_ROOT_PASSWORD=secret' + - 'MONGO_INITDB_ROOT_USERNAME=root' + ports: + - '27017' + postgres: + image: 'postgres:latest' + environment: + - 'POSTGRES_DB=mydatabase' + - 'POSTGRES_PASSWORD=secret' + - 'POSTGRES_USER=myuser' + ports: + - '5432' + redis: + image: 'redis:latest' + ports: + - '6379' diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..19529dd --- /dev/null +++ b/mvnw @@ -0,0 +1,259 @@ +#!/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 +# +# http://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.3.2 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + 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" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..249bdf3 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,149 @@ +<# : batch portion +@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 http://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.3.2 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..b139368 --- /dev/null +++ b/pom.xml @@ -0,0 +1,200 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.5 + + + com.zsc.edu + gateway + 0.0.1-SNAPSHOT + iot-gateway + iot-gateway + + + + + + + + + + + + + + + 17 + 3.5.8 + 1.6.2 + + + + org.springframework.boot + spring-boot-starter-data-mongodb + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.boot + spring-boot-starter-freemarker + + + org.springframework.boot + spring-boot-starter-integration + + + org.springframework.boot + spring-boot-starter-mail + + + org.springframework.boot + spring-boot-starter-quartz + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.springframework.boot + spring-boot-docker-compose + runtime + true + + + org.postgresql + postgresql + runtime + + + com.baomidou + mybatis-plus-spring-boot3-starter + ${mybatis-plus.version} + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.projectlombok + lombok + true + + + + org.mapstruct + mapstruct + ${mapstruct.version} + provided + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + provided + + + + org.apache.commons + commons-lang3 + 3.17.0 + + + + commons-codec + commons-codec + 1.17.1 + + + + org.apache.tika + tika-core + 3.0.0 + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.integration + spring-integration-test + test + + + org.springframework.restdocs + spring-restdocs-mockmvc + test + + + org.springframework.security + spring-security-test + test + + + + + + + org.asciidoctor + asciidoctor-maven-plugin + 2.2.1 + + + generate-docs + prepare-package + + process-asciidoc + + + html + book + + + + + + org.springframework.restdocs + spring-restdocs-asciidoctor + ${spring-restdocs.version} + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + diff --git a/src/main/java/com/zsc/edu/gateway/IotGatewayApplication.java b/src/main/java/com/zsc/edu/gateway/IotGatewayApplication.java new file mode 100644 index 0000000..13068af --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/IotGatewayApplication.java @@ -0,0 +1,13 @@ +package com.zsc.edu.gateway; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class IotGatewayApplication { + + public static void main(String[] args) { + SpringApplication.run(IotGatewayApplication.class, args); + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/common/enums/EnableState.java b/src/main/java/com/zsc/edu/gateway/common/enums/EnableState.java new file mode 100644 index 0000000..06c6151 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/common/enums/EnableState.java @@ -0,0 +1,23 @@ +package com.zsc.edu.gateway.common.enums; + +import com.baomidou.mybatisplus.annotation.IEnum; + +public enum EnableState implements IEnum { + ENABLE(Boolean.TRUE), + DISABLE(Boolean.FALSE); + + private boolean value; + + EnableState(Boolean value) { + this.value = value; + } + + @Override + public Boolean getValue() { + return this.value; + } + + public EnableState reverse() { + return this == ENABLE ? DISABLE : ENABLE; + } +} diff --git a/src/main/java/com/zsc/edu/gateway/common/mapstruct/BaseMapper.java b/src/main/java/com/zsc/edu/gateway/common/mapstruct/BaseMapper.java new file mode 100644 index 0000000..3e23405 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/common/mapstruct/BaseMapper.java @@ -0,0 +1,19 @@ +package com.zsc.edu.gateway.common.mapstruct; + +import org.mapstruct.MappingTarget; + +import java.util.List; + +public interface BaseMapper { + D toDto(E entity); + E toEntity(D dto); + List toDto(List entityList); + List toEntity(List dtoList); + + /** + * 更新实体类 + * @param dto + * @param entity + */ + void convert(D dto, @MappingTarget E entity); +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/ApiException.java b/src/main/java/com/zsc/edu/gateway/exception/ApiException.java new file mode 100644 index 0000000..f693b99 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/ApiException.java @@ -0,0 +1,32 @@ +package com.zsc.edu.gateway.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) +public class ApiException extends RuntimeException { + + public ApiException() { + super("发生服务器内部异常,请联系管理员提交故障"); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable cause) { + super(message, cause); + } + + public ApiException(Throwable cause) { + super(cause); + } + + public ApiException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/ApiExceptionHandler.java b/src/main/java/com/zsc/edu/gateway/exception/ApiExceptionHandler.java new file mode 100644 index 0000000..bc6f36d --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/ApiExceptionHandler.java @@ -0,0 +1,74 @@ +package com.zsc.edu.gateway.exception; + +//import com.zsc.study.module.common.domain.ResponseResult; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.Resource; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import java.util.Map; + +/** + * @author harry_yao + */ +@Slf4j +@AllArgsConstructor +@RestControllerAdvice +public class ApiExceptionHandler { + + @Resource + private ObjectMapper objectMapper; + @ExceptionHandler(value = {ConstraintException.class}) + public ResponseEntity handleException(ConstraintException ex) throws JsonProcessingException { + log.error("ConstraintException: {}", objectMapper.writeValueAsString(Map.of("msg", ex.getMessage()))); + return new ResponseEntity<>(objectMapper.writeValueAsString(Map.of("msg", ex.getMessage())), HttpStatus.BAD_REQUEST); + } + + @ExceptionHandler(value = {NotExistException.class}) + public ResponseEntity handleException(NotExistException ex) throws JsonProcessingException { + log.error("NotExistException: {}", objectMapper.writeValueAsString(Map.of("msg", ex.getMessage()))); + return new ResponseEntity<>(objectMapper.writeValueAsString(Map.of("msg", ex.getMessage())), HttpStatus.NOT_FOUND); + } + + @ExceptionHandler(value = {StateException.class}) + public ResponseEntity handleException(StateException ex) throws JsonProcessingException { + log.error("StateException: {}", objectMapper.writeValueAsString(Map.of("msg", ex.getMessage()))); + return new ResponseEntity<>(objectMapper.writeValueAsString(Map.of("msg", ex.getMessage())), HttpStatus.NOT_FOUND); + } + + @ExceptionHandler(value = {StorageException.class}) + public ResponseEntity handleException(StorageException ex) throws JsonProcessingException { + log.error("StorageException: {}", objectMapper.writeValueAsString(Map.of("msg", ex.getMessage()))); + return new ResponseEntity<>(objectMapper.writeValueAsString(Map.of("msg", ex.getMessage())), HttpStatus.NOT_FOUND); + } + + @ExceptionHandler(value = {UserHasNoIdentityException.class}) + public ResponseEntity handleException(UserHasNoIdentityException ex) throws JsonProcessingException { + log.error("UserHasNoIdentityException: {}", objectMapper.writeValueAsString(Map.of("msg", ex.getMessage()))); + return new ResponseEntity<>(objectMapper.writeValueAsString(Map.of("msg", ex.getMessage())), HttpStatus.UNAUTHORIZED); + } + + @ExceptionHandler(value = {ValidateException.class}) + public ResponseEntity handleException(ValidateException ex) throws JsonProcessingException { + log.error("ValidateException: {}", objectMapper.writeValueAsString(Map.of("msg", ex.getMessage()))); + return new ResponseEntity<>(objectMapper.writeValueAsString(Map.of("msg", ex.getMessage())), HttpStatus.UNAUTHORIZED); + } + + @ExceptionHandler(value = {ApiException.class}) + public ResponseEntity handleException(ApiException ex) throws JsonProcessingException { + log.error("ApiException: {}", objectMapper.writeValueAsString(Map.of("msg", ex.getMessage()))); + return new ResponseEntity<>(objectMapper.writeValueAsString(Map.of("msg", ex.getMessage())), HttpStatus.INTERNAL_SERVER_ERROR); + } + + @ExceptionHandler(value = {Exception.class}) + public ResponseEntity handleException(Exception ex) throws JsonProcessingException { + log.error("Exception: {}", objectMapper.writeValueAsString(Map.of("msg", ex.getMessage()))); + return new ResponseEntity<>(objectMapper.writeValueAsString(Map.of("msg", ex.getMessage())), HttpStatus.INTERNAL_SERVER_ERROR); + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/ConstraintException.java b/src/main/java/com/zsc/edu/gateway/exception/ConstraintException.java new file mode 100644 index 0000000..3702f15 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/ConstraintException.java @@ -0,0 +1,23 @@ +package com.zsc.edu.gateway.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.BAD_REQUEST) +public class ConstraintException extends ApiException { + + public ConstraintException(String fieldName, Object fieldValue) { + super(String.format("字段%s的值:'%s'不符合要求。", fieldName, fieldValue)); + } + + public ConstraintException(String fieldName, Object fieldValue, String message) { + super(String.format("字段%s的值:'%s'不符合要求,%s", fieldName, fieldValue, message)); + } + + public ConstraintException(String message) { + super(message); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/ExceptionResult.java b/src/main/java/com/zsc/edu/gateway/exception/ExceptionResult.java new file mode 100644 index 0000000..4ee3f95 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/ExceptionResult.java @@ -0,0 +1,17 @@ +package com.zsc.edu.gateway.exception; + +import lombok.AllArgsConstructor; + +import java.time.LocalDateTime; + +/** + * @author harry_yao + */ +@AllArgsConstructor +public class ExceptionResult { + + public final String msg; + public final Object code; + public final LocalDateTime timestamp; + +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/JwtAuthenticationException.java b/src/main/java/com/zsc/edu/gateway/exception/JwtAuthenticationException.java new file mode 100644 index 0000000..f129f06 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/JwtAuthenticationException.java @@ -0,0 +1,12 @@ +package com.zsc.edu.gateway.exception; + +import org.springframework.security.core.AuthenticationException; + +/** + * @author Yao + */ +public class JwtAuthenticationException extends AuthenticationException { + public JwtAuthenticationException(String msg) { + super(msg); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/NotExistException.java b/src/main/java/com/zsc/edu/gateway/exception/NotExistException.java new file mode 100644 index 0000000..eb6bbdc --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/NotExistException.java @@ -0,0 +1,23 @@ +package com.zsc.edu.gateway.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.NOT_FOUND) +public class NotExistException extends ApiException { + + public NotExistException(Class entity) { + super(String.format("%s对象不存在", entity.getSimpleName())); + } + + public NotExistException() { + super("对象不存在"); + } + + public NotExistException(String message) { + super(message); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/OutlineException.java b/src/main/java/com/zsc/edu/gateway/exception/OutlineException.java new file mode 100644 index 0000000..a7cde4b --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/OutlineException.java @@ -0,0 +1,19 @@ +package com.zsc.edu.gateway.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.BAD_REQUEST) +public class OutlineException extends ApiException { + + public OutlineException() { + super("设备不在线"); + } + + public OutlineException(String message) { + super(message); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/StateException.java b/src/main/java/com/zsc/edu/gateway/exception/StateException.java new file mode 100644 index 0000000..680b3b1 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/StateException.java @@ -0,0 +1,19 @@ +package com.zsc.edu.gateway.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.BAD_REQUEST) +public class StateException extends ApiException { + + public StateException(Class statusClass, Object currentStatus, Object correctStatus) { + super(String.format("%s当前的状态值'%s'不符合要求,正确的状态值可以是:%s。", statusClass.getSimpleName(), currentStatus, correctStatus)); + } + + public StateException(String message) { + super(message); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/StorageException.java b/src/main/java/com/zsc/edu/gateway/exception/StorageException.java new file mode 100644 index 0000000..faaaefd --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/StorageException.java @@ -0,0 +1,19 @@ +package com.zsc.edu.gateway.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.BAD_REQUEST) +public class StorageException extends ApiException { + + public StorageException() { + super("文件存储失败"); + } + + public StorageException(String message) { + super(message); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/UserHasNoIdentityException.java b/src/main/java/com/zsc/edu/gateway/exception/UserHasNoIdentityException.java new file mode 100644 index 0000000..35753ae --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/UserHasNoIdentityException.java @@ -0,0 +1,21 @@ +package com.zsc.edu.gateway.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.security.authentication.DisabledException; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.UNAUTHORIZED) +public class UserHasNoIdentityException extends DisabledException { + + public UserHasNoIdentityException() { + super("没有给用户分配身份"); + } + + public UserHasNoIdentityException(String message) { + super(message); + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/exception/ValidateException.java b/src/main/java/com/zsc/edu/gateway/exception/ValidateException.java new file mode 100644 index 0000000..cc43b1a --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/exception/ValidateException.java @@ -0,0 +1,21 @@ +package com.zsc.edu.gateway.exception; + + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ResponseStatus(HttpStatus.UNAUTHORIZED) +public class ValidateException extends ApiException { + + public ValidateException() { + super("验证码失效或错误!"); + } + + public ValidateException(String message) { + super(message); + } + + public ValidateException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/JsonExceptionUtil.java b/src/main/java/com/zsc/edu/gateway/framework/JsonExceptionUtil.java new file mode 100644 index 0000000..2bb5042 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/JsonExceptionUtil.java @@ -0,0 +1,21 @@ +package com.zsc.edu.gateway.framework; + +import org.springframework.http.HttpStatus; + +import java.util.Calendar; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @author harry yao + */ +public class JsonExceptionUtil { + public static Map jsonExceptionResult(HttpStatus code, String message, String path) { + Map exceptionMap = new LinkedHashMap<>(); + exceptionMap.put("timestamp", Calendar.getInstance().getTime()); + exceptionMap.put("message", message); + exceptionMap.put("path", path); + exceptionMap.put("code", code.value()); + return exceptionMap; + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/SpringBeanUtil.java b/src/main/java/com/zsc/edu/gateway/framework/SpringBeanUtil.java new file mode 100644 index 0000000..776bc16 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/SpringBeanUtil.java @@ -0,0 +1,29 @@ +package com.zsc.edu.gateway.framework; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.lang.NonNull; +import org.springframework.stereotype.Component; + +/** + * @author harry yao + */ +@Component +public class SpringBeanUtil implements ApplicationContextAware { + + private static ApplicationContext applicationContext; + + public static T getBean(Class beanClass) { + return applicationContext.getBean(beanClass); + } + + public static Object getBean(String beanName) { + return applicationContext.getBean(beanName); + } + + @Override + public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException { + SpringBeanUtil.applicationContext = applicationContext; + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/WebMvcConfiguration.java b/src/main/java/com/zsc/edu/gateway/framework/WebMvcConfiguration.java new file mode 100644 index 0000000..7fe2209 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/WebMvcConfiguration.java @@ -0,0 +1,47 @@ +package com.zsc.edu.gateway.framework; + +import jakarta.servlet.http.HttpServletRequest; +import lombok.AllArgsConstructor; +import org.springframework.boot.autoconfigure.web.WebProperties; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.Resource; +import org.springframework.lang.NonNull; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.resource.PathResourceResolver; +import org.springframework.web.servlet.resource.ResourceResolverChain; + +import java.util.List; + +/** + * @author harry_yao + */ +@Configuration +@AllArgsConstructor +public class WebMvcConfiguration implements WebMvcConfigurer { + + private final WebProperties webProperties; + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/**") + .addResourceLocations(webProperties.getResources().getStaticLocations()) + .resourceChain(webProperties.getResources().getChain().isCache()) + .addResolver(new FallbackPathResourceResolver()); + } + + private static class FallbackPathResourceResolver extends PathResourceResolver { + @Override + public Resource resolveResource( + HttpServletRequest request, + @NonNull String requestPath, + @NonNull List locations, + @NonNull ResourceResolverChain chain) { + Resource resource = super.resolveResource(request, requestPath, locations, chain); + if (resource == null) { + resource = super.resolveResource(request, "/index.html", locations, chain); + } + return resource; + } + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/async/AsyncConfiguration.java b/src/main/java/com/zsc/edu/gateway/framework/async/AsyncConfiguration.java new file mode 100644 index 0000000..c8b80a2 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/async/AsyncConfiguration.java @@ -0,0 +1,52 @@ +package com.zsc.edu.gateway.framework.async; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.AsyncConfigurer; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.lang.reflect.Method; +import java.util.concurrent.Executor; + +/** + * @author harry_yao + */ + +@Slf4j +@EnableAsync +@Configuration +//@Profile("!test") // test 环境下不启动异步 +public class AsyncConfiguration implements AsyncConfigurer { + +// @Bean +// public AsyncTaskExecutor taskExecutor() { +// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); +// executor.setCorePoolSize(20); +// executor.setMaxPoolSize(20); +// executor.setQueueCapacity(500); +// executor.setThreadNamePrefix("Executor"); +// executor.initialize(); +// return executor; +// } + + @Override + public Executor getAsyncExecutor() { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(20); + executor.setMaxPoolSize(20); + executor.setQueueCapacity(500); + executor.setThreadNamePrefix("Executor-"); + executor.initialize(); + return executor; + } + + @Override + public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { +// return AsyncConfigurer.super.getAsyncUncaughtExceptionHandler(); + return (Throwable throwable, Method method, Object... obj)->{ + log.info("Method name -{}, Exception message -{}", method.getName(),throwable); + }; + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/mybatisplus/ListTypeHandler.java b/src/main/java/com/zsc/edu/gateway/framework/mybatisplus/ListTypeHandler.java new file mode 100644 index 0000000..da20513 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/mybatisplus/ListTypeHandler.java @@ -0,0 +1,50 @@ +package com.zsc.edu.gateway.framework.mybatisplus; + + +import org.apache.ibatis.type.BaseTypeHandler; +import org.apache.ibatis.type.JdbcType; +import org.apache.ibatis.type.MappedJdbcTypes; +import org.apache.ibatis.type.MappedTypes; +import org.springframework.util.StringUtils; + +import java.sql.CallableStatement; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/** + * @author : wshuo + * @date : 2023/1/11 15:59 + */ +@MappedJdbcTypes(JdbcType.VARCHAR) +@MappedTypes({ArrayList.class}) +public class ListTypeHandler extends BaseTypeHandler> { + + private static final String DELIM = ","; + + @Override + public void setNonNullParameter(PreparedStatement preparedStatement, int i, ArrayList strings, JdbcType jdbcType) throws SQLException { + String value = StringUtils.collectionToDelimitedString(strings, DELIM); + preparedStatement.setString(i, value); + } + + @Override + public ArrayList getNullableResult(ResultSet resultSet, String s) throws SQLException { + String value = resultSet.getString(s); + return new ArrayList(List.of(StringUtils.tokenizeToStringArray(value, DELIM))); + } + + @Override + public ArrayList getNullableResult(ResultSet resultSet, int i) throws SQLException { + String value = resultSet.getString(i); + return new ArrayList(List.of(StringUtils.tokenizeToStringArray(value, DELIM))); + } + + @Override + public ArrayList getNullableResult(CallableStatement callableStatement, int i) throws SQLException { + String value = callableStatement.getString(i); + return new ArrayList(List.of(StringUtils.tokenizeToStringArray(value, DELIM))); + } +} \ No newline at end of file diff --git a/src/main/java/com/zsc/edu/gateway/framework/mybatisplus/MyMetaObjectHandler.java b/src/main/java/com/zsc/edu/gateway/framework/mybatisplus/MyMetaObjectHandler.java new file mode 100644 index 0000000..0dc1614 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/mybatisplus/MyMetaObjectHandler.java @@ -0,0 +1,37 @@ +package com.zsc.edu.gateway.framework.mybatisplus; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.zsc.edu.gateway.framework.security.SecurityUtil; +import com.zsc.edu.gateway.framework.security.UserDetailsImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.reflection.MetaObject; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; + +/** + * @author Yao + */ +@Slf4j +@Component +public class MyMetaObjectHandler implements MetaObjectHandler { + + @Override + public void insertFill(MetaObject metaObject) { + + UserDetailsImpl userInfo = SecurityUtil.getUserInfo(); + + this.strictInsertFill(metaObject, "createTime", LocalDateTime::now, LocalDateTime.class); + this.strictInsertFill(metaObject, "createdBy", userInfo::getUsername, String.class); + + } + + @Override + public void updateFill(MetaObject metaObject) { + UserDetailsImpl userInfo = SecurityUtil.getUserInfo(); + this.strictUpdateFill(metaObject, "updateTime", LocalDateTime::now, LocalDateTime.class); + this.strictUpdateFill(metaObject, "updatedBy", userInfo::getUsername, String.class); + + } + +} \ No newline at end of file diff --git a/src/main/java/com/zsc/edu/gateway/framework/mybatisplus/MybatisPlusConfig.java b/src/main/java/com/zsc/edu/gateway/framework/mybatisplus/MybatisPlusConfig.java new file mode 100644 index 0000000..cdb7d15 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/mybatisplus/MybatisPlusConfig.java @@ -0,0 +1,31 @@ +package com.zsc.edu.gateway.framework.mybatisplus; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author Yao + */ +@MapperScan(basePackages = "com.zsc.edu.gateway.modules.*.repo") +@Configuration +public class MybatisPlusConfig { + + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); +// // 添加数据权限插件 +// MyDataPermissionInterceptor dataPermissionInterceptor = new MyDataPermissionInterceptor(); +// // 添加自定义的数据权限处理器 +// dataPermissionInterceptor.setDataPermissionHandler(new MyDataPermissionHandler()); +// interceptor.addInnerInterceptor(dataPermissionInterceptor); + + + return interceptor; + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/CustomAccessDeniedHandler.java b/src/main/java/com/zsc/edu/gateway/framework/security/CustomAccessDeniedHandler.java new file mode 100644 index 0000000..ab1a80e --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/CustomAccessDeniedHandler.java @@ -0,0 +1,47 @@ +package com.zsc.edu.gateway.framework.security; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.zsc.edu.gateway.exception.ExceptionResult; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.AllArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.web.access.AccessDeniedHandler; +import org.springframework.security.web.csrf.MissingCsrfTokenException; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.time.LocalDateTime; + +/** + * @author harry_yao + */ +@AllArgsConstructor +@Component +public class CustomAccessDeniedHandler implements AccessDeniedHandler { + + private final ObjectMapper objectMapper; + + @Override + public void handle(HttpServletRequest request, HttpServletResponse response, + AccessDeniedException ex) throws IOException, ServletException { + response.setContentType("application/json;charset=utf-8"); + ExceptionResult result; + if (ex instanceof MissingCsrfTokenException) { + System.out.println("MissingCsrfTokenException"); + // 会话已注销,返回401 + response.setStatus(HttpStatus.UNAUTHORIZED.value()); + result = new ExceptionResult("凭证已过期,请重新登录", HttpStatus.UNAUTHORIZED.value(), + LocalDateTime.now()); + } else { + // 403 + response.setStatus(HttpStatus.FORBIDDEN.value()); + result = new ExceptionResult("禁止操作", HttpStatus.FORBIDDEN.value(), + LocalDateTime.now()); + } + response.getWriter().print(objectMapper.writeValueAsString(result)); + response.flushBuffer(); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/CustomAuthenticationEntryPoint.java b/src/main/java/com/zsc/edu/gateway/framework/security/CustomAuthenticationEntryPoint.java new file mode 100644 index 0000000..ee5f47b --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/CustomAuthenticationEntryPoint.java @@ -0,0 +1,35 @@ +package com.zsc.edu.gateway.framework.security;///* + +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.Map; + +/** + * 认证处理 + * 当用户尝试访问安全的REST资源而不提供任何凭据时,将调用此方法发送401 响应 + * @author Yao + */ +@Slf4j +@Component +public class CustomAuthenticationEntryPoint implements AuthenticationEntryPoint { + + @Resource + private ObjectMapper objectMapper; + + @Override + public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); + response.setContentType("application/json"); + response.getWriter().println(objectMapper.writeValueAsString(Map.of("msg", "认证失败: " + authException.getMessage()))); + response.flushBuffer(); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/CustomAuthenticationFailureHandler.java b/src/main/java/com/zsc/edu/gateway/framework/security/CustomAuthenticationFailureHandler.java new file mode 100644 index 0000000..6864984 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/CustomAuthenticationFailureHandler.java @@ -0,0 +1,37 @@ +package com.zsc.edu.gateway.framework.security; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.zsc.edu.gateway.exception.ExceptionResult; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.AllArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.authentication.AuthenticationFailureHandler; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.time.LocalDateTime; + +/** + * @author harry_yao + */ +@AllArgsConstructor +@Component +public class CustomAuthenticationFailureHandler implements AuthenticationFailureHandler { + + private final ObjectMapper objectMapper; + + @Override + public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, + AuthenticationException exception) throws IOException { + response.setStatus(HttpStatus.UNAUTHORIZED.value()); + response.setContentType("application/json;charset=utf-8"); + ExceptionResult result = new ExceptionResult(exception.getMessage(), HttpStatus.UNAUTHORIZED.value(), + LocalDateTime.now()); + response.getWriter().print(objectMapper.writeValueAsString(result)); + response.flushBuffer(); + } + +} + diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/CustomAuthenticationSuccessHandler.java b/src/main/java/com/zsc/edu/gateway/framework/security/CustomAuthenticationSuccessHandler.java new file mode 100644 index 0000000..f22f004 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/CustomAuthenticationSuccessHandler.java @@ -0,0 +1,46 @@ +package com.zsc.edu.gateway.framework.security; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.AllArgsConstructor; +import org.springframework.security.core.Authentication; +import org.springframework.security.web.authentication.AuthenticationSuccessHandler; +import org.springframework.stereotype.Component; + +import java.io.IOException; + +/** + * @author harry_yao + */ +@AllArgsConstructor +@Component +public class CustomAuthenticationSuccessHandler implements AuthenticationSuccessHandler { + +// private final OnlineUserService onlineUserService; +// private final UserService userService; +// private final LoginLogService loginLogService; + + @Override + public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException { +// Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); +// String sessionId = request.getRequestedSessionId(); +// String remoteAddr = request.getRemoteAddr(); +// User user = userService.getOne(((UserDetailsImpl) principal).getId()); +// String agent = request.getHeader("User-Agent"); +// UserAgent userAgent = new UserAgent(agent); +// OnlineUser onlineUser = onlineUserService.create( +// sessionId, +// user.username, +// user.name, +// null,//user.identity.dept.name, +// remoteAddr, +// userAgent.getBrowser().getName(), +// userAgent.getOperatingSystem().getName(), +// LocalDateTime.now() +// ); +// loginLogService.create(onlineUser.username, onlineUser.name, onlineUser.deptName, +// onlineUser.ip, onlineUser.browser, onlineUser.os, +// onlineUser.loginTime, LoginLog.Result.登陆成功); + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/CustomSessionInformationExpiredStrategy.java b/src/main/java/com/zsc/edu/gateway/framework/security/CustomSessionInformationExpiredStrategy.java new file mode 100644 index 0000000..30e0de7 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/CustomSessionInformationExpiredStrategy.java @@ -0,0 +1,30 @@ +package com.zsc.edu.gateway.framework.security; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.zsc.edu.gateway.exception.ExceptionResult; +import com.zsc.edu.gateway.framework.SpringBeanUtil; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.http.HttpStatus; +import org.springframework.security.web.session.SessionInformationExpiredEvent; +import org.springframework.security.web.session.SessionInformationExpiredStrategy; + +import java.io.IOException; +import java.time.LocalDateTime; + +/** + * @author harry_yao + */ +public class CustomSessionInformationExpiredStrategy implements SessionInformationExpiredStrategy { + @Override + public void onExpiredSessionDetected(SessionInformationExpiredEvent event) throws IOException { + ObjectMapper objectMapper = SpringBeanUtil.getBean(ObjectMapper.class); + HttpServletResponse response = event.getResponse(); + response.setStatus(HttpStatus.UNAUTHORIZED.value()); + response.setContentType("application/json;charset=utf-8"); + ExceptionResult result = new ExceptionResult("会话已过期(有可能是您同时登录了太多的太多的客户端)", + HttpStatus.UNAUTHORIZED.value(), + LocalDateTime.now()); + response.getWriter().print(objectMapper.writeValueAsString(result)); + response.flushBuffer(); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/JpaUserDetailsServiceImpl.java b/src/main/java/com/zsc/edu/gateway/framework/security/JpaUserDetailsServiceImpl.java new file mode 100644 index 0000000..5cd7ad7 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/JpaUserDetailsServiceImpl.java @@ -0,0 +1,52 @@ +package com.zsc.edu.gateway.framework.security; + +import com.zsc.edu.gateway.exception.StateException; +import com.zsc.edu.gateway.modules.system.entity.RoleAuthority; +import com.zsc.edu.gateway.modules.system.entity.User; +import com.zsc.edu.gateway.modules.system.repo.AuthorityRepository; +import com.zsc.edu.gateway.modules.system.repo.RoleAuthoritiesRepository; +import com.zsc.edu.gateway.modules.system.repo.UserRepository; +import lombok.AllArgsConstructor; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author harry_yao + */ +@AllArgsConstructor +@Service +public class JpaUserDetailsServiceImpl implements UserDetailsService { + + private final UserRepository userRepo; + private final RoleAuthoritiesRepository roleAuthoritiesRepository; + private final AuthorityRepository authorityRepository; + + @Override + @Transactional(rollbackFor = Exception.class) + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + User user = userRepo.selectByUsername(username); + if (!user.getEnableState()) { + throw new StateException("用户 '" + username + "' 已被禁用!请联系管理员"); + } + + List roleAuthorities= roleAuthoritiesRepository.selectByRoleId(user.getRoleId()); + user.role.authorities = authorityRepository.selectAuthoritiesByRoleId(user.getRoleId()); +// =roleAuthorities.stream() +// .map(i -> Authority.valueOf(i.getAuthority())) +// .collect(Collectors.toSet()); + + + +// .orElseThrow(() -> +// new UsernameNotFoundException("用户 '" + username + "' 不存在!") +// ); +// user.getIdentities().stream().filter(identity -> identity.role.enableState == EnableState.启用) +// .forEach(identity -> Hibernate.initialize(identity.role.roleAuthorities)); + return UserDetailsImpl.from(user); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/JsonAuthenticationFilter.java b/src/main/java/com/zsc/edu/gateway/framework/security/JsonAuthenticationFilter.java new file mode 100644 index 0000000..fbca478 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/JsonAuthenticationFilter.java @@ -0,0 +1,45 @@ +package com.zsc.edu.gateway.framework.security; + +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.http.MediaType; +import org.springframework.security.authentication.AuthenticationServiceException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +import java.io.IOException; +import java.util.Map; + +public class JsonAuthenticationFilter extends UsernamePasswordAuthenticationFilter { + @Override + public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) + throws AuthenticationException { + if (!request.getMethod().equals("POST")) { + throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod()); + } + if (request.getContentType().equals(MediaType.APPLICATION_JSON_VALUE)) { + try { + Map map = new ObjectMapper().readValue(request.getInputStream(), Map.class); + String username = map.get("username").toString(); + String password = map.get("password").toString(); + + username = (username != null) ? username : ""; + username = username.trim(); + password = (password != null) ? password : ""; + password = password.trim(); + UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, password); + // Allow subclasses to set the "details" property + setDetails(request, authRequest); + return this.getAuthenticationManager().authenticate(authRequest); + } catch (IOException e) { + e.printStackTrace(); + } + } + return super.attemptAuthentication(request, response); + } + + +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/SecurityBeanConfig.java b/src/main/java/com/zsc/edu/gateway/framework/security/SecurityBeanConfig.java new file mode 100644 index 0000000..4372f35 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/SecurityBeanConfig.java @@ -0,0 +1,30 @@ +package com.zsc.edu.gateway.framework.security; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.session.SessionRegistry; +import org.springframework.security.core.session.SessionRegistryImpl; +import org.springframework.security.crypto.factory.PasswordEncoderFactories; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.session.HttpSessionEventPublisher; + +/** + * @author harry_yao + */ +@Configuration +public class SecurityBeanConfig { + @Bean + public PasswordEncoder passwordEncoder() { + return PasswordEncoderFactories.createDelegatingPasswordEncoder(); + } + + @Bean + public SessionRegistry sessionRegistry() { + return new SessionRegistryImpl(); + } + + @Bean + public HttpSessionEventPublisher httpSessionEventPublisher() { + return new HttpSessionEventPublisher(); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/SecurityUtil.java b/src/main/java/com/zsc/edu/gateway/framework/security/SecurityUtil.java new file mode 100644 index 0000000..ccef85a --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/SecurityUtil.java @@ -0,0 +1,19 @@ +package com.zsc.edu.gateway.framework.security; + +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; + +/** + * @author Yao + */ +public class SecurityUtil { + + public static UserDetailsImpl getUserInfo() { + return getPrincipal(); + } + + private static UserDetailsImpl getPrincipal() { + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + return (UserDetailsImpl) authentication.getPrincipal(); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/SpringSecurityConfig.java b/src/main/java/com/zsc/edu/gateway/framework/security/SpringSecurityConfig.java new file mode 100644 index 0000000..b3945e8 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/SpringSecurityConfig.java @@ -0,0 +1,100 @@ +package com.zsc.edu.gateway.framework.security; + +import jakarta.annotation.Resource; +import lombok.AllArgsConstructor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.ProviderManager; +import org.springframework.security.authentication.dao.DaoAuthenticationProvider; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.core.session.SessionRegistry; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl; +import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; +import org.springframework.security.web.context.HttpSessionSecurityContextRepository; + +import javax.sql.DataSource; + +/** + * @author harry_yao + */ +@AllArgsConstructor +@Configuration +public class SpringSecurityConfig { + + private final UserDetailsService userDetailsService; + private final CustomAuthenticationFailureHandler customAuthenticationFailureHandler; + private final CustomAuthenticationSuccessHandler customAuthenticationSuccessHandler; + private final CustomAuthenticationEntryPoint customAuthenticationEntryPoint; + private final CustomAccessDeniedHandler customAccessDeniedHandler; + private final SessionRegistry sessionRegistry; + private final SecurityBeanConfig securityBeanConfig; + + @Resource + private final DataSource dataSource; + + @Bean + public PersistentTokenRepository persistentTokenRepository() { + JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl(); + tokenRepository.setDataSource(dataSource); + return tokenRepository; + } + + @Bean + AuthenticationManager authenticationManager() { + DaoAuthenticationProvider daoAuthenticationProvider = new DaoAuthenticationProvider(); + daoAuthenticationProvider.setUserDetailsService(userDetailsService); + daoAuthenticationProvider.setPasswordEncoder(securityBeanConfig.passwordEncoder()); + return new ProviderManager(daoAuthenticationProvider); + } + + @Bean + public JsonAuthenticationFilter jsonAuthenticationFilter() throws Exception { + JsonAuthenticationFilter filter = new JsonAuthenticationFilter(); + filter.setAuthenticationSuccessHandler(customAuthenticationSuccessHandler); + filter.setAuthenticationFailureHandler(customAuthenticationFailureHandler); + filter.setFilterProcessesUrl("/api/rest/user/login"); + filter.setAuthenticationManager(authenticationManager()); + // 将登录后的请求信息保存到Session中,不然会报null + filter.setSecurityContextRepository(new HttpSessionSecurityContextRepository()); + return filter; + } + + @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + + return http + .authorizeHttpRequests(auth -> auth + .requestMatchers(HttpMethod.GET, "/api/rest/user/me","/api/rest/user/register","/api/rest/user/send-email").permitAll() + .requestMatchers(HttpMethod.POST, "/api/rest/user/login","/api/rest/user/register").permitAll() + .requestMatchers("/api/**").authenticated()) + .addFilterAt(jsonAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class) + .formLogin(form -> form + .loginPage("/user/login") + .loginProcessingUrl("/api/rest/user/login") + .successHandler(customAuthenticationSuccessHandler) + .failureHandler(customAuthenticationFailureHandler)) + .logout(logout -> logout + .logoutUrl("/api/user/logout") + .logoutSuccessHandler((request, response, authentication) -> {})) + // 添加自定义未授权和未登录结果返回 + .exceptionHandling(exception -> exception + .authenticationEntryPoint(customAuthenticationEntryPoint) + .accessDeniedHandler(customAccessDeniedHandler) + ) + .rememberMe(rememberMe -> rememberMe + .userDetailsService(userDetailsService) + .tokenRepository(persistentTokenRepository())) + .csrf(csrf -> csrf.ignoringRequestMatchers("/api/internal/**", "/api/rest/user/logout","/api/rest/user/register")) + .sessionManagement(session -> session + .maximumSessions(3) + .sessionRegistry(sessionRegistry) + .expiredSessionStrategy(new CustomSessionInformationExpiredStrategy())) + .build(); + + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/security/UserDetailsImpl.java b/src/main/java/com/zsc/edu/gateway/framework/security/UserDetailsImpl.java new file mode 100644 index 0000000..39197ab --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/security/UserDetailsImpl.java @@ -0,0 +1,88 @@ +package com.zsc.edu.gateway.framework.security; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.zsc.edu.gateway.common.enums.EnableState; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.entity.User; +import lombok.*; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Collection; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @author harry yao + */ +@Setter +@Getter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@JsonIgnoreProperties("password") +public class UserDetailsImpl implements UserDetails { + + public Long id; + public String username; + public String password; + public Boolean enableState; + public String name; + public Dept dept; + public Role role; + public Set authorities; + + public UserDetailsImpl(Long id, String username, String password, String name, Boolean enableState, Dept dept, Role role, Set authorities) { + this.id = id; + this.username = username; + this.password = password; + this.enableState = enableState; + this.name = name; + this.dept = dept; + this.role = role; + this.authorities = authorities; + } + + public static UserDetailsImpl from(User user) { + return new UserDetailsImpl( + user.id, + user.username, + user.password, + user.name, + user.enableState, + user.dept, + user.role, + user.role.authorities + ); + } + + @Override + + public Collection getAuthorities() { + return authorities.stream().map(authority -> new SimpleGrantedAuthority(authority.getName())).collect(Collectors.toSet()); + } + + @Override + public boolean isAccountNonExpired() { + return true; + } + + @Override + public boolean isAccountNonLocked() { + return true; + } + + @Override + public boolean isCredentialsNonExpired() { + return true; + } + + @Override + public boolean isEnabled() { + return enableState; + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/storage/StorageProperties.java b/src/main/java/com/zsc/edu/gateway/framework/storage/StorageProperties.java new file mode 100644 index 0000000..7e1ab85 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/storage/StorageProperties.java @@ -0,0 +1,25 @@ +package com.zsc.edu.gateway.framework.storage; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * @author harry_yao + */ +@ConfigurationProperties("storage") +@Component +public class StorageProperties { + + /** + * 附件存储路径 + */ + @Value("${storage.attachment}") + public String attachment; + + /** + * 临时文件存储路径 + */ + @Value("${storage.temp}") + public String temp; +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/storage/exception/StorageException.java b/src/main/java/com/zsc/edu/gateway/framework/storage/exception/StorageException.java new file mode 100644 index 0000000..7ced833 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/storage/exception/StorageException.java @@ -0,0 +1,23 @@ +package com.zsc.edu.gateway.framework.storage.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) +public class StorageException extends RuntimeException { + + public StorageException() { + super("文件存储出错"); + } + + public StorageException(String message) { + super(message); + } + + public StorageException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/storage/exception/StorageFileEmptyException.java b/src/main/java/com/zsc/edu/gateway/framework/storage/exception/StorageFileEmptyException.java new file mode 100644 index 0000000..ab471da --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/storage/exception/StorageFileEmptyException.java @@ -0,0 +1,23 @@ +package com.zsc.edu.gateway.framework.storage.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.BAD_REQUEST) +public class StorageFileEmptyException extends StorageException { + + public StorageFileEmptyException() { + super("存储的是空文件!"); + } + + public StorageFileEmptyException(String message) { + super(message); + } + + public StorageFileEmptyException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/framework/storage/exception/StorageFileNotFoundException.java b/src/main/java/com/zsc/edu/gateway/framework/storage/exception/StorageFileNotFoundException.java new file mode 100644 index 0000000..55c107a --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/framework/storage/exception/StorageFileNotFoundException.java @@ -0,0 +1,23 @@ +package com.zsc.edu.gateway.framework.storage.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +/** + * @author harry_yao + */ +@ResponseStatus(HttpStatus.NOT_FOUND) +public class StorageFileNotFoundException extends StorageException { + + public StorageFileNotFoundException() { + super("文件不存在!"); + } + + public StorageFileNotFoundException(String message) { + super(message); + } + + public StorageFileNotFoundException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/attachment/controller/AttachmentController.java b/src/main/java/com/zsc/edu/gateway/modules/attachment/controller/AttachmentController.java new file mode 100644 index 0000000..f6f074d --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/attachment/controller/AttachmentController.java @@ -0,0 +1,94 @@ +package com.zsc.edu.gateway.modules.attachment.controller; + +import com.zsc.edu.gateway.exception.StorageException; +import com.zsc.edu.gateway.modules.attachment.entity.Attachment; +import com.zsc.edu.gateway.modules.attachment.service.AttachmentService; +import lombok.AllArgsConstructor; +import org.springframework.core.io.Resource; +import org.springframework.http.ContentDisposition; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; + +/** + * 附件Controller + * + * @author harry_yao + */ +@AllArgsConstructor +@RestController +@RequestMapping("api/rest/attachment") +public class AttachmentController { + + private final AttachmentService service; + + /** + * 上传附件 + * + * @param type 附件功能类型 + * @param file 文件 + * @return 附件信息 + */ + @PostMapping() + public Attachment upload( + @RequestParam(required = false, defaultValue = "其他") Attachment.Type type, + @RequestParam("file") MultipartFile file + ) { + try { + if (type == null) { + type = Attachment.Type.其他; + } + return service.store(type, file); + } catch (IOException e) { + throw new StorageException("文件上传出错"); + } + } + + /** + * 下载附件 + * + * @param id 附件ID + * @return 附件文件内容 + */ + @GetMapping("{id}") + public ResponseEntity download( + @PathVariable("id") String id + ) { + Attachment.Wrapper wrapper = service.loadAsWrapper(id); + if (wrapper.attachment.fileName != null) { + ContentDisposition contentDisposition = ContentDisposition.builder("attachment").filename(wrapper.attachment.fileName, StandardCharsets.UTF_8).build(); + return ResponseEntity.ok(). + header(HttpHeaders.CONTENT_DISPOSITION, contentDisposition.toString()). + header(HttpHeaders.CONTENT_TYPE, wrapper.attachment.mimeType). + body(wrapper.resource); + } + return ResponseEntity.ok(wrapper.resource); + } + /** + * 根据附件ID获取附件信息 + * */ + @GetMapping("find/{id}") + public Attachment getAttachmentInfo(@PathVariable("id") String id) { + return service.getById(id); + } + @PostMapping("uploadMultipleFiles") + public List uploadMultipleFiles( + @RequestParam(defaultValue = "其他") Attachment.Type type, + @RequestParam("files") List files + ) throws IOException { + List attachments = new ArrayList<>(); + for (MultipartFile file : files) { + if (!file.isEmpty()) { + attachments.add(service.stores(type, file)); + } + } + return attachments; + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/attachment/dto/AttachmentDto.java b/src/main/java/com/zsc/edu/gateway/modules/attachment/dto/AttachmentDto.java new file mode 100644 index 0000000..5a54e0a --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/attachment/dto/AttachmentDto.java @@ -0,0 +1,64 @@ +package com.zsc.edu.gateway.modules.attachment.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author ftz + * 创建时间:29/1/2024 上午10:00 + * 描述: 附件Dto + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AttachmentDto { + /** + * 文件名 文件名详细说明 + */ + + private String saveFilename; + + /** + * 文件UUID 返回给前端的文件UUID + */ + + private String uuid; + + /** + * 上传时的文件名 原文件名 + */ + + private String originFilename; + + /** + * 文件大小 + */ + + private Long fileSize; + + /** + * 文件类型 + */ + + private String fileType; + + /** + * 文件扩展名 + */ + + private String extendName; + + /** + * 票据id 附件对应的票据id + */ + + private Long ticketId; + private String remark; + + /** + *文件url + */ + + private String fileUrl; +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/attachment/entity/Attachment.java b/src/main/java/com/zsc/edu/gateway/modules/attachment/entity/Attachment.java new file mode 100644 index 0000000..c8679d2 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/attachment/entity/Attachment.java @@ -0,0 +1,100 @@ +package com.zsc.edu.gateway.modules.attachment.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.core.io.FileSystemResource; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 附件 + * + * @author harry_yao + */ +@NoArgsConstructor +@Getter +@Setter +@TableName(value ="attach_file") +public class Attachment implements Serializable { + + /** + * ID,用文件和文件名的SHA-1值生成 + */ + @TableId + public String id; + + /** + * 文件名 + */ + + public String fileName; + + /** + * 附件作用类型 + */ + + public String mimeType; + + /** + * 附件功能类型 + */ +// @Column(nullable = false) +// @Enumerated(EnumType.STRING) +// public Type type = Type.其他; + + /** + * 文件上传时间 + */ + + public LocalDateTime uploadTime; + + /** + * 文件下载链接 + */ + @JsonSerialize + @TableField(exist = false) + public String url; + + public Attachment(String id, String fileName, String mimeType, Type type, LocalDateTime uploadTime) { + this.id = id; + this.fileName = fileName; + this.mimeType = mimeType; + // this.type = type; + this.uploadTime = uploadTime; + this.url = "/api/rest/attachment/" + id; + } + + public void setId(String id) { + this.id = id; + this.url = "/api/rest/attachment/" + id; + } + + public String getUrl() { + return "/api/rest/attachment/" + id; + } + + /** + * 枚举类:附件功能类型 + */ + public enum Type { + 其他, + 头像 + } + + @AllArgsConstructor + public static final class Wrapper { + + public Attachment attachment; + + public FileSystemResource resource; + + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/attachment/repo/AttachmentRepository.java b/src/main/java/com/zsc/edu/gateway/modules/attachment/repo/AttachmentRepository.java new file mode 100644 index 0000000..1c3336d --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/attachment/repo/AttachmentRepository.java @@ -0,0 +1,12 @@ +package com.zsc.edu.gateway.modules.attachment.repo; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsc.edu.gateway.modules.attachment.entity.Attachment; + +/** + * @author ftz + * 创建时间:29/1/2024 上午9:55 + * 描述: TODO + */ +public interface AttachmentRepository extends BaseMapper{ +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/attachment/service/AttachmentService.java b/src/main/java/com/zsc/edu/gateway/modules/attachment/service/AttachmentService.java new file mode 100644 index 0000000..7b7064d --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/attachment/service/AttachmentService.java @@ -0,0 +1,20 @@ +package com.zsc.edu.gateway.modules.attachment.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zsc.edu.gateway.modules.attachment.entity.Attachment; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; + +/** +* @author fantianzhi +* @description 针对表【attach_file(票据附件表)】的数据库操作Service +* @createDate 2024-01-28 19:48:22 +*/ +public interface AttachmentService extends IService { + + Attachment store(Attachment.Type type, MultipartFile file) throws IOException; + Attachment stores(Attachment.Type type, MultipartFile file)throws IOException; + + Attachment.Wrapper loadAsWrapper(String id); +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/attachment/service/impl/AttachmentServiceImpl.java b/src/main/java/com/zsc/edu/gateway/modules/attachment/service/impl/AttachmentServiceImpl.java new file mode 100644 index 0000000..0bbc3a8 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/attachment/service/impl/AttachmentServiceImpl.java @@ -0,0 +1,202 @@ +package com.zsc.edu.gateway.modules.attachment.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zsc.edu.gateway.framework.storage.StorageProperties; +import com.zsc.edu.gateway.framework.storage.exception.StorageFileEmptyException; +import com.zsc.edu.gateway.framework.storage.exception.StorageFileNotFoundException; +import com.zsc.edu.gateway.modules.attachment.entity.Attachment; +import com.zsc.edu.gateway.modules.attachment.repo.AttachmentRepository; +import com.zsc.edu.gateway.modules.attachment.service.AttachmentService; +import jakarta.annotation.PostConstruct; +import org.apache.commons.codec.binary.Hex; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.tika.Tika; +import org.springframework.core.io.FileSystemResource; +import org.springframework.core.io.Resource; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.security.MessageDigest; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +/** + * 附件Service + * + * @author harry_yao + */ +@Service +public class AttachmentServiceImpl extends ServiceImpl implements AttachmentService { + + final static int[] illegalChars = {34, 60, 62, 124, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 58, 42, 63, 92, 47}; + + private final AttachmentRepository repo; + private final Path attachmentPath; + private final Path tempPath; + + public AttachmentServiceImpl(AttachmentRepository repo, StorageProperties storageProperties) { + this.repo = repo; + this.attachmentPath = Paths.get(storageProperties.attachment); + this.tempPath = Paths.get(storageProperties.temp); + } + + @PostConstruct + public void init() throws IOException { + if (Files.notExists(attachmentPath)) { + Files.createDirectories(attachmentPath); + } + if (Files.notExists(tempPath)) { + Files.createDirectories(tempPath); + } + } + + public Attachment store(Attachment.Type type, MultipartFile file) throws IOException { + if (file.isEmpty()) { + throw new StorageFileEmptyException(); + } + MessageDigest digest = DigestUtils.getSha1Digest(); + String filename = file.getOriginalFilename(); + if (filename != null) { + digest.update(filename.getBytes()); + } + Path temp = tempPath.resolve(String.valueOf(System.nanoTime())); + byte[] fileContent = file.getBytes(); + ByteArrayInputStream input = new ByteArrayInputStream(fileContent); + Tika tika = new Tika(); + String mimeType = tika.detect(input, filename); + OutputStream output = Files.newOutputStream(temp); + digest.update(fileContent); + output.write(fileContent); + input.close(); + output.flush(); + output.close(); + String sha1 = Hex.encodeHexString(digest.digest()); + return save(temp, sha1, filename, mimeType, type); + } + + @Override + public Attachment stores(Attachment.Type type, MultipartFile file) throws IOException{ + if (file.isEmpty()) { + throw new StorageFileEmptyException("上传的文件不能为空"); + } + + String filename = file.getOriginalFilename(); + if (filename == null || filename.trim().isEmpty()) { + throw new IllegalArgumentException("文件名不能为空"); + } + + MessageDigest digest = DigestUtils.getSha1Digest(); + digest.update(filename.getBytes(StandardCharsets.UTF_8)); + + Path temp = tempPath.resolve(String.valueOf(System.nanoTime())); + byte[] fileContent = file.getBytes(); + + // 使用try-with-resources自动关闭流 + try (ByteArrayInputStream input = new ByteArrayInputStream(fileContent); + OutputStream output = Files.newOutputStream(temp)) { + Tika tika = new Tika(); + String mimeType = tika.detect(input, filename); + digest.update(fileContent); + output.write(fileContent); + String sha1 = Hex.encodeHexString(digest.digest()); + return save(temp, sha1, filename, mimeType, type); + } + + } + public Attachment store(Attachment.Type type, File file) throws IOException { + MessageDigest digest = DigestUtils.getSha1Digest(); + String filename = file.getName(); + if (filename != null) { + digest.update(filename.getBytes()); + } + Tika tika = new Tika(); + String mimeType = tika.detect(file); + String sha1 = Hex.encodeHexString(digest.digest()); + return save(file.toPath(), sha1, filename, mimeType, type); + } + + public Attachment store(Attachment.Type type, Path file) throws IOException { + String filename = file.getFileName().toString(); + MessageDigest digest = DigestUtils.getSha1Digest(); + if (filename != null) { + digest.update(filename.getBytes()); + } + Tika tika = new Tika(); + String mimeType = tika.detect(file); + InputStream input = Files.newInputStream(file); + byte[] buf = new byte[8192]; + int n; + while ((n = input.read(buf)) > 0) { + digest.update(buf, 0, n); + } + String sha1 = Hex.encodeHexString(digest.digest()); + return save(file, sha1, filename, mimeType, type); + } + + public Resource loadAsResource(String id) { + Path file = attachmentPath.resolve(id); + FileSystemResource resource = new FileSystemResource(file); + if (resource.exists() || resource.isReadable()) { + return resource; + } else { + throw new StorageFileNotFoundException(); + } + } + + public Attachment.Wrapper loadAsWrapper(String id) { + Path file = attachmentPath.resolve(id); + FileSystemResource resource = new FileSystemResource(file); + if (!resource.exists() || !resource.isReadable()) { + throw new StorageFileNotFoundException(); + } + Attachment attachment = repo.selectById(id); //.orElseThrow(NotExistException::new); + return new Attachment.Wrapper(attachment, resource); + } + + public Attachment findById(String id) { + return repo.selectById(id); //.orElseThrow(NotExistException::new); + } + + public List findAllById(Collection ids) { + return (ids != null && !ids.isEmpty()) ? repo.selectList(new LambdaQueryWrapper().in(Attachment::getId, ids)) : new ArrayList<>(); + } + + public Path convertToTempPath(String fileName) { + fileName = fileName.replace("/", ""); + Path path; + try { + path = tempPath.resolve(fileName); + } catch (Exception e) { + StringBuilder cleanName = new StringBuilder(); + for (int i = 0; i < fileName.length(); i++) { + int c = fileName.charAt(i); + if (Arrays.binarySearch(illegalChars, c) < 0) { + cleanName.append((char) c); + } + } + path = tempPath.resolve(cleanName.toString()); + } + return path; + } + + private Attachment save(Path temp, String id, String filename, String mimeType, Attachment.Type type) throws IOException { + Path dest = attachmentPath.resolve(id); + if (Files.exists(dest)) { + return findById(id); + } + Files.move(temp, dest); + Attachment attachment = new Attachment(id, filename, mimeType, type, LocalDateTime.now()); + repo.insert(attachment); + return attachment; + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/controller/AuthorityController.java b/src/main/java/com/zsc/edu/gateway/modules/system/controller/AuthorityController.java new file mode 100644 index 0000000..40bd535 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/controller/AuthorityController.java @@ -0,0 +1,81 @@ +package com.zsc.edu.gateway.modules.system.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zsc.edu.gateway.modules.system.dto.AuthorityDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.query.AuthorityQuery; +import com.zsc.edu.gateway.modules.system.service.AuthorityService; +import lombok.AllArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +/** + * 权限Controller + * + * @author zhuang + */ +@AllArgsConstructor +@RestController +@RequestMapping("/api/rest/auth") +public class AuthorityController { + + private AuthorityService service; + + /** + * 返回权限列表 hasAuthority('AUTHORITY_QUERY') + * + * @param query 查询表单 + * @return 权限列表 + */ + @GetMapping + @PreAuthorize("hasAuthority('AUTHORITY_QUERY')") + public Page query(AuthorityQuery query, Page page) { + return service.page(page, query.wrapper()); + } + + + /** + * 新建权限 hasAuthority('AUTHORITY_CREATE') + * + * @param dto 表单数据 + * @return Authority 新建的权限 + */ + @PostMapping + @PreAuthorize("hasAuthority('AUTHORITY_CREATE')") + public Authority create(@RequestBody AuthorityDto dto) { + return service.create(dto); + } + + /** + * 更新权限 hasAuthority('AUTHORITY_UPDATE') + * + * @param dto 表单数据 + * @param id 权限ID + * @return Dept 更新后的权限信息 + */ + @PatchMapping("/{id}") + @PreAuthorize("hasAuthority('AUTHORITY_UPDATE')") + public Boolean update(@RequestBody AuthorityDto dto, @PathVariable("id") Long id) { + return service.update(dto, id); + } + /*** + * 删除权限 hasAuthority('AUTHORITY_DELETE') + * @param id 权限ID + * @return Boolean 是否删除成功 + */ + @DeleteMapping("/{id}") + @PreAuthorize("hasAuthority('AUTHORITY_DELETE')") + public Boolean delete(@PathVariable("id") Long id) { + return service.removeById(id); + } + /** + * 更新权限启用状态 + * */ + @PatchMapping("/toggle/{id}") + @PreAuthorize("hasAuthority('AUTHORITY_TOGGLE')") + public Boolean toggle(@PathVariable("id") Long id) { + return service.toggle(id); + } + + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/controller/DeptController.java b/src/main/java/com/zsc/edu/gateway/modules/system/controller/DeptController.java new file mode 100644 index 0000000..1168dd4 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/controller/DeptController.java @@ -0,0 +1,93 @@ +package com.zsc.edu.gateway.modules.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zsc.edu.gateway.exception.ConstraintException; +import com.zsc.edu.gateway.modules.system.dto.DeptDto; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.zsc.edu.gateway.modules.system.entity.User; +import com.zsc.edu.gateway.modules.system.query.DeptQuery; +import com.zsc.edu.gateway.modules.system.service.DeptService; +import com.zsc.edu.gateway.modules.system.service.UserService; +import lombok.AllArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +/** + * 部门Controller + * + * @author pengzheng + */ +@AllArgsConstructor +@RestController +@RequestMapping("/api/rest/dept") +public class DeptController { + + private final DeptService service; + private final UserService userService; + + /** + * 返回管理部门列表 hasAuthority('DEPT_QUERY') + * + * @param query 查询表单 + * @return 部门列表 + */ + @GetMapping + @PreAuthorize("hasAuthority('DEPT_QUERY')") + public Page query(DeptQuery query, Page page) { + return service.page(page, query.wrapper()); + } + + /** + * 新建管理部门 hasAuthority('DEPT_CREATE') + * + * @param dto 表单数据 + * @return Dept 新建的管理部门 + */ + @PostMapping + @PreAuthorize("hasAuthority('DEPT_CREATE')") + public Dept create(@RequestBody DeptDto dto) { + return service.create(dto); + } + + /** + * 更新管理部门 hasAuthority('DEPT_UPDATE') + * + * @param dto 表单数据 + * @param id 部门ID + * @return Dept 更新后的部门 + */ + @PatchMapping("/{id}") + @PreAuthorize("hasAuthority('DEPT_UPDATE')") + public Boolean update(@RequestBody DeptDto dto, @PathVariable("id") Long id) { + return service.edit(dto, id); + } + /*** + * 删除管理部门 hasAuthority('DEPT_DELETE') + * @param id 部门ID + * @return Boolean 是否删除成功 + */ + @DeleteMapping("/{id}") + @PreAuthorize("hasAuthority('DEPT_DELETE')") + public Boolean delete(@PathVariable("id") Long id) { + /** + * 是否存在用户绑定此部门 + * */ + boolean hasUser = userService.count(new LambdaQueryWrapper().eq(User::getDeptId, id)) > 0; + if (hasUser) { + throw new ConstraintException("存在与本部门绑定的用户,请先删除用户"); + } + return service.removeById(id); + } + /** + * 更新管理部门状态 + * */ + @PatchMapping("/toggle/{id}") + @PreAuthorize("hasAuthority('DEPT_TOGGLE')") + public Boolean toggle(@PathVariable("id") Long id) { + return service.toggle(id); + } + + +} + diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/controller/RoleController.java b/src/main/java/com/zsc/edu/gateway/modules/system/controller/RoleController.java new file mode 100644 index 0000000..7866466 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/controller/RoleController.java @@ -0,0 +1,119 @@ +package com.zsc.edu.gateway.modules.system.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zsc.edu.gateway.modules.system.dto.AuthorityCreateDto; +//import com.zsc.edu.gateway.modules.system.dto.RoleAuthCreateDto; +import com.zsc.edu.gateway.modules.system.dto.RoleDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.query.RoleQuery; +import com.zsc.edu.gateway.modules.system.service.RoleAuthService; +import com.zsc.edu.gateway.modules.system.service.RoleService; +import com.zsc.edu.gateway.modules.system.vo.RoleVo; +import lombok.AllArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.util.Set; + +/** + * 角色Controller + * + * @author harry yao + */ +@AllArgsConstructor +@RestController +@RequestMapping("/api/rest/role") +public class RoleController { + + + private final RoleService service; + private final RoleAuthService roleAuthService; + + /** + * 返回所有角色列表 hasAuthority('ROLE_QUERY') + * + * @return 所有角色列表 + */ + @GetMapping + @PreAuthorize("hasAuthority('ROLE_QUERY')") + public Page query(RoleQuery query, Page page) { + return service.page(page, query.wrapper()); + } + + /** + * 新建角色 hasAuthority('ROLE_CREATE') + * + * @param dto 表单数据 + * @return Role 新建的角色 + */ + @PostMapping + @PreAuthorize("hasAuthority('ROLE_CREATE')") + public Boolean create(@RequestBody RoleDto dto) { + Role role= service.create(dto); + return role != null; + } + + /** + * 更新角色 hasAuthority('ROLE_UPDATE') + * + * @param dto 表单数据 + * @param id ID + * @return Role 更新后的角色 + */ + @PatchMapping("{id}") + @PreAuthorize("hasAuthority('ROLE_UPDATE')") + public Boolean update(@RequestBody RoleDto dto, @PathVariable("id") Long id) { +// Role role = roleMapper.toEntity(dto); +// role.setId(id); + return service.updateRole(dto, id); + } + + /** + * 切换角色"启动/禁用"状态 hasAuthority('ROLE_UPDATE') + * + * @param id ID + * @return Role 更新后的角色 + */ + @PatchMapping("{id}/toggle") + @PreAuthorize("hasAuthority('ROLE_UPDATE')") + public Boolean toggle(@PathVariable("id") Long id) { + return service.toggle(id); + } + + /** + * 查询角色详情 hasAuthority('ROLE_QUERY') + * + * @param id ID + * @return Role 角色详情 + */ + @GetMapping("{id}") + @PreAuthorize("hasAuthority('ROLE_QUERY')") + public RoleVo detail(@PathVariable Long id) { + return service.detail(id); + } + + /** + * 删除角色 hasAuthority('ROLE_DELETE') + * + * @param id ID + * @return Role 更新后的角色 + */ + @DeleteMapping("{id}") + @PreAuthorize("hasAuthority('ROLE_DELETE')") + public Boolean delete(@PathVariable Long id) { + return service.delete(id); + } + + /** + * 为角色添加权限 hasAuthority('ROLE_AUTHED') + * + * @return RoleAuthority 新的角色权限 + */ + @PostMapping("/saveAuth/{id}") + @PreAuthorize("hasAuthority('ROLE_AUTHED')") + public Boolean addAuthed(@PathVariable Long id, @RequestBody Set authorities) { + return service.saveRoleAuths(id,authorities); + } +} + diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/controller/UserController.java b/src/main/java/com/zsc/edu/gateway/modules/system/controller/UserController.java new file mode 100644 index 0000000..4bfc75c --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/controller/UserController.java @@ -0,0 +1,201 @@ +package com.zsc.edu.gateway.modules.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import com.zsc.edu.gateway.framework.security.UserDetailsImpl; +import com.zsc.edu.gateway.modules.system.dto.UserCreateDto; +import com.zsc.edu.gateway.modules.system.dto.UserSelfUpdateDto; +import com.zsc.edu.gateway.modules.system.dto.UserSelfUpdatePasswordDto; +import com.zsc.edu.gateway.modules.system.dto.UserUpdateDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.entity.User; +import com.zsc.edu.gateway.modules.system.query.UserQuery; +import com.zsc.edu.gateway.modules.system.service.*; +import com.zsc.edu.gateway.modules.system.vo.UserDetail; +import com.zsc.edu.gateway.modules.system.vo.UserVo; +import lombok.AllArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.web.csrf.CsrfToken; +import org.springframework.web.bind.annotation.*; + +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + +/** + * 用户Controller + * + * @author harry yao + */ +@AllArgsConstructor +@RestController +@RequestMapping("api/rest/user") +public class UserController { + + private final UserService service; + + private final RoleService roleService; + private final DeptService deptService; + private final RoleAuthService roleAuthService; + private final AuthorityService authorityService; + + /** + * 登录前,获取csrfToken信息 + * 登录成功后,获取principal和csrfToken信息 + * + * @param principal 认证主体 + * @param csrfToken csrf令牌 + * @return 包含csrf令牌和登录用户的认证主体信息 + */ + @GetMapping("me") + public Map me(@AuthenticationPrincipal Object principal, CsrfToken csrfToken) { + Map map = new LinkedHashMap<>(); + map.put("user", principal); + map.put("csrf", csrfToken); + return map; + } + + /** + * 用户获取自己的信息 + * + * @param userDetails 操作用户 + * @return 用户信息 + */ + @GetMapping("self") + public UserDetail selfDetail(@AuthenticationPrincipal UserDetailsImpl userDetails) { + UserDetail userDetail = new UserDetail(); + User user = service.selfDetail(userDetails); + user.dept = deptService.getById(user.deptId); + Role role= roleService.getOne(new QueryWrapper().eq("id",user.roleId)); + userDetail.setPermissions(role.getName()); + Set authorities = authorityService.selectAuthoritiesByRoleId(role.getId()); + userDetail.setAuthorities(authorities.stream().toList()); + userDetail.setUser(user); + return userDetail; + } + + /** + * 用户更新自己的信息 + * + * @param userDetails 操作用户 + * @param dto 表单数据 + * @return 更新后的用户信息 + */ + @PatchMapping("self") + public Boolean selfUpdate(@AuthenticationPrincipal UserDetailsImpl userDetails, @RequestBody UserSelfUpdateDto dto) { + return service.selfUpdate(userDetails, dto); + } + + /** + * 用户更新自己的密码 + * + * @param userDetails 操作用户 + * @param dto 表单数据 + */ + @PatchMapping("self/update-password") + public Boolean selfUpdatePassword( + @AuthenticationPrincipal UserDetailsImpl userDetails, + @RequestBody UserSelfUpdatePasswordDto dto + ) { + return service.selfUpdatePassword(userDetails, dto); + } + + /** + * 分页查询用户信息 hasAuthority('USER_QUERY') + * + * @param query 查询表单 + * @param page 分页 + * @return 分页用户信息 + */ + @GetMapping + @PreAuthorize("hasAuthority('USER_QUERY·')") + public Page query(UserQuery query, Page page) { + return service.page(page, query.wrapper()); + } + + + + /** + * 新建用户 hasAuthority('USER_CREATE') + * + * @param dto 表单数据 + * @return 新建的用户信息 + */ + @PostMapping + @PreAuthorize("hasAuthority('USER_CREATE')") + public Boolean create(@RequestBody UserCreateDto dto) { + return service.create(dto); + } + + /** + * 更新用户 hasAuthority('USER_UPDATE') + * + * @param dto 表单数据 + * @param id ID + * @return 更新后的用户 + */ + @PatchMapping("{id}") + @PreAuthorize("hasAuthority('USER_UPDATE')") + public Boolean update(@RequestBody UserUpdateDto dto, @PathVariable("id") Long id) { + return service.update(dto, id); + } + + /** + * 更新用户密码 hasAuthority('USER_UPDATE') + * + * @param id ID + * @param password 新密码 + */ + @PatchMapping("{id}/update-password") + @PreAuthorize("hasAuthority('USER_UPDATE')") + public Boolean updatePassword(@PathVariable("id") Long id, @RequestParam String password) { + return service.updatePassword(password, id); + } + + /** + * 切换用户"启动/禁用"状态 hasAuthority('USER_DELETE') + * + * @param id ID + * @return Dept 更新后的用户 + */ + @PatchMapping("{id}/toggle") + @PreAuthorize("hasAuthority('USER_DELETE')") + public Boolean toggle(@PathVariable("id") Long id) { + return service.toggle(id); + } + /** + * 删除用户 hasAuthority('USER_DELETE') + * */ + @DeleteMapping("{id}") + @PreAuthorize("hasAuthority('USER_DELETE')") + public Boolean delete(@PathVariable("id") Long id) { + return service.removeById(id); + } + /** + * 根据部门ID查询用户 + * */ + @GetMapping("dept/{id}") + public Collection listByDept(@PathVariable("id") Long id) { + return service.list(new QueryWrapper().eq("dept_id", id)); + } + /** + * 根据ID查询用户 + * */ + @GetMapping("{id}") + public User detail(@PathVariable("id") Long id) { + return service.getById(id); + } + /** + * 发送邮件 + * */ + @GetMapping("send-email") + public String sendEmail(@RequestParam String email) { + return service.sendEmail(email); + } + +} + diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/AuthorityCreateDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/AuthorityCreateDto.java new file mode 100644 index 0000000..70069b0 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/AuthorityCreateDto.java @@ -0,0 +1,18 @@ +package com.zsc.edu.gateway.modules.system.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author zhuang + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AuthorityCreateDto { + /** + * 权限名 + */ + private String name; +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/AuthorityDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/AuthorityDto.java new file mode 100644 index 0000000..a592f19 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/AuthorityDto.java @@ -0,0 +1,39 @@ +package com.zsc.edu.gateway.modules.system.dto; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.util.StringUtils; + +/** + * 权限Dto + * @author zhuang + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AuthorityDto { + /** + * 权限名 + */ + @NotBlank(message = "名字不能为空") + public String name; + /** + * 启用状态 + */ + private Boolean enabled = true; + /** + * 备注 + */ + private String remark; + + public LambdaUpdateWrapper updateWrapper(Long id) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + return updateWrapper.eq(Authority::getId, id) + .set(Authority::getName, name) + .set(StringUtils.hasText(remark), Authority::getRemark, remark); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/DeptDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/DeptDto.java new file mode 100644 index 0000000..29d05a4 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/DeptDto.java @@ -0,0 +1,54 @@ +package com.zsc.edu.gateway.modules.system.dto; + +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.util.StringUtils; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +/** + * 部门Dto + * + * @author harry_yao + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DeptDto { + + /** + * 编码 + */ +// @NotBlank(message = "编码不能为空") +// public String code; + + /** + * 名称 + */ + @NotBlank(message = "名字不能为空") + public String name; + + /** + * 备注 + */ + public String remark; + + /** + * 父部门ID + */ + @NotNull(message = "上级公司不能为空") + public Long pid; + + public LambdaUpdateWrapper updateWrapper(Long id) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + return updateWrapper.eq(Dept::getId, id) + .set(Dept::getName, name) + .set(StringUtils.hasText(remark), Dept::getRemark, remark); + } + +} + diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/RoleAuthCreateDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/RoleAuthCreateDto.java new file mode 100644 index 0000000..f966a96 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/RoleAuthCreateDto.java @@ -0,0 +1,22 @@ +package com.zsc.edu.gateway.modules.system.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author zhuang + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RoleAuthCreateDto { + /** + * 角色名 + */ + private String roleName; + /** + * 权限名 + */ + private String authName; +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/RoleAuthorityDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/RoleAuthorityDto.java new file mode 100644 index 0000000..06f35e7 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/RoleAuthorityDto.java @@ -0,0 +1,22 @@ +package com.zsc.edu.gateway.modules.system.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author zhuang + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RoleAuthorityDto { + /** + * 权限ID + */ + private Long roleId; + /** + * 用户ID + */ + private Long authorityId; +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/RoleDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/RoleDto.java new file mode 100644 index 0000000..10646f3 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/RoleDto.java @@ -0,0 +1,47 @@ +package com.zsc.edu.gateway.modules.system.dto; + +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.util.StringUtils; + +import jakarta.validation.constraints.NotBlank; +import java.util.Set; + +/** + * 角色Dto + * + * @author harry yao + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RoleDto { + + /** + * 名称 + */ + @NotBlank(message = "名称不能为空") + public String name; + + /** + * 备注 + */ + public String remark; + + /** + * 权限列表 + */ + public Set authorities; + + public LambdaUpdateWrapper updateWrapper(Long id) { + LambdaUpdateWrapper update = new LambdaUpdateWrapper<>(); + return update.eq(Role::getId, id) + .set(Role::getName, name) + .set(StringUtils.hasText(remark), Role::getRemark, remark); + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserCreateDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserCreateDto.java new file mode 100644 index 0000000..b55fd15 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserCreateDto.java @@ -0,0 +1,82 @@ +package com.zsc.edu.gateway.modules.system.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import jakarta.validation.constraints.*; + +/** + * 用户新建Dto + * + * @author harry yao + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class UserCreateDto { + + /** + * 用户名 + */ + @NotBlank(message = "用户名不能为空") + public String username; + + /** + * 密码 + */ + @NotBlank(message = "密码不能为空") + public String password; + + /** + * 手机号 + */ + @Pattern(regexp = "^1[34578]\\d{9}$", message = "手机号格式不对") + public String phone; + + /** + * 邮箱 + */ + @Email(message = "电子邮箱格式不对") + public String email; + + /** + * 启用状态 + */ + @NotNull(message = "启用状态不能为空") + public Boolean enable; + + /** + * 部门ID + */ + @NotNull(message = "部门不能为空") + public Long deptId; + + /** + * 用户身份集合 + */ + //@NotEmpty(message = "角色不能为空") + public Long roleId; + /** + * 昵称 + * */ + public String nickName; + /** + * 头像 + * */ + public String avatar; + /** + * 地址 + * */ + public String address; + + /** + * 备注说明 + */ + public String remark; + /** + * 验证码 + */ + public Integer code; + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserSelfUpdateDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserSelfUpdateDto.java new file mode 100644 index 0000000..1166eac --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserSelfUpdateDto.java @@ -0,0 +1,45 @@ +package com.zsc.edu.gateway.modules.system.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Pattern; + +/** + * 用户更新自己信息Dto + * + * @author harry yao + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class UserSelfUpdateDto { + + /** + * 手机号 + */ + @Pattern(regexp = "^1[34578]\\d{9}$", message = "手机号格式不对") + public String phone; + + /** + * 邮箱 + */ + @Email(message = "电子邮箱格式不对") + public String email; + /** + * 昵称 + * */ + public String nickName; + /** + * 头像 + * */ + public String avatar; + /** + * 地址 + * */ + public String address; + + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserSelfUpdatePasswordDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserSelfUpdatePasswordDto.java new file mode 100644 index 0000000..b87e5e8 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserSelfUpdatePasswordDto.java @@ -0,0 +1,30 @@ +package com.zsc.edu.gateway.modules.system.dto; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import jakarta.validation.constraints.NotBlank; + +/** + * 用户更新自己密码Dto + * + * @author harry yao + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class UserSelfUpdatePasswordDto { + + /** + * 旧密码 + */ + @NotBlank(message = "旧密码不能为空") + public String oldPassword; + + /** + * 新密码 + */ + @NotBlank(message = "新密码不能为空") + public String password; + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserUpdateDto.java b/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserUpdateDto.java new file mode 100644 index 0000000..b8eb847 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/dto/UserUpdateDto.java @@ -0,0 +1,69 @@ +package com.zsc.edu.gateway.modules.system.dto; + +import com.zsc.edu.gateway.modules.system.entity.User; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.util.StringUtils; + +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; + +/** + * 用户更新Dto + * + * @author harry yao + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class UserUpdateDto { + + /** + * 手机号 + */ + @Pattern(regexp = "^1[34578]\\d{9}$", message = "手机号格式不对") + public String phone; + + /** + * 邮箱 + */ + @Email(message = "电子邮箱格式不对") + public String email; + + /** + * 启用状态 + */ + @NotNull(message = "启用状态不能为空") + public Boolean enable; + + /** + * 部门ID + */ + @NotNull(message = "部门不能为空") + public Long deptId; + /** + * 昵称 + * */ + public String nickName; + /** + * 头像 + * */ + public String avatar; + /** + * 地址 + * */ + public String address; + + /** + * 用户身份集合 + */ + @NotEmpty(message = "角色不能为空") + public Long roleId; + + public String remark; + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/entity/Authority.java b/src/main/java/com/zsc/edu/gateway/modules/system/entity/Authority.java new file mode 100644 index 0000000..be740f4 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/entity/Authority.java @@ -0,0 +1,32 @@ +package com.zsc.edu.gateway.modules.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; + +/** + * 操作权限 + * + * @author harry yao + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +@TableName("sys_authority") +public class Authority extends BaseEntity { + /** + * 权限名 + */ + public String name; + /** + * 启用状态 + */ + private Boolean enabled = true; + /** + * 备注 + */ + private String remark; +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/entity/BaseEntity.java b/src/main/java/com/zsc/edu/gateway/modules/system/entity/BaseEntity.java new file mode 100644 index 0000000..8130d31 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/entity/BaseEntity.java @@ -0,0 +1,69 @@ +package com.zsc.edu.gateway.modules.system.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @author harry yao + */ +@Setter +@Getter +public class BaseEntity implements Serializable { + + /** + * 自增主键 + */ + @TableId(type = IdType.AUTO) + public Long id; + + /** + * 备注说明 + */ + public String remark; + + /** + * 创建时间 + */ + @TableField(value = "create_time", fill = FieldFill.INSERT) + public LocalDateTime createTime; + /* + * 创建人 + * */ + @TableField(value = "create_by", fill = FieldFill.INSERT) + public String createBy; + + /** + * 更新时间 + */ + @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) + public LocalDateTime updateTime; + /* + * 更新人 + * + * */ + @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE) + public String updateBy; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseEntity that = (BaseEntity) o; + return id.equals(that.id); + } + + @Override + public int hashCode() { + return getClass().getName().hashCode() + id.hashCode(); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/entity/Dept.java b/src/main/java/com/zsc/edu/gateway/modules/system/entity/Dept.java new file mode 100644 index 0000000..93f302e --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/entity/Dept.java @@ -0,0 +1,50 @@ +package com.zsc.edu.gateway.modules.system.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; + +import java.util.HashSet; +import java.util.Set; + +/** + * 部门 + * + * @author Yao + * @since 2023-04-06 + */ +@Getter +@Setter +@TableName("sys_dept") +public class Dept extends BaseEntity { + + /** + * 上级部门 + */ + private Long pid; + + /** + * 子部门数目 + */ + private Integer subCount; + + /** + * 名称 + */ + private String name; + + /** + * 排序 + */ + private Integer deptSort; + + /** + * 状态 + */ + private Boolean enabled = true; + + @TableField(exist = false) + public Set children = new HashSet<>(0); + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/entity/Role.java b/src/main/java/com/zsc/edu/gateway/modules/system/entity/Role.java new file mode 100644 index 0000000..e796697 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/entity/Role.java @@ -0,0 +1,40 @@ +package com.zsc.edu.gateway.modules.system.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +import java.util.Set; + +/** + * 角色 + * + * @author harry yao + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +@TableName("sys_role") +public class Role extends BaseEntity { + + /** + * 名称,唯一 + */ + public String name; + + /** + * 启用状态 + */ + private Boolean enabled = true; + + /** + * 权限集合 + */ + @TableField(exist = false) + public Set authorities; + + +} + diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/entity/RoleAuthority.java b/src/main/java/com/zsc/edu/gateway/modules/system/entity/RoleAuthority.java new file mode 100644 index 0000000..4692811 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/entity/RoleAuthority.java @@ -0,0 +1,29 @@ +package com.zsc.edu.gateway.modules.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +import java.io.Serializable; + +/** + * sys_role_authorities + * @author zhuang + */ +@NoArgsConstructor +@AllArgsConstructor +@Getter +@Setter +@TableName("sys_role_authorities") +public class RoleAuthority implements Serializable { + /** + * 角色ID + */ + private Long roleId; + /** + * 权限ID + */ + private Long authorityId; + + // @TableField(exist = false) +// private Set authorities; +} \ No newline at end of file diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/entity/User.java b/src/main/java/com/zsc/edu/gateway/modules/system/entity/User.java new file mode 100644 index 0000000..82715f2 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/entity/User.java @@ -0,0 +1,85 @@ +package com.zsc.edu.gateway.modules.system.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.zsc.edu.gateway.common.enums.EnableState; +import lombok.*; + +/** + * 用户 + * + * @author harry yao + */ +@AllArgsConstructor +@NoArgsConstructor +@Setter +@Getter +@JsonIgnoreProperties({"password"}) +@EqualsAndHashCode(callSuper = false) +@TableName(value = "sys_user") +public class User extends BaseEntity { + + /** + * 用户名 + */ + public String username; + + /** + * 密码 + */ + public String password; + + /** + * 手机号码 + */ + public String phone; + + /** + * 电子邮件 + */ + public String email; + + /** + * 启用状态 + */ + public Boolean enableState = true; + /** + * + *昵称 + * */ + public String name; + + /** + * 所属部门ID + */ + public Long deptId; + + /** + * 所属部门 + */ + @TableField(exist = false) + public Dept dept; + + /** + * 角色ID + */ + public Long roleId; + + /** + * 拥有的角色 + */ + @TableField(exist = false) + public Role role; + /** + * 头像 + */ + public String avatar; + /** + * 地址 + */ + public String address; + + +} + diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/entity/UserRole.java b/src/main/java/com/zsc/edu/gateway/modules/system/entity/UserRole.java new file mode 100644 index 0000000..9ff731f --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/entity/UserRole.java @@ -0,0 +1,26 @@ +package com.zsc.edu.gateway.modules.system.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * sys_users_roles + * @author zhuang + */ +@Data +@TableName("sys_users_roles") +public class UserRole implements Serializable { + /** + * 用户ID + */ + private Long userId; + + /** + * 角色ID + */ + private Long roleId; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/mapper/AuthorityMapper.java b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/AuthorityMapper.java new file mode 100644 index 0000000..7a770e8 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/AuthorityMapper.java @@ -0,0 +1,14 @@ +package com.zsc.edu.gateway.modules.system.mapper; + +import com.zsc.edu.gateway.common.mapstruct.BaseMapper; +import com.zsc.edu.gateway.modules.system.dto.AuthorityDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author zhuang + */ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface AuthorityMapper extends BaseMapper { +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/mapper/DeptMapper.java b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/DeptMapper.java new file mode 100644 index 0000000..028c139 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/DeptMapper.java @@ -0,0 +1,15 @@ +package com.zsc.edu.gateway.modules.system.mapper; + +import com.zsc.edu.gateway.common.mapstruct.BaseMapper; +import com.zsc.edu.gateway.modules.system.dto.DeptDto; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import org.mapstruct.Mapper; +import org.mapstruct.MappingConstants; +import org.mapstruct.ReportingPolicy; + +/** + * @author Yao + */ +@Mapper(componentModel = MappingConstants.ComponentModel.SPRING, unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface DeptMapper extends BaseMapper { +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/mapper/RoleAuthorityMapper.java b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/RoleAuthorityMapper.java new file mode 100644 index 0000000..5e08302 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/RoleAuthorityMapper.java @@ -0,0 +1,14 @@ +package com.zsc.edu.gateway.modules.system.mapper; + +import com.zsc.edu.gateway.common.mapstruct.BaseMapper; +import com.zsc.edu.gateway.modules.system.dto.RoleAuthorityDto; +import com.zsc.edu.gateway.modules.system.entity.RoleAuthority; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author zhuang + */ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface RoleAuthorityMapper extends BaseMapper { +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/mapper/RoleMapper.java b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/RoleMapper.java new file mode 100644 index 0000000..ec03476 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/RoleMapper.java @@ -0,0 +1,15 @@ +package com.zsc.edu.gateway.modules.system.mapper; + +import com.zsc.edu.gateway.common.mapstruct.BaseMapper; +import com.zsc.edu.gateway.modules.system.dto.RoleDto; +import com.zsc.edu.gateway.modules.system.entity.Role; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Yao + */ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface RoleMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/mapper/UserMapper.java b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/UserMapper.java new file mode 100644 index 0000000..8819b6c --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/mapper/UserMapper.java @@ -0,0 +1,14 @@ +package com.zsc.edu.gateway.modules.system.mapper; + +import com.zsc.edu.gateway.common.mapstruct.BaseMapper; +import com.zsc.edu.gateway.modules.system.dto.UserCreateDto; +import com.zsc.edu.gateway.modules.system.entity.User; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** + * @author Yao + */ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface UserMapper extends BaseMapper { +} \ No newline at end of file diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/query/AuthorityQuery.java b/src/main/java/com/zsc/edu/gateway/modules/system/query/AuthorityQuery.java new file mode 100644 index 0000000..c4daa9c --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/query/AuthorityQuery.java @@ -0,0 +1,32 @@ +package com.zsc.edu.gateway.modules.system.query; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.util.StringUtils; + +/** + * @author zhuang + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AuthorityQuery { + /** + * 编码,前缀匹配 + */ + public String code; + + /** + * 名称,模糊查询 + */ + public String name; + + public LambdaQueryWrapper wrapper() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StringUtils.hasText(this.name), Authority::getName, this.name); + return queryWrapper; + } +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/query/DeptQuery.java b/src/main/java/com/zsc/edu/gateway/modules/system/query/DeptQuery.java new file mode 100644 index 0000000..c58f953 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/query/DeptQuery.java @@ -0,0 +1,37 @@ +package com.zsc.edu.gateway.modules.system.query; + +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.util.StringUtils; + + +/** + * 部门Query + * + * @author Yao + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DeptQuery { + + /** + * 编码,前缀匹配 + */ + public String code; + + /** + * 名称,模糊查询 + */ + public String name; + + public LambdaQueryWrapper wrapper() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StringUtils.hasText(this.name), Dept::getName, this.name); + return queryWrapper; + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/query/RoleQuery.java b/src/main/java/com/zsc/edu/gateway/modules/system/query/RoleQuery.java new file mode 100644 index 0000000..0300cba --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/query/RoleQuery.java @@ -0,0 +1,34 @@ +package com.zsc.edu.gateway.modules.system.query; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zsc.edu.gateway.modules.system.entity.Role; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author ftz + * 创建时间:2024/4/8 8:06 + * 描述: 角色查询参数 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RoleQuery { + /** + * 名称,唯一 + */ + public String name; + + /** + * 启用状态 + */ + private Boolean enabled ; + public LambdaQueryWrapper wrapper() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(this.enabled != null, Role::getEnabled, this.enabled); + queryWrapper.like(this.name != null, Role::getName, this.name); + return queryWrapper; + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/query/UserQuery.java b/src/main/java/com/zsc/edu/gateway/modules/system/query/UserQuery.java new file mode 100644 index 0000000..a823ca7 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/query/UserQuery.java @@ -0,0 +1,65 @@ +package com.zsc.edu.gateway.modules.system.query; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zsc.edu.gateway.modules.system.entity.User; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.util.StringUtils; + +import java.util.Objects; + +/** + * 用户Query + * + * @author harry yao + */ + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class UserQuery { + + /** + * 用户名 + */ + public String username; + + /** + * 手机号码 + */ + public String phone; + + /** + * 电子邮件 + */ + public String email; + + /** + * 启用状态 + */ + public Boolean enable; + + /** + * 角色集合 + */ + public Long roleId; + + /** + * 部门集合 + */ + public Long deptId; + + + public LambdaQueryWrapper wrapper() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(StringUtils.hasText(this.username), User::getUsername, this.username); + queryWrapper.eq(StringUtils.hasText(this.phone), User::getPhone, this.phone); + queryWrapper.eq(StringUtils.hasText(this.email), User::getEmail, this.email); + queryWrapper.eq(Objects.nonNull(this.enable), User::getEnableState, this.enable); + queryWrapper.eq(Objects.nonNull(this.deptId),User::getDeptId,this.deptId); + queryWrapper.eq(Objects.nonNull(this.roleId),User::getRoleId,this.roleId); + return queryWrapper; + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/repo/AuthorityRepository.java b/src/main/java/com/zsc/edu/gateway/modules/system/repo/AuthorityRepository.java new file mode 100644 index 0000000..913457a --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/repo/AuthorityRepository.java @@ -0,0 +1,18 @@ +package com.zsc.edu.gateway.modules.system.repo; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import org.apache.ibatis.annotations.Param; + +import java.util.Set; + +/** + * @author zhuang + */ +public interface AuthorityRepository extends BaseMapper { + + Set selectAuthoritiesByRoleId (@Param("roleId") Long roleId); + + Long getAuthorityIdByName(@Param("authName")String authName); +} + diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/repo/DeptRepository.java b/src/main/java/com/zsc/edu/gateway/modules/system/repo/DeptRepository.java new file mode 100644 index 0000000..d5c3d96 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/repo/DeptRepository.java @@ -0,0 +1,16 @@ +package com.zsc.edu.gateway.modules.system.repo; + +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 部门 Mapper 接口 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +public interface DeptRepository extends BaseMapper { + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/repo/RoleAuthoritiesRepository.java b/src/main/java/com/zsc/edu/gateway/modules/system/repo/RoleAuthoritiesRepository.java new file mode 100644 index 0000000..ccbbf64 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/repo/RoleAuthoritiesRepository.java @@ -0,0 +1,19 @@ +package com.zsc.edu.gateway.modules.system.repo; + +import com.zsc.edu.gateway.modules.system.entity.RoleAuthority; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * @author Yao + */ +public interface RoleAuthoritiesRepository extends BaseMapper { + + @Select("select * from sys_role_authorities where role_id=#{roleId}") + List selectByRoleId(Long roleId); + +// List selectAuthorityByRoleId(@Param("roleId") Long roleId); +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/repo/RoleRepository.java b/src/main/java/com/zsc/edu/gateway/modules/system/repo/RoleRepository.java new file mode 100644 index 0000000..d9a719d --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/repo/RoleRepository.java @@ -0,0 +1,22 @@ +package com.zsc.edu.gateway.modules.system.repo; + +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zsc.edu.gateway.modules.system.vo.RoleVo; +import org.apache.ibatis.annotations.Param; + + +/** + *

+ * 角色表 Mapper 接口 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +public interface RoleRepository extends BaseMapper { + + RoleVo selectRoleById(@Param("roleId") Long roleId); + + Long getRoleIdByName(@Param("roleName") String roleName); +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/repo/UserRepository.java b/src/main/java/com/zsc/edu/gateway/modules/system/repo/UserRepository.java new file mode 100644 index 0000000..28bc3c9 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/repo/UserRepository.java @@ -0,0 +1,27 @@ +package com.zsc.edu.gateway.modules.system.repo; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zsc.edu.gateway.modules.system.entity.User; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zsc.edu.gateway.modules.system.vo.UserVo; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +public interface UserRepository extends BaseMapper { + + // @Select("select u.*, sr.*, sra.* from sys_user u " + +// "left join sys_role sr on u.role_id = sr.id " + +// "left join sys_role_authorities sra on u.role_id = sra.role_id " + +// "where u.username = #{username}") +// User findByUsername(String username); + User selectByUsername(String username); +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/repo/UserRolesRepository.java b/src/main/java/com/zsc/edu/gateway/modules/system/repo/UserRolesRepository.java new file mode 100644 index 0000000..f5f5f2f --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/repo/UserRolesRepository.java @@ -0,0 +1,10 @@ +package com.zsc.edu.gateway.modules.system.repo; + +import com.zsc.edu.gateway.modules.system.entity.UserRole; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @author zhuang + */ +public interface UserRolesRepository extends BaseMapper { +} \ No newline at end of file diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/AuthorityService.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/AuthorityService.java new file mode 100644 index 0000000..9a00326 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/AuthorityService.java @@ -0,0 +1,22 @@ +package com.zsc.edu.gateway.modules.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zsc.edu.gateway.modules.system.dto.AuthorityDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; + +import java.util.Set; + +/** + * @author zhuang + */ +public interface AuthorityService extends IService { + + Authority create(AuthorityDto authorityDto); + + Boolean update(AuthorityDto authorityDto,Long id); + + Boolean toggle(Long id); + + Set selectAuthoritiesByRoleId(Long roleId); + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/DeptService.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/DeptService.java new file mode 100644 index 0000000..e296436 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/DeptService.java @@ -0,0 +1,38 @@ +package com.zsc.edu.gateway.modules.system.service; + +import com.zsc.edu.gateway.modules.system.dto.DeptDto; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 部门 服务类 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +public interface DeptService extends IService { + + /** + * 创建部门 + * @param dto + */ + Dept create(DeptDto dto); + + /** + * 更新部门 + * @param dto + * @param id + */ + Boolean edit(DeptDto dto, Long id); + + Boolean toggle(Long id); + + /** + * 生成部门树结构 + * @param id + * @return + */ +// Dept listTree(Long id); +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/RoleAuthService.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/RoleAuthService.java new file mode 100644 index 0000000..4a906f5 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/RoleAuthService.java @@ -0,0 +1,22 @@ +package com.zsc.edu.gateway.modules.system.service; + +//import com.zsc.edu.gateway.modules.system.dto.RoleAuthCreateDto; +//import com.zsc.edu.gateway.modules.system.dto.RoleAuthorityDto; +import com.zsc.edu.gateway.modules.system.entity.RoleAuthority; +import com.baomidou.mybatisplus.extension.service.IService; + + +/** + *

+ * 角色权限表 服务类 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +public interface RoleAuthService extends IService { + + boolean removeByRoleId(Long id); + +// boolean addRoleAuthority(RoleAuthCreateDto dto); +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/RoleService.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/RoleService.java new file mode 100644 index 0000000..585bd3e --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/RoleService.java @@ -0,0 +1,35 @@ +package com.zsc.edu.gateway.modules.system.service; + +import com.zsc.edu.gateway.modules.system.dto.AuthorityCreateDto; +import com.zsc.edu.gateway.modules.system.dto.RoleDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.baomidou.mybatisplus.extension.service.IService; +import com.zsc.edu.gateway.modules.system.vo.RoleVo; + +import java.util.Set; + +/** + *

+ * 角色表 服务类 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +public interface RoleService extends IService { + + Role create(RoleDto roleDto); + + Boolean edit(RoleDto roleDto, Long id); + + RoleVo detail(Long id); + + Boolean toggle(Long id); + + Boolean delete(Long id); + + Boolean updateRole(RoleDto dto, Long id); + + Boolean saveRoleAuths(Long roleId, Set authorities); +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/UserService.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/UserService.java new file mode 100644 index 0000000..93a0eb3 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/UserService.java @@ -0,0 +1,37 @@ +package com.zsc.edu.gateway.modules.system.service; + +import com.zsc.edu.gateway.framework.security.UserDetailsImpl; +import com.zsc.edu.gateway.modules.system.dto.*; +import com.zsc.edu.gateway.modules.system.entity.User; +import com.zsc.edu.gateway.modules.system.query.UserQuery; +import com.zsc.edu.gateway.modules.system.vo.UserVo; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +public interface UserService extends IService { + + User selfDetail(UserDetailsImpl userDetails); + + Boolean selfUpdate(UserDetailsImpl userDetails, UserSelfUpdateDto dto); + + Boolean selfUpdatePassword(UserDetailsImpl userDetails, UserSelfUpdatePasswordDto dto); + + Boolean create(UserCreateDto dto); + + Boolean update(UserUpdateDto dto, Long id); + + Boolean updatePassword(String password, Long id); + + Boolean toggle(Long id); + + String sendEmail(String email); +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/AuthorityServiceImpl.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/AuthorityServiceImpl.java new file mode 100644 index 0000000..abceaf6 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/AuthorityServiceImpl.java @@ -0,0 +1,60 @@ +package com.zsc.edu.gateway.modules.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zsc.edu.gateway.exception.ConstraintException; +import com.zsc.edu.gateway.modules.system.dto.AuthorityDto; +//import com.zsc.edu.gateway.modules.system.dto.RoleAuthorityDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.mapper.AuthorityMapper; +import com.zsc.edu.gateway.modules.system.repo.AuthorityRepository; +import com.zsc.edu.gateway.modules.system.service.AuthorityService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Set; + +/** + * @author zhuang + */ +@AllArgsConstructor +@Service +public class AuthorityServiceImpl extends ServiceImpl implements AuthorityService { + private AuthorityMapper mapper; + private AuthorityRepository repo; + + @Override + public Authority create(AuthorityDto authorityDto) { + boolean existsByName = count(new LambdaQueryWrapper().eq(Authority::getName, authorityDto.getName())) > 0; + if (existsByName) { + throw new ConstraintException("name", authorityDto.name, "权限已存在"); + } + Authority authority = mapper.toEntity(authorityDto); + save(authority); + return authority; + } + + @Override + public Boolean update(AuthorityDto authorityDto, Long id) { + boolean isExists = count(new LambdaQueryWrapper().ne(Authority::getId, id).eq(Authority::getName, authorityDto.getName())) > 0; + if (isExists) { + throw new ConstraintException("name", authorityDto.name, "同名权限已存在"); + } + return update(authorityDto.updateWrapper(id)); + } + + + @Override + public Boolean toggle(Long id) { + Authority authority = getById(id); + authority.setEnabled(!authority.getEnabled()); + return updateById(authority); + } + + @Override + public Set selectAuthoritiesByRoleId(Long roleId){ + return baseMapper.selectAuthoritiesByRoleId(roleId); + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/DeptServiceImpl.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/DeptServiceImpl.java new file mode 100644 index 0000000..7561320 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/DeptServiceImpl.java @@ -0,0 +1,66 @@ +package com.zsc.edu.gateway.modules.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zsc.edu.gateway.exception.ConstraintException; +import com.zsc.edu.gateway.modules.system.dto.DeptDto; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.zsc.edu.gateway.modules.system.mapper.DeptMapper; +import com.zsc.edu.gateway.modules.system.repo.DeptRepository; +import com.zsc.edu.gateway.modules.system.service.DeptService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +/** + *

+ * 部门 服务实现类 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +@AllArgsConstructor +@Service +public class DeptServiceImpl extends ServiceImpl implements DeptService { + + private final DeptMapper mapper; + + @Override + public Dept create(DeptDto dto) { + boolean existsByName = count(new LambdaQueryWrapper().eq(Dept::getName, dto.getName())) > 0; + if (existsByName) { + throw new ConstraintException("name", dto.name, "部门已存在"); + } + Dept dept = mapper.toEntity(dto); + save(dept); + return dept; + } + + @Override + public Boolean edit(DeptDto dto, Long id) { + boolean isExists = count(new LambdaQueryWrapper().ne(Dept::getId, id).eq(Dept::getName, dto.getName())) > 0; + if (isExists) { + throw new ConstraintException("name", dto.name, "同名部门已存在"); + } + return update(dto.updateWrapper(id)); + } + + @Override + public Boolean toggle(Long id) { + Dept dept = getById(id); + dept.setEnabled(!dept.getEnabled()); + return updateById(dept); + } + +// @Override +// public Dept listTree(Long deptId) { +// Dept rootDept; +// List all = list(null); +// HashSet deptList = new HashSet<>(all); +// rootDept = DeptTreeUtil.initTree(deptList); +// if (deptId != null) { +// return rootDept.id.equals(deptId) ? rootDept : DeptTreeUtil.getChildNode(rootDept.children, deptId); +// } +// return rootDept; +// } +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/RoleAuthServiceImpl.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/RoleAuthServiceImpl.java new file mode 100644 index 0000000..cce6f8e --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/RoleAuthServiceImpl.java @@ -0,0 +1,43 @@ +package com.zsc.edu.gateway.modules.system.service.impl; + +//import com.zsc.edu.gateway.modules.system.dto.RoleAuthCreateDto; +//import com.zsc.edu.gateway.modules.system.dto.RoleAuthorityDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.RoleAuthority; +//import com.zsc.edu.gateway.modules.system.mapper.RoleAuthorityMapper; +import com.zsc.edu.gateway.modules.system.repo.AuthorityRepository; +import com.zsc.edu.gateway.modules.system.repo.RoleAuthoritiesRepository; +import com.zsc.edu.gateway.modules.system.repo.RoleRepository; +import com.zsc.edu.gateway.modules.system.service.RoleAuthService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @author zhuang + */ +@AllArgsConstructor +@Service +public class RoleAuthServiceImpl extends ServiceImpl implements RoleAuthService { +// private RoleAuthorityMapper mapper; + private AuthorityRepository repo; + private RoleRepository roleRepository; + + @Override + public boolean removeByRoleId(Long roleId) { + return remove(new LambdaQueryWrapper().eq(RoleAuthority::getRoleId, roleId)); + } + +// @Override +// public boolean addRoleAuthority(RoleAuthCreateDto dto){ +// Long authId=repo.getAuthorityIdByName(dto.getAuthName()); +// Long roleId=roleRepository.getRoleIdByName(dto.getRoleName()); +// RoleAuthorityDto dto1=new RoleAuthorityDto(); +// dto1.setAuthorityId(authId); +// dto1.setRoleId(roleId); +// RoleAuthority roleAuthority = mapper.toEntity(dto1); +// return save(roleAuthority); +// } +} \ No newline at end of file diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/RoleServiceImpl.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/RoleServiceImpl.java new file mode 100644 index 0000000..fa53c3e --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/RoleServiceImpl.java @@ -0,0 +1,117 @@ +package com.zsc.edu.gateway.modules.system.service.impl; + +import com.zsc.edu.gateway.exception.ConstraintException; +import com.zsc.edu.gateway.modules.system.dto.AuthorityCreateDto; +import com.zsc.edu.gateway.modules.system.dto.RoleDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.entity.RoleAuthority; +import com.zsc.edu.gateway.modules.system.entity.UserRole; +import com.zsc.edu.gateway.modules.system.mapper.RoleMapper; +import com.zsc.edu.gateway.modules.system.repo.AuthorityRepository; +import com.zsc.edu.gateway.modules.system.repo.RoleRepository; +import com.zsc.edu.gateway.modules.system.repo.UserRolesRepository; +import com.zsc.edu.gateway.modules.system.service.RoleAuthService; +import com.zsc.edu.gateway.modules.system.service.RoleService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zsc.edu.gateway.modules.system.vo.RoleVo; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + *

+ * 角色表 服务实现类 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +@AllArgsConstructor +@Service +public class RoleServiceImpl extends ServiceImpl implements RoleService { + + private final RoleMapper mapper; + private final UserRolesRepository urRepo; + + private final RoleAuthService roleAuthService; + private final AuthorityRepository authorityRepository; + private final RoleRepository roleRepository; + + @Override + public Role create(RoleDto dto) { + boolean existsByName = count(new LambdaQueryWrapper().eq(Role::getName, dto.getName())) > 0; + if (existsByName) { + throw new ConstraintException("name", dto.name, "角色已存在"); + } + Role role = mapper.toEntity(dto); + save(role); +// saveRoleAuths(role.getId(), role.getAuthorities()); + return role; + } + + @Override + public Boolean toggle(Long id) { + Role role = getById(id); + role.setEnabled(!role.getEnabled()); + return updateById(role); + } + + @Override + public Boolean delete(Long id) { + boolean hasUser = urRepo.selectCount(new LambdaQueryWrapper().eq(UserRole::getRoleId, id)) > 0; + if (hasUser) { + throw new ConstraintException("存在与本角色绑定的用户,请先删除用户"); + } + + // 删除角色权限关联关系 + roleAuthService.removeByRoleId(id); + return removeById(id); + } + + @Override + public Boolean updateRole(RoleDto dto, Long id) { + Role role =mapper.toEntity(dto); + role.setId(id); + if (dto.getAuthorities() != null && !dto.getAuthorities().isEmpty()) { + roleAuthService.remove(new LambdaQueryWrapper().eq(RoleAuthority::getRoleId, id)); + Set authorities = new HashSet<>(dto.getAuthorities()); + // roleAuthService.saveBatch(authorities.stream().map(authority -> new RoleAuthority(id, authority.getId())).collect(Collectors.toList())); + + } + return updateById(role); + + } + + @Override + public Boolean edit(RoleDto dto, Long id) { + boolean existsByName = count(new LambdaQueryWrapper().ne(Role::getId, id).eq(Role::getName, dto.getName())) > 0; + if (existsByName) { + throw new ConstraintException("name", dto.name, "同名角色已存在"); + } + roleAuthService.remove(new LambdaQueryWrapper().eq(RoleAuthority::getRoleId, id)); +// saveRoleAuths(id, dto.getAuthorities()); + return update(dto.updateWrapper(id)); + } + + @Override + public RoleVo detail(Long id) { + // Role role = getById(id); +// // TODO 联表查询 +// // List roleAuthorities = roleAuthService.list(new LambdaQueryWrapper().eq(RoleAuthority::getRoleId, role.id)); +// role.authorities = authorityRepository.selectAuthoritiesByRoleId(role.id); + return roleRepository.selectRoleById(id); + } + + @Override + public Boolean saveRoleAuths(Long roleId, Set authorities) { + // 保存角色关联权限 + List roleAuthorities = authorities.stream().map(authority -> new RoleAuthority(roleId, authorityRepository.getAuthorityIdByName(authority.getName()))).collect(Collectors.toList()); + return roleAuthService.saveBatch(roleAuthorities); + } +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/UserServiceImpl.java b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..f2b8fbe --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/service/impl/UserServiceImpl.java @@ -0,0 +1,115 @@ +package com.zsc.edu.gateway.modules.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zsc.edu.gateway.exception.ConstraintException; +import com.zsc.edu.gateway.framework.security.UserDetailsImpl; +import com.zsc.edu.gateway.modules.system.dto.UserCreateDto; +import com.zsc.edu.gateway.modules.system.dto.UserSelfUpdateDto; +import com.zsc.edu.gateway.modules.system.dto.UserSelfUpdatePasswordDto; +import com.zsc.edu.gateway.modules.system.dto.UserUpdateDto; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.entity.User; +import com.zsc.edu.gateway.modules.system.mapper.UserMapper; +import com.zsc.edu.gateway.modules.system.repo.UserRepository; +import com.zsc.edu.gateway.modules.system.service.UserService; +import com.zsc.edu.gateway.modules.system.utils.sendMail; +import lombok.AllArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author Yao + * @since 2023-04-06 + */ +@AllArgsConstructor +@Service +public class UserServiceImpl extends ServiceImpl implements UserService { + + private final PasswordEncoder passwordEncoder; + private final RoleServiceImpl roleService; + private final DeptServiceImpl deptService; + private final sendMail send; + private final UserMapper userMapper; + + @Override + public Boolean create(UserCreateDto dto) { + User user = new User(); + userMapper.convert(dto, user); + return save(user); + } + + @Override + public Boolean update(UserUpdateDto dto, Long id) { + User user = getById(id); + boolean existsByPhone = count(new LambdaQueryWrapper().eq(User::getPhone, dto.getPhone())) > 0; + boolean existsByEmail = count(new LambdaQueryWrapper().eq(User::getEmail, dto.getEmail())) > 0; + if (user.getPhone().equals(dto.getPhone()) && existsByPhone) { + throw new ConstraintException("phone", dto.phone, "手机号已存在"); + } + if (user.getEmail().equals(dto.getEmail()) && existsByEmail) { + throw new ConstraintException("email", dto.email, "邮箱地址已存在"); + } + BeanUtils.copyProperties(dto, user); + return updateById(user); + } + + @Override + public Boolean updatePassword(String password, Long id) { + User user = getById(id); + user.setPassword(passwordEncoder.encode(password)); + return save(user); + } + + @Override + public Boolean toggle(Long id) { + User user = getById(id); + user.setEnableState(!user.getEnableState()); + return updateById(user); + } + + @Override + public String sendEmail(String email) { + send.sendEmailMessage(email); + return "发送成功"; + } + + + @Override + public User selfDetail(UserDetailsImpl userDetails) { + return getById(userDetails.getId()); + } + + @Override + public Boolean selfUpdate(UserDetailsImpl userDetails, UserSelfUpdateDto dto) { + User user = getById(userDetails.getId()); + boolean existsByPhone = count(new LambdaQueryWrapper().ne(User::getId, userDetails.getId()).eq(User::getPhone, dto.getPhone())) > 0; + if (existsByPhone) { + throw new ConstraintException("phone", dto.phone, "手机号已存在"); + } + boolean existsByEmail = count(new LambdaQueryWrapper().ne(User::getId, userDetails.getId()).eq(User::getEmail, dto.getEmail())) > 0; + if (existsByEmail) { + throw new ConstraintException("email", dto.email, "邮箱地址已存在"); + } + BeanUtils.copyProperties(dto, user); + + return updateById(user); + } + + @Override + public Boolean selfUpdatePassword(UserDetailsImpl userDetails, UserSelfUpdatePasswordDto dto) { + User user = getById(userDetails.getId()); + if (!passwordEncoder.matches(dto.oldPassword, user.password)) { + throw new ConstraintException("旧密码不对"); + } + user.setPassword(passwordEncoder.encode(dto.password)); + return updateById(user); + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/utils/sendMail.java b/src/main/java/com/zsc/edu/gateway/modules/system/utils/sendMail.java new file mode 100644 index 0000000..e5d6165 --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/utils/sendMail.java @@ -0,0 +1,93 @@ +package com.zsc.edu.gateway.modules.system.utils; + +import jakarta.mail.MessagingException; +import jakarta.mail.internet.MimeMessage; +import lombok.Getter; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.mail.javamail.JavaMailSenderImpl; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.stereotype.Component; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.text.MessageFormat; + +/** + * @author ftz + * 创建时间:2024/4/5 17:24 + * 描述: 根据邮箱发送验证码 + */ +@Component +public class sendMail { + @jakarta.annotation.Resource + JavaMailSenderImpl mailSender; + @Getter + private int randomCode; + + @Value("${spring.mail.username}") + private String username; + + /** + * 读取邮件模板 + * 替换模板中的信息 + * + * @param title 内容 + * @return + */ + public String buildContent(String title) { + //加载邮件html模板 + Resource resource = new ClassPathResource("mailTemplate/mailtemplate.ftl"); + InputStream inputStream = null; + BufferedReader fileReader = null; + StringBuffer buffer = new StringBuffer(); + String line = ""; + try { + inputStream = resource.getInputStream(); + fileReader = new BufferedReader(new InputStreamReader(inputStream)); + while ((line = fileReader.readLine()) != null) { + buffer.append(line); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (fileReader != null) { + try { + fileReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + //替换html模板中的参数 + return MessageFormat.format(buffer.toString(), title); + } + public void sendEmailMessage(String email) { + MimeMessage message = mailSender.createMimeMessage(); + try { + randomCode = (int) ((Math.random() * 9 + 1) * 100000); + // RandomStringUtils + //邮箱发送内容组成 + MimeMessageHelper helper = new MimeMessageHelper(message, true); + helper.setSubject("主题"); + + helper.setText(buildContent(randomCode + ""), true); + helper.setTo(email); + helper.setFrom("发件人名字" + '<' + username + '>'); + mailSender.send(message); + } catch (MessagingException e) { + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/vo/RoleVo.java b/src/main/java/com/zsc/edu/gateway/modules/system/vo/RoleVo.java new file mode 100644 index 0000000..575b2dc --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/vo/RoleVo.java @@ -0,0 +1,60 @@ +package com.zsc.edu.gateway.modules.system.vo; + +import com.zsc.edu.gateway.modules.system.entity.Authority; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author lenovo + */ +@Data +public class RoleVo { + /** + * 自增主键 + */ + public Long id; + /** + * 角色名 + */ + private String name; + /** + *级别 + */ + private Integer level; + /** + * 描述 + */ + private String description; + /** + * 数据权限 + */ + private String dataScope; + /** + * 创建人 + */ + private String createBy; + /** + * 更新人 + */ + private String updateBy; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新时间 + */ + private Date updateTime; + /** + * 启用状态 + */ + private Boolean enabled; + /** + * 备注 + */ + private String remark; + + private List authorities; +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/vo/UserDetail.java b/src/main/java/com/zsc/edu/gateway/modules/system/vo/UserDetail.java new file mode 100644 index 0000000..122992c --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/vo/UserDetail.java @@ -0,0 +1,21 @@ +package com.zsc.edu.gateway.modules.system.vo; + +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.User; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +/** + * @author ftz + * 创建时间:16/2/2024 下午6:20 + * 描述: TODO + */ +@Getter +@Setter +public class UserDetail { + private User user; + private List authorities; + private String permissions; +} diff --git a/src/main/java/com/zsc/edu/gateway/modules/system/vo/UserVo.java b/src/main/java/com/zsc/edu/gateway/modules/system/vo/UserVo.java new file mode 100644 index 0000000..a09b36d --- /dev/null +++ b/src/main/java/com/zsc/edu/gateway/modules/system/vo/UserVo.java @@ -0,0 +1,62 @@ +package com.zsc.edu.gateway.modules.system.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class UserVo { + /** + * 自增主键 + */ + @TableId(type = IdType.AUTO) + public Long id; + /** + * 用户名 + */ + public String username; + + /** + * 手机号码 + */ + public String phone; + + /** + * 电子邮件 + */ + public String email; + + /** + * 启用状态 + */ + public Boolean enabled; + /** + * + *昵称 + * */ + public String name; + + /** + * 所属部门ID + */ + public Long deptId; + + /** + * 角色ID + */ + public Long roleId; + /** + * 头像 + */ + public String avatar; + /** + * 地址 + */ + public String address; + + LocalDateTime createTime; + LocalDateTime updateTime; + +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..ea6d883 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,41 @@ +server: + port: 8081 + +mybatis-plus: + type-aliases-package: com.zsc.edu.gateway.modules.*.entity + mapper-locations: classpath:mappers/*.xml + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +spring: + datasource: + url: jdbc:postgresql://localhost:5432/gateway?ssl=false&TimeZone=Asia/Shanghai + username: root + password: 123123 + driver-class-name: org.postgresql.Driver + servlet: + multipart: + max-file-size: 40MB + max-request-size: 40MB + mail: + # 配置 SMTP 服务器地址 + host: smtp.qq.com + # 发送者邮箱 + username: 2179732328@qq.com + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 + password: mabpnbtqqezjdjde + # 端口号465或587 + port: 587 + # 默认的邮件编码为UTF-8 + default-encoding: UTF-8 + # 配置SSL 加密工厂 + properties: + mail: + smtp: + socketFactoryClass: javax.net.ssl.SSLSocketFactory + #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 + debug: true + +storage: + attachment: ./storage/attachment + temp: ./storage/temp diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..d550a94 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,41 @@ +server: + port: 8081 + +mybatis-plus: + type-aliases-package: com.zsc.edu.gateway.modules.*.entity + mapper-locations: classpath:mappers/*.xml + type-handlers-package: com.zsc.edu.gateway.framework.mybatisplus + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +spring: + datasource: + url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/study?useSSL=false&allowPublicKeyRetrieval=true&createDatabaseIfNotExist=true&characterEncoding=utf8&serverTimezone=Hongkong + username: root + password: 123123 + driver-class-name: com.mysql.cj.jdbc.Driver + servlet: + multipart: + max-file-size: 40MB + max-request-size: 40MB + mail: + # 配置 SMTP 服务器地址 + host: smtp.qq.com + # 发送者邮箱 + username: 2179732328@qq.com + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 + password: mabpnbtqqezjdjde + # 端口号465或587 + port: 587 + # 默认的邮件编码为UTF-8 + default-encoding: UTF-8 + # 配置SSL 加密工厂 + properties: + mail: + smtp: + socketFactoryClass: javax.net.ssl.SSLSocketFactory + #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 + debug: true +storage: + attachment: ./storage/attachment + temp: ./storage/temp diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..ade6a93 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,7 @@ +spring: + profiles: + active: dev + docker: + compose: + enabled: false + \ No newline at end of file diff --git a/src/main/resources/db/Diagram 1.jpg b/src/main/resources/db/Diagram 1.jpg new file mode 100644 index 0000000..d7ae0bc Binary files /dev/null and b/src/main/resources/db/Diagram 1.jpg differ diff --git a/src/main/resources/db/study.sql b/src/main/resources/db/study.sql new file mode 100644 index 0000000..e0e5e14 --- /dev/null +++ b/src/main/resources/db/study.sql @@ -0,0 +1,923 @@ +/* + Navicat Premium Data Transfer + + Source Server : 腾讯云 + Source Server Type : MySQL + Source Server Version : 80300 + Source Host : 106.53.179.133:3306 + Source Schema : study + + Target Server Type : MySQL + Target Server Version : 80300 + File Encoding : 65001 + + Date: 14/04/2024 23:45:14 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for attach_file +-- ---------------------------- +DROP TABLE IF EXISTS `attach_file`; +CREATE TABLE `attach_file` ( + `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `file_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件名 文件名详细说明', + `mime_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件作用类型', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `url` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `upload_time` datetime NULL DEFAULT NULL COMMENT '文件上传时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '票据附件表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of attach_file +-- ---------------------------- +INSERT INTO `attach_file` VALUES ('195bd3517bfcd9915906957730bdd6fef7fa5a86', 'Snipaste_2024-02-08_09-26-22.jpg', 'image/jpeg', NULL, '2024-03-21 07:20:03', NULL, '2024-03-21 07:20:03', NULL, '2024-03-21 15:20:03'); +INSERT INTO `attach_file` VALUES ('1f744e54c23c388d890a6a3822a87eae32617f29', '6.25-07.jpg', 'image/jpeg', NULL, '2024-03-07 07:59:33', NULL, '2024-03-07 07:59:33', NULL, '2024-03-07 07:59:34'); +INSERT INTO `attach_file` VALUES ('35bd7d32843a413f3cd2486114318d6ccd5f9d62', 'Snipaste_2024-03-22_08-11-52.jpg', 'image/jpeg', NULL, '2024-03-22 00:12:05', NULL, '2024-03-22 00:12:05', NULL, '2024-03-22 00:12:05'); +INSERT INTO `attach_file` VALUES ('5440f9aa9266589413f015fa673f2f372a86c74e', '各组织活动申报表模板.png', 'image/png', NULL, '2024-02-11 09:37:48', NULL, '2024-02-11 09:37:48', NULL, '2024-02-11 17:37:44'); +INSERT INTO `attach_file` VALUES ('5ad6601fd1cf58aa66b25b4f12a83d63b61a681e', '申请表1:模板计算机学院素质拓展活动申请表.doc', 'application/msword', NULL, '2024-02-05 06:37:09', NULL, '2024-02-05 06:37:09', NULL, '2024-02-05 14:37:10'); +INSERT INTO `attach_file` VALUES ('6853fd7cf5b0621678377227d299d86d6f90cc97', 'logo02.png', 'image/png', NULL, '2024-03-07 07:59:11', NULL, '2024-03-07 07:59:11', NULL, '2024-03-07 07:59:11'); +INSERT INTO `attach_file` VALUES ('84fa4f586f190886ea8708c49e8645f5a9a1ea04', '屏幕截图(1).png', 'image/png', NULL, '2024-03-21 08:12:49', NULL, '2024-03-21 08:12:49', NULL, '2024-03-21 16:12:46'); + +-- ---------------------------- +-- Table structure for audit +-- ---------------------------- +DROP TABLE IF EXISTS `audit`; +CREATE TABLE `audit` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '审核记录id 主键id', + `ticket_id` bigint NULL DEFAULT NULL COMMENT '票据id 对应的票据id', + `auditor_id` bigint NULL DEFAULT NULL COMMENT '审核员id 审核员id', + `comment` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核意见', + `result` tinyint NULL DEFAULT NULL COMMENT '审核结果 4:表示审核未通过;3:表示审核通过', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '票据审核表 ' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of audit +-- ---------------------------- +INSERT INTO `audit` VALUES (1, 23, 3, '34', 3, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `audit` VALUES (2, 293, 3, '附件错误\n', 3, NULL, NULL, NULL, '2024-02-17 13:34:03', NULL); +INSERT INTO `audit` VALUES (3, 292, 3, '通过', 3, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `audit` VALUES (4, 291, 3, '通过', 3, NULL, NULL, NULL, '2024-02-17 11:45:22', NULL); +INSERT INTO `audit` VALUES (5, 230, 3, '所颠覆国家', 2, NULL, '2024-02-05 16:04:05', NULL, '2024-02-05 16:55:26', NULL); +INSERT INTO `audit` VALUES (6, 305, 3, NULL, 2, NULL, '2024-02-11 17:39:13', NULL, '2024-02-17 11:45:31', NULL); +INSERT INTO `audit` VALUES (7, 306, 78, NULL, NULL, NULL, '2024-02-11 17:49:31', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (8, 307, 23, NULL, NULL, NULL, '2024-02-13 03:03:50', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (9, 308, 20, NULL, NULL, NULL, '2024-02-13 03:08:04', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (10, 309, 22, NULL, NULL, NULL, '2024-02-13 03:09:16', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (11, 310, 22, NULL, NULL, NULL, '2024-02-13 03:16:02', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (12, 311, 22, NULL, NULL, NULL, '2024-02-13 03:19:47', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (13, 312, 23, NULL, NULL, NULL, '2024-02-13 07:30:58', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (14, 313, 88, NULL, NULL, NULL, '2024-02-15 02:37:08', NULL, '2024-02-19 08:39:14', NULL); +INSERT INTO `audit` VALUES (15, 314, NULL, NULL, NULL, NULL, '2024-02-15 02:50:53', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (16, 315, 20, NULL, 2, NULL, '2024-02-15 02:52:14', NULL, '2024-02-16 17:37:09', NULL); +INSERT INTO `audit` VALUES (17, 316, 60, NULL, NULL, NULL, '2024-02-16 17:39:29', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (18, 317, 60, NULL, NULL, NULL, '2024-02-16 17:40:28', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (19, 318, 26, NULL, NULL, NULL, '2024-02-17 11:51:33', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (20, 319, 26, NULL, NULL, NULL, '2024-02-17 11:52:11', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (21, 320, 3, NULL, NULL, NULL, '2024-02-17 12:41:48', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (22, 321, 3, NULL, NULL, NULL, '2024-02-17 12:53:36', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (23, 322, 3, NULL, NULL, NULL, '2024-02-17 12:55:25', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (24, 323, 3, NULL, NULL, NULL, '2024-02-17 12:58:14', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (25, 324, 29, NULL, NULL, NULL, '2024-02-18 07:43:55', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (26, 325, 3, NULL, NULL, NULL, '2024-02-18 03:03:36', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (27, 326, 3, '测试\n', 3, NULL, '2024-02-18 03:16:18', NULL, '2024-02-18 15:05:10', NULL); +INSERT INTO `audit` VALUES (28, 327, 3, NULL, NULL, NULL, '2024-02-18 15:11:54', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (29, 328, 3, NULL, NULL, NULL, '2024-02-18 15:12:58', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (30, 329, 3, '附件错误', 3, NULL, '2024-02-21 01:51:00', NULL, '2024-02-21 02:04:27', NULL); +INSERT INTO `audit` VALUES (31, 330, 3, NULL, NULL, NULL, '2024-02-21 01:53:32', NULL, NULL, NULL); +INSERT INTO `audit` VALUES (32, 331, 3, '1234567', 3, NULL, '2024-03-07 07:52:30', NULL, '2024-03-07 07:53:51', NULL); + +-- ---------------------------- +-- Table structure for gateway +-- ---------------------------- +DROP TABLE IF EXISTS `gateway`; +CREATE TABLE `gateway` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '票据id 主键id', + `user_id` bigint NULL DEFAULT NULL COMMENT '用户id 票据创建者id', + `user_name` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名', + `title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '票据标题', + `body` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '主体内容 票据详细内容', + `money` decimal(32, 8) NULL DEFAULT NULL COMMENT '金额 票据金额', + `status` tinyint NULL DEFAULT NULL COMMENT '状态 0:未提交,草稿;1:未审核;2:审核通过;3:退回、审核未通过', + `type` tinyint NULL DEFAULT NULL COMMENT '票据类型', + `contact_email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系方式email邮箱', + `company_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户公司名称 票据对应的企业名称', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `attach_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件id', + `auditor_id` bigint NULL DEFAULT NULL COMMENT '审核员id 审核员id', + `comment` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核意见', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 355 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '票据表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of gateway +-- ---------------------------- +INSERT INTO `gateway` VALUES (1, 2, NULL, '办公器材1', '2020年新购置办公设备、电脑设备1', 1000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:16', NULL, '2024-03-22 00:49:21', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (2, 2, NULL, '办公器材2', '2020年新购置办公设备、电脑设备2', 2000.00000000, 3, 1, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:16', NULL, '2024-03-22 00:49:21', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (3, 2, NULL, '办公器材3', '2020年新购置办公设备、电脑设备3', 3900.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:16', NULL, '2024-03-22 00:49:21', NULL, '195bd3517bfcd9915906957730bdd6fef7fa5a86', 3, '\n'); +INSERT INTO `gateway` VALUES (4, 2, NULL, '办公器材4', '2020年新购置办公设备、电脑设备4', 4000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:17', NULL, '2024-03-22 00:49:21', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (5, 2, NULL, '办公器材5', '2020年新购置办公设备、电脑设备5', 5000.00000000, 3, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:17', NULL, '2024-03-22 00:59:00', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (6, 2, NULL, '办公器材6', '2020年新购置办公设备、电脑设备6', 6000.00000000, 3, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:17', NULL, '2024-03-22 00:49:22', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (7, 2, NULL, '办公器材7', '2020年新购置办公设备、电脑设备7', 7000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:17', NULL, '2024-03-22 00:49:22', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (8, 2, NULL, '办公器材8', '2020年新购置办公设备、电脑设备8', 8000.00000000, 3, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:17', NULL, '2024-03-22 00:49:22', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (9, 2, NULL, '办公器材9', '2020年新购置办公设备、电脑设备9', 9000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:18', NULL, '2024-03-22 00:49:22', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (10, 2, NULL, '办公器材10', '2020年新购置办公设备、电脑设备10', 10000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:18', NULL, '2024-03-22 00:49:22', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (11, 2, NULL, '办公器材11', '2020年新购置办公设备、电脑设备11', 11000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:18', NULL, '2024-03-22 00:49:23', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (12, 2, NULL, '办公器材12', '2020年新购置办公设备、电脑设备12', 12000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:18', NULL, '2024-03-22 00:49:23', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (13, 2, NULL, '办公器材13', '2020年新购置办公设备、电脑设备13', 13000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:19', NULL, '2024-03-22 00:49:23', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (14, 2, NULL, '办公器材14', '2020年新购置办公设备、电脑设备14', 14000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:19', NULL, '2024-03-22 00:49:23', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (15, 2, NULL, '办公器材15', '2020年新购置办公设备、电脑设备15', 15000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:19', NULL, '2024-03-22 00:49:23', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (16, 2, NULL, '办公器材16', '2020年新购置办公设备、电脑设备16', 16000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:19', NULL, '2024-03-22 00:49:23', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (17, 2, NULL, '办公器材17', '2020年新购置办公设备、电脑设备17', 17000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:19', NULL, '2024-03-22 00:49:23', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (18, 2, NULL, '办公器材18', '2020年新购置办公设备、电脑设备18', 18000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:20', NULL, '2024-03-22 00:49:24', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (19, 2, NULL, '办公器材19', '2020年新购置办公设备、电脑设备19', 19000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:20', NULL, '2024-03-22 00:49:24', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (20, 2, NULL, '办公器材20', '2020年新购置办公设备、电脑设备20', 20000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:20', NULL, '2024-03-22 00:49:24', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (21, 2, NULL, '办公器材21', '2020年新购置办公设备、电脑设备21', 21000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:20', NULL, '2024-03-22 00:49:24', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (22, 2, NULL, '办公器材22', '2020年新购置办公设备、电脑设备22', 22000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:21', NULL, '2024-03-22 00:49:24', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (23, 2, NULL, '办公器材23', '2020年新购置办公设备、电脑设备23', 23000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:21', NULL, '2024-03-22 00:49:25', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (24, 2, NULL, '办公器材24', '2020年新购置办公设备、电脑设备24', 24000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:21', NULL, '2024-03-22 00:49:25', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (25, 2, NULL, '办公器材25', '2020年新购置办公设备、电脑设备25', 25000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:21', NULL, '2024-03-22 00:49:25', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (26, 2, NULL, '办公器材26', '2020年新购置办公设备、电脑设备26', 26000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:22', NULL, '2024-03-22 00:49:25', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (27, 2, NULL, '办公器材27', '2020年新购置办公设备、电脑设备27', 27000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:22', NULL, '2024-03-22 00:49:25', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (28, 2, NULL, '办公器材28', '2020年新购置办公设备、电脑设备28', 28000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:22', NULL, '2024-03-22 00:49:25', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (29, 2, NULL, '办公器材29', '2020年新购置办公设备、电脑设备29', 29000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:22', NULL, '2024-03-22 00:49:26', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (30, 2, NULL, '办公器材30', '2020年新购置办公设备、电脑设备30', 30000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:22', NULL, '2024-03-22 00:49:26', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (31, 2, NULL, '办公器材31', '2020年新购置办公设备、电脑设备31', 31000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:23', NULL, '2024-03-22 00:49:26', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (32, 2, NULL, '办公器材32', '2020年新购置办公设备、电脑设备32', 32000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:23', NULL, '2024-03-22 00:49:26', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (33, 2, NULL, '办公器材33', '2020年新购置办公设备、电脑设备33', 33000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:23', NULL, '2024-03-22 00:49:26', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (34, 2, NULL, '办公器材34', '2020年新购置办公设备、电脑设备34', 34000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:23', NULL, '2024-03-22 00:49:27', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (35, 2, NULL, '办公器材35', '2020年新购置办公设备、电脑设备35', 35000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:24', NULL, '2024-03-22 00:49:27', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (36, 2, NULL, '办公器材36', '2020年新购置办公设备、电脑设备36', 36000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:24', NULL, '2024-03-22 00:49:27', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (37, 2, NULL, '办公器材37', '2020年新购置办公设备、电脑设备37', 37000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:24', NULL, '2024-03-22 00:49:27', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (38, 2, NULL, '办公器材38', '2020年新购置办公设备、电脑设备38', 38000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:24', NULL, '2024-03-22 00:49:27', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (39, 2, NULL, '办公器材39', '2020年新购置办公设备、电脑设备39', 39000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:24', NULL, '2024-03-22 00:49:27', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (40, 2, NULL, '办公器材40', '2020年新购置办公设备、电脑设备40', 40000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:25', NULL, '2024-03-22 00:49:28', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (41, 2, NULL, '办公器材41', '2020年新购置办公设备、电脑设备41', 41000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:25', NULL, '2024-03-22 00:49:28', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (42, 2, NULL, '办公器材42', '2020年新购置办公设备、电脑设备42', 42000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:25', NULL, '2024-03-22 00:49:28', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (43, 2, NULL, '办公器材43', '2020年新购置办公设备、电脑设备43', 43000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:25', NULL, '2024-03-22 00:49:28', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (44, 2, NULL, '办公器材44', '2020年新购置办公设备、电脑设备44', 44000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:26', NULL, '2024-03-22 00:49:28', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (45, 2, NULL, '办公器材45', '2020年新购置办公设备、电脑设备45', 45000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:26', NULL, '2024-03-22 00:49:28', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (46, 2, NULL, '办公器材46', '2020年新购置办公设备、电脑设备46', 46000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:26', NULL, '2024-03-22 00:49:28', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (47, 2, NULL, '办公器材47', '2020年新购置办公设备、电脑设备47', 47000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:26', NULL, '2024-03-22 00:49:29', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (48, 2, NULL, '办公器材48', '2020年新购置办公设备、电脑设备48', 48000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:27', NULL, '2024-03-22 00:49:29', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (49, 2, NULL, '办公器材49', '2020年新购置办公设备、电脑设备49', 49000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:27', NULL, '2024-03-22 00:49:29', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (50, 2, NULL, '办公器材50', '2020年新购置办公设备、电脑设备50', 50000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:27', NULL, '2024-03-22 00:49:29', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (51, 2, NULL, '办公器材51', '2020年新购置办公设备、电脑设备51', 51000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:27', NULL, '2024-03-22 00:49:29', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (52, 2, NULL, '办公器材52', '2020年新购置办公设备、电脑设备52', 52000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:27', NULL, '2024-03-22 00:49:30', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (53, 2, NULL, '办公器材53', '2020年新购置办公设备、电脑设备53', 53000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:28', NULL, '2024-03-22 00:49:30', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (54, 2, NULL, '办公器材54', '2020年新购置办公设备、电脑设备54', 54000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:28', NULL, '2024-03-22 00:49:30', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (55, 2, NULL, '办公器材55', '2020年新购置办公设备、电脑设备55', 55000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:28', NULL, '2024-03-22 00:49:30', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (56, 2, NULL, '办公器材56', '2020年新购置办公设备、电脑设备56', 56000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:28', NULL, '2024-03-22 00:49:30', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (57, 2, NULL, '办公器材57', '2020年新购置办公设备、电脑设备57', 57000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:29', NULL, '2024-03-22 00:49:30', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (58, 2, NULL, '办公器材58', '2020年新购置办公设备、电脑设备58', 58000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:29', NULL, '2024-03-22 00:49:31', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (59, 2, NULL, '办公器材59', '2020年新购置办公设备、电脑设备59', 59000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:29', NULL, '2024-03-22 00:49:31', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (60, 2, NULL, '办公器材60', '2020年新购置办公设备、电脑设备60', 60000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:29', NULL, '2024-03-22 00:49:31', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (61, 2, NULL, '办公器材61', '2020年新购置办公设备、电脑设备61', 61000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:29', NULL, '2024-03-22 00:49:31', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (62, 2, NULL, '办公器材62', '2020年新购置办公设备、电脑设备62', 62000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:30', NULL, '2024-03-22 00:49:31', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (63, 2, NULL, '办公器材63', '2020年新购置办公设备、电脑设备63', 63000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:30', NULL, '2024-03-22 00:49:32', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (64, 2, NULL, '办公器材64', '2020年新购置办公设备、电脑设备64', 64000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:30', NULL, '2024-03-22 00:49:32', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (65, 2, NULL, '办公器材65', '2020年新购置办公设备、电脑设备65', 65000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:30', NULL, '2024-03-22 00:49:32', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (66, 2, NULL, '办公器材66', '2020年新购置办公设备、电脑设备66', 66000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:30', NULL, '2024-03-22 00:49:32', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (67, 2, NULL, '办公器材67', '2020年新购置办公设备、电脑设备67', 67000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:31', NULL, '2024-03-22 00:49:32', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (68, 2, NULL, '办公器材68', '2020年新购置办公设备、电脑设备68', 68000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:31', NULL, '2024-03-22 00:49:32', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (69, 2, NULL, '办公器材69', '2020年新购置办公设备、电脑设备69', 69000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:31', NULL, '2024-03-22 00:49:32', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (70, 2, NULL, '办公器材70', '2020年新购置办公设备、电脑设备70', 70000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:31', NULL, '2024-03-22 00:49:33', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (71, 2, NULL, '办公器材1', '2020年新购置办公设备、电脑设备1', 1000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:32', NULL, '2024-03-22 00:49:33', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (72, 2, NULL, '办公器材2', '2020年新购置办公设备、电脑设备2', 2000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:32', NULL, '2024-03-22 00:49:33', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (73, 2, NULL, '办公器材3', '2020年新购置办公设备、电脑设备3', 3000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:32', NULL, '2024-03-22 00:49:33', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (74, 2, NULL, '办公器材4', '2020年新购置办公设备、电脑设备4', 4000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:32', NULL, '2024-03-22 00:49:33', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (75, 2, NULL, '办公器材5', '2020年新购置办公设备、电脑设备5', 5000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:33', NULL, '2024-03-22 00:49:33', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (76, 2, NULL, '办公器材6', '2020年新购置办公设备、电脑设备6', 6000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:33', NULL, '2024-03-22 00:49:34', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (77, 2, NULL, '办公器材7', '2020年新购置办公设备、电脑设备7', 7000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:33', NULL, '2024-03-22 00:49:34', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (78, 2, NULL, '办公器材8', '2020年新购置办公设备、电脑设备8', 8000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:33', NULL, '2024-03-22 00:49:34', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (79, 2, NULL, '办公器材9', '2020年新购置办公设备、电脑设备9', 9000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:33', NULL, '2024-03-22 00:49:34', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (80, 2, NULL, '办公器材10', '2020年新购置办公设备、电脑设备10', 10000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:34', NULL, '2024-03-22 00:49:34', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (81, 2, NULL, '办公器材11', '2020年新购置办公设备、电脑设备11', 11000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:34', NULL, '2024-03-22 00:49:34', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (82, 2, NULL, '办公器材12', '2020年新购置办公设备、电脑设备12', 12000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:34', NULL, '2024-03-22 00:49:35', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (83, 2, NULL, '办公器材13', '2020年新购置办公设备、电脑设备13', 13000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:34', NULL, '2024-03-22 00:49:35', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (84, 2, NULL, '办公器材14', '2020年新购置办公设备、电脑设备14', 14000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:34', NULL, '2024-03-22 00:49:35', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (85, 2, NULL, '办公器材15', '2020年新购置办公设备、电脑设备15', 15000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:35', NULL, '2024-03-22 00:49:35', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (86, 2, NULL, '办公器材16', '2020年新购置办公设备、电脑设备16', 16000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:35', NULL, '2024-03-22 00:49:35', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (87, 2, NULL, '办公器材17', '2020年新购置办公设备、电脑设备17', 17000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:35', NULL, '2024-03-22 00:49:36', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (88, 2, NULL, '办公器材18', '2020年新购置办公设备、电脑设备18', 18000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:35', NULL, '2024-03-22 00:49:36', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (89, 2, NULL, '办公器材19', '2020年新购置办公设备、电脑设备19', 19000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:36', NULL, '2024-03-22 00:49:36', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (90, 2, NULL, '办公器材20', '2020年新购置办公设备、电脑设备20', 20000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:36', NULL, '2024-03-22 00:49:36', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (91, 2, NULL, '办公器材21', '2020年新购置办公设备、电脑设备21', 21000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:36', NULL, '2024-03-22 00:49:36', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (92, 2, NULL, '办公器材22', '2020年新购置办公设备、电脑设备22', 22000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:36', NULL, '2024-03-22 00:49:36', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (93, 2, NULL, '办公器材23', '2020年新购置办公设备、电脑设备23', 23000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:37', NULL, '2024-03-22 00:49:36', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (94, 2, NULL, '办公器材24', '2020年新购置办公设备、电脑设备24', 24000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:37', NULL, '2024-03-22 00:49:37', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (95, 2, NULL, '办公器材25', '2020年新购置办公设备、电脑设备25', 25000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:37', NULL, '2024-03-22 00:49:37', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (96, 2, NULL, '办公器材26', '2020年新购置办公设备、电脑设备26', 26000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:37', NULL, '2024-03-22 00:49:37', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (97, 2, NULL, '办公器材27', '2020年新购置办公设备、电脑设备27', 27000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:37', NULL, '2024-03-22 00:49:37', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (98, 2, NULL, '办公器材28', '2020年新购置办公设备、电脑设备28', 28000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:38', NULL, '2024-03-22 00:49:37', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (99, 2, NULL, '办公器材29', '2020年新购置办公设备、电脑设备29', 29000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:38', NULL, '2024-03-22 00:49:37', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (100, 2, NULL, '办公器材30', '2020年新购置办公设备、电脑设备30', 30000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:38', NULL, '2024-03-22 00:49:38', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (101, 2, NULL, '办公器材31', '2020年新购置办公设备、电脑设备31', 31000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:38', NULL, '2024-03-22 00:49:38', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (102, 2, NULL, '办公器材32', '2020年新购置办公设备、电脑设备32', 32000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:39', NULL, '2024-03-22 00:49:38', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (103, 2, NULL, '办公器材33', '2020年新购置办公设备、电脑设备33', 33000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:39', NULL, '2024-03-22 00:49:38', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (104, 2, NULL, '办公器材34', '2020年新购置办公设备、电脑设备34', 34000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:39', NULL, '2024-03-22 00:49:38', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (105, 2, NULL, '办公器材35', '2020年新购置办公设备、电脑设备35', 35000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:39', NULL, '2024-03-22 00:49:39', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (106, 2, NULL, '办公器材36', '2020年新购置办公设备、电脑设备36', 36000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:40', NULL, '2024-03-22 00:49:39', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (107, 2, NULL, '办公器材37', '2020年新购置办公设备、电脑设备37', 37000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:40', NULL, '2024-03-22 00:49:39', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (108, 2, NULL, '办公器材38', '2020年新购置办公设备、电脑设备38', 38000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:40', NULL, '2024-03-22 00:49:39', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (109, 2, NULL, '办公器材39', '2020年新购置办公设备、电脑设备39', 39000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:40', NULL, '2024-03-22 00:49:39', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (110, 2, NULL, '办公器材40', '2020年新购置办公设备、电脑设备40', 40000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:40', NULL, '2024-03-22 00:49:39', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (111, 2, NULL, '办公器材41', '2020年新购置办公设备、电脑设备41', 41000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:41', NULL, '2024-03-22 00:49:40', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (112, 2, NULL, '办公器材42', '2020年新购置办公设备、电脑设备42', 42000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:41', NULL, '2024-03-22 00:49:40', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (113, 2, NULL, '办公器材43', '2020年新购置办公设备、电脑设备43', 43000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:41', NULL, '2024-03-22 00:49:40', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (114, 2, NULL, '办公器材44', '2020年新购置办公设备、电脑设备44', 44000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:41', NULL, '2024-03-22 00:49:40', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (115, 2, NULL, '办公器材45', '2020年新购置办公设备、电脑设备45', 45000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:41', NULL, '2024-03-22 00:49:40', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (116, 2, NULL, '办公器材46', '2020年新购置办公设备、电脑设备46', 46000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:42', NULL, '2024-03-22 00:49:40', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (117, 2, NULL, '办公器材47', '2020年新购置办公设备、电脑设备47', 47000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:42', NULL, '2024-03-22 00:49:41', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (118, 2, NULL, '办公器材48', '2020年新购置办公设备、电脑设备48', 48000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:42', NULL, '2024-03-22 00:49:41', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (119, 2, NULL, '办公器材49', '2020年新购置办公设备、电脑设备49', 49000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:42', NULL, '2024-03-22 00:49:41', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (120, 2, NULL, '办公器材50', '2020年新购置办公设备、电脑设备50', 50000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:43', NULL, '2024-03-22 00:49:41', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (121, 2, NULL, '办公器材51', '2020年新购置办公设备、电脑设备51', 51000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:43', NULL, '2024-03-22 00:49:41', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (122, 2, NULL, '办公器材52', '2020年新购置办公设备、电脑设备52', 52000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:43', NULL, '2024-03-22 00:49:42', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (123, 2, NULL, '办公器材53', '2020年新购置办公设备、电脑设备53', 53000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:43', NULL, '2024-03-22 00:49:42', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (124, 2, NULL, '办公器材54', '2020年新购置办公设备、电脑设备54', 54000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:43', NULL, '2024-03-22 00:49:42', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (125, 2, NULL, '办公器材55', '2020年新购置办公设备、电脑设备55', 55000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:44', NULL, '2024-03-22 00:49:42', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (126, 2, NULL, '办公器材56', '2020年新购置办公设备、电脑设备56', 56000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:44', NULL, '2024-03-22 00:49:42', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (127, 2, NULL, '办公器材57', '2020年新购置办公设备、电脑设备57', 57000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:45', NULL, '2024-03-22 00:49:42', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (128, 2, NULL, '办公器材58', '2020年新购置办公设备、电脑设备58', 58000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:45', NULL, '2024-03-22 00:49:43', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (129, 2, NULL, '办公器材59', '2020年新购置办公设备、电脑设备59', 59000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:45', NULL, '2024-03-22 00:49:43', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (130, 2, NULL, '办公器材60', '2020年新购置办公设备、电脑设备60', 60000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:46', NULL, '2024-03-22 00:49:43', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (131, 2, NULL, '办公器材61', '2020年新购置办公设备、电脑设备61', 61000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:46', NULL, '2024-03-22 00:49:43', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (132, 2, NULL, '办公器材62', '2020年新购置办公设备、电脑设备62', 62000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:46', NULL, '2024-03-22 00:49:43', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (133, 2, NULL, '办公器材63', '2020年新购置办公设备、电脑设备63', 63000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:46', NULL, '2024-03-22 00:49:44', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (134, 2, NULL, '办公器材64', '2020年新购置办公设备、电脑设备64', 64000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:46', NULL, '2024-03-22 00:49:44', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (135, 2, NULL, '办公器材65', '2020年新购置办公设备、电脑设备65', 65000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:47', NULL, '2024-03-22 00:49:44', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (136, 2, NULL, '办公器材66', '2020年新购置办公设备、电脑设备66', 66000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:47', NULL, '2024-03-22 00:49:44', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (137, 2, NULL, '办公器材67', '2020年新购置办公设备、电脑设备67', 67000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:47', NULL, '2024-03-22 00:49:45', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (138, 2, NULL, '办公器材68', '2020年新购置办公设备、电脑设备68', 68000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:47', NULL, '2024-03-22 00:49:45', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (139, 2, NULL, '办公器材69', '2020年新购置办公设备、电脑设备69', 69000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:48', NULL, '2024-03-22 00:49:45', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (140, 2, NULL, '办公器材70', '2020年新购置办公设备、电脑设备70', 70000.00000000, 2, 2, '123@qq.com', '中山领航科技公司', NULL, '2024-03-22 00:28:48', NULL, '2024-03-22 00:49:46', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (141, 2, NULL, '办公器材1', '2020年新购置办公设备、电脑设备1rg2jp', 1000.00000000, 0, 1, '123@qq.com', '中山领航科技公司1u95a', NULL, '2024-03-22 00:28:48', NULL, '2024-03-22 00:49:46', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (142, 2, NULL, '办公器材2', '2020年新购置办公设备、电脑设备2vi5co', 2000.00000000, 0, 2, '123@qq.com', '中山领航科技公司2y141', NULL, '2024-03-22 00:28:48', NULL, '2024-03-22 00:49:46', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (143, 2, NULL, '办公器材3', '2020年新购置办公设备、电脑设备3jdi4m', 3000.00000000, 0, 1, '123@qq.com', '中山领航科技公司3i868', NULL, '2024-03-22 00:28:49', NULL, '2024-03-22 00:49:46', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (144, 2, NULL, '办公器材4', '2020年新购置办公设备、电脑设备4rt1mi', 4600.00000000, 3, 2, '123@qq.com', '中山领航科技公司4or7t', NULL, '2024-03-22 00:28:49', NULL, '2024-03-22 00:49:46', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (145, 2, NULL, '办公器材5', '2020年新购置办公设备、电脑设备5gm8je', 5009.00000000, 1, 2, '123@qq.com', '中山领航科技公司5bbw6', NULL, '2024-03-22 00:28:49', NULL, '2024-03-22 00:49:47', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (146, 2, NULL, '办公器材6', '2020年新购置办公设备、电脑设备66kv01', 6000.00000000, 0, 2, '123@qq.com', '中山领航科技公司6k3zb', NULL, '2024-03-22 00:28:50', NULL, '2024-03-22 00:49:47', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (147, 2, NULL, '办公器材7', '2020年新购置办公设备、电脑设备7bcvt6', 7000.00000000, 0, 1, '123@qq.com', '中山领航科技公司7x0hd', NULL, '2024-03-22 00:28:50', NULL, '2024-03-22 00:49:47', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (148, 2, NULL, '办公器材8', '2020年新购置办公设备、电脑设备80flxv', 8000.00000000, 0, 1, '123@qq.com', '中山领航科技公司8dpt0', NULL, '2024-03-22 00:28:50', NULL, '2024-03-22 00:49:47', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (149, 2, NULL, '办公器材9', '2020年新购置办公设备、电脑设备9', 9000.00000000, 2, 1, '123zsc@qq.com', '中山领航科技公司92', NULL, '2024-03-22 00:28:50', NULL, '2024-03-22 00:49:47', NULL, '84fa4f586f190886ea8708c49e8645f5a9a1ea04', 3, NULL); +INSERT INTO `gateway` VALUES (150, 2, NULL, '办公器材10', '2020年新购置办公设备、电脑设备105t1tr', 10000.00000000, 0, 3, '123@qq.com', '中山领航科技公司10d1lo', NULL, '2024-03-22 00:28:51', NULL, '2024-03-22 00:49:48', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (151, 2, NULL, '办公器材11', '2020年新购置办公设备、电脑设备111xlms', 11000.00000000, 0, 1, '123@qq.com', '中山领航科技公司11kuzc', NULL, '2024-03-22 00:28:51', NULL, '2024-03-22 00:49:48', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (152, 2, NULL, '办公器材12', '2020年新购置办公设备、电脑设备12y1vn8', 12000.00000000, 0, 2, '123@qq.com', '中山领航科技公司127p84', NULL, '2024-03-22 00:28:51', NULL, '2024-03-22 00:49:48', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (153, 2, NULL, '办公器材13', '2020年新购置办公设备、电脑设备13bw9c4', 13000.00000000, 0, 3, '123@qq.com', '中山领航科技公司13wlwb', NULL, '2024-03-22 00:28:51', NULL, '2024-03-22 00:49:48', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (154, 2, NULL, '办公器材14', '2020年新购置办公设备、电脑设备14elkq6', 14000.00000000, 0, 3, '123@qq.com', '中山领航科技公司14ulkn', NULL, '2024-03-22 00:28:52', NULL, '2024-03-22 00:49:48', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (155, 2, NULL, '办公器材15', '2020年新购置办公设备、电脑设备15mwr23', 15000.00000000, 0, 2, '123@qq.com', '中山领航科技公司15shrv', NULL, '2024-03-22 00:28:52', NULL, '2024-03-22 00:49:48', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (156, 2, NULL, '办公器材16', '2020年新购置办公设备、电脑设备169elat', 16000.00000000, 0, 2, '123@qq.com', '中山领航科技公司1683ll', NULL, '2024-03-22 00:28:53', NULL, '2024-03-22 00:49:48', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (157, 2, NULL, '办公器材17', '2020年新购置办公设备、电脑设备1753m9u', 17000.00000000, 0, 2, '123@qq.com', '中山领航科技公司171t5j', NULL, '2024-03-22 00:28:53', NULL, '2024-03-22 00:49:49', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (158, 2, NULL, '办公器材18', '2020年新购置办公设备、电脑设备18zvyly', 18000.00000000, 0, 1, '123@qq.com', '中山领航科技公司18gm2d', NULL, '2024-03-22 00:28:53', NULL, '2024-03-22 00:49:49', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (159, 2, NULL, '办公器材19', '2020年新购置办公设备、电脑设备19cbb27', 19000.00000000, 0, 3, '123@qq.com', '中山领航科技公司19nh9z', NULL, '2024-03-22 00:28:54', NULL, '2024-03-22 00:49:49', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (160, 2, NULL, '办公器材20', '2020年新购置办公设备、电脑设备20vh15m', 20000.00000000, 0, 3, '123@qq.com', '中山领航科技公司20662y', NULL, '2024-03-22 00:28:54', NULL, '2024-03-22 00:49:49', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (161, 2, NULL, '办公器材21', '2020年新购置办公设备、电脑设备21qdbkp', 21000.00000000, 0, 3, '123@qq.com', '中山领航科技公司217r4j', NULL, '2024-03-22 00:28:55', NULL, '2024-03-22 00:49:49', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (162, 2, NULL, '办公器材22', '2020年新购置办公设备、电脑设备227cb7t', 22000.00000000, 0, 2, '123@qq.com', '中山领航科技公司22fpuj', NULL, '2024-03-22 00:28:55', NULL, '2024-03-22 00:49:49', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (163, 2, NULL, '办公器材23', '2020年新购置办公设备、电脑设备2370mdc', 23000.00000000, 0, 3, '123@qq.com', '中山领航科技公司23joum', NULL, '2024-03-22 00:28:56', NULL, '2024-03-22 00:49:50', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (164, 2, NULL, '办公器材24', '2020年新购置办公设备、电脑设备243ky3i', 24000.00000000, 0, 2, '123@qq.com', '中山领航科技公司2456bq', NULL, '2024-03-22 00:28:56', NULL, '2024-03-22 00:49:50', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (165, 2, NULL, '办公器材25', '2020年新购置办公设备、电脑设备25or2hu', 25000.00000000, 0, 2, '123@qq.com', '中山领航科技公司25e92u', NULL, '2024-03-22 00:28:56', NULL, '2024-03-22 00:49:50', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (166, 2, NULL, '办公器材26', '2020年新购置办公设备、电脑设备265rmr8', 26000.00000000, 0, 1, '123@qq.com', '中山领航科技公司26a98e', NULL, '2024-03-22 00:28:56', NULL, '2024-03-22 00:49:50', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (167, 2, NULL, '办公器材27', '2020年新购置办公设备、电脑设备27of5iq', 27000.00000000, 0, 3, '123@qq.com', '中山领航科技公司27j4ho', NULL, '2024-03-22 00:28:56', NULL, '2024-03-22 00:49:50', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (168, 2, NULL, '办公器材28', '2020年新购置办公设备、电脑设备289wma2', 28000.00000000, 0, 1, '123@qq.com', '中山领航科技公司28yxcu', NULL, '2024-03-22 00:28:57', NULL, '2024-03-22 00:49:50', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (169, 2, NULL, '办公器材29', '2020年新购置办公设备、电脑设备29vea6v', 29000.00000000, 0, 1, '123@qq.com', '中山领航科技公司29jdfl', NULL, '2024-03-22 00:28:57', NULL, '2024-03-22 00:49:51', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (170, 2, NULL, '办公器材30', '2020年新购置办公设备、电脑设备30ol3bj', 30000.00000000, 0, 3, '123@qq.com', '中山领航科技公司30sboc', NULL, '2024-03-22 00:28:57', NULL, '2024-03-22 00:49:51', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (171, 2, NULL, '办公器材31', '2020年新购置办公设备、电脑设备31x5ax4', 31000.00000000, 0, 1, '123@qq.com', '中山领航科技公司313aqm', NULL, '2024-03-22 00:28:57', NULL, '2024-03-22 00:49:51', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (172, 2, NULL, '办公器材32', '2020年新购置办公设备、电脑设备326lbiv', 32000.00000000, 0, 1, '123@qq.com', '中山领航科技公司320gp2', NULL, '2024-03-22 00:28:57', NULL, '2024-03-22 00:49:51', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (173, 2, NULL, '办公器材33', '2020年新购置办公设备、电脑设备33lvlf3', 33000.00000000, 0, 2, '123@qq.com', '中山领航科技公司33fgyy', NULL, '2024-03-22 00:28:58', NULL, '2024-03-22 00:49:51', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (174, 2, NULL, '办公器材34', '2020年新购置办公设备、电脑设备34rp1rm', 34000.00000000, 0, 1, '123@qq.com', '中山领航科技公司3469kt', NULL, '2024-03-22 00:28:58', NULL, '2024-03-22 00:49:51', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (175, 2, NULL, '办公器材35', '2020年新购置办公设备、电脑设备35tdcr6', 35000.00000000, 0, 2, '123@qq.com', '中山领航科技公司35zwkj', NULL, '2024-03-22 00:28:58', NULL, '2024-03-22 00:49:52', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (176, 2, NULL, '办公器材36', '2020年新购置办公设备、电脑设备36vc5mz', 36000.00000000, 0, 1, '123@qq.com', '中山领航科技公司36ciq4', NULL, '2024-03-22 00:28:58', NULL, '2024-03-22 00:49:52', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (177, 2, NULL, '办公器材37', '2020年新购置办公设备、电脑设备37kfzmd', 37000.00000000, 0, 1, '123@qq.com', '中山领航科技公司37qgyk', NULL, '2024-03-22 00:28:58', NULL, '2024-03-22 00:49:52', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (178, 2, NULL, '办公器材38', '2020年新购置办公设备、电脑设备388yoqm', 38000.00000000, 0, 1, '123@qq.com', '中山领航科技公司38syrc', NULL, '2024-03-22 00:28:59', NULL, '2024-03-22 00:49:52', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (179, 2, NULL, '办公器材39', '2020年新购置办公设备、电脑设备39fja9f', 39000.00000000, 0, 3, '123@qq.com', '中山领航科技公司39poq5', NULL, '2024-03-22 00:28:59', NULL, '2024-03-22 00:49:52', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (180, 2, NULL, '办公器材40', '2020年新购置办公设备、电脑设备40lt212', 40000.00000000, 0, 1, '123@qq.com', '中山领航科技公司40t6la', NULL, '2024-03-22 00:28:59', NULL, '2024-03-22 00:49:52', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (181, 2, NULL, '办公器材41', '2020年新购置办公设备、电脑设备41h74d0', 41000.00000000, 0, 1, '123@qq.com', '中山领航科技公司41ufqf', NULL, '2024-03-22 00:28:59', NULL, '2024-03-22 00:49:53', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (182, 2, NULL, '办公器材42', '2020年新购置办公设备、电脑设备421hhbo', 42000.00000000, 0, 2, '123@qq.com', '中山领航科技公司42ilxo', NULL, '2024-03-22 00:28:59', NULL, '2024-03-22 00:49:53', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (183, 2, NULL, '办公器材43', '2020年新购置办公设备、电脑设备43kmamx', 43000.00000000, 0, 3, '123@qq.com', '中山领航科技公司43yg8t', NULL, '2024-03-22 00:29:00', NULL, '2024-03-22 00:49:53', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (184, 2, NULL, '办公器材44', '2020年新购置办公设备、电脑设备44q57sj', 44000.00000000, 0, 1, '123@qq.com', '中山领航科技公司448pnc', NULL, '2024-03-22 00:29:00', NULL, '2024-03-22 00:49:53', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (185, 2, NULL, '办公器材45', '2020年新购置办公设备、电脑设备45xvoar', 45000.00000000, 0, 1, '123@qq.com', '中山领航科技公司45zpz1', NULL, '2024-03-22 00:29:00', NULL, '2024-03-22 00:49:53', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (186, 2, NULL, '办公器材46', '2020年新购置办公设备、电脑设备469qz1t', 46000.00000000, 0, 1, '123@qq.com', '中山领航科技公司469rvv', NULL, '2024-03-22 00:29:00', NULL, '2024-03-22 00:49:53', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (187, 2, NULL, '办公器材47', '2020年新购置办公设备、电脑设备47t2jq7', 47000.00000000, 0, 1, '123@qq.com', '中山领航科技公司47t7w6', NULL, '2024-03-22 00:29:01', NULL, '2024-03-22 00:49:54', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (188, 2, NULL, '办公器材48', '2020年新购置办公设备、电脑设备48c793y', 48000.00000000, 0, 2, '123@qq.com', '中山领航科技公司48f7nf', NULL, '2024-03-22 00:29:01', NULL, '2024-03-22 00:49:54', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (189, 2, NULL, '办公器材49', '2020年新购置办公设备、电脑设备490iuth', 49000.00000000, 0, 2, '123@qq.com', '中山领航科技公司49gsgf', NULL, '2024-03-22 00:29:01', NULL, '2024-03-22 00:49:54', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (190, 2, NULL, '办公器材50', '2020年新购置办公设备、电脑设备50q149t', 50000.00000000, 0, 3, '123@qq.com', '中山领航科技公司50lypl', NULL, '2024-03-22 00:29:01', NULL, '2024-03-22 00:49:54', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (191, 2, NULL, '办公器材51', '2020年新购置办公设备、电脑设备51229zg', 51000.00000000, 0, 1, '123@qq.com', '中山领航科技公司51slct', NULL, '2024-03-22 00:29:01', NULL, '2024-03-22 00:49:54', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (192, 2, NULL, '办公器材52', '2020年新购置办公设备、电脑设备5257rt6', 52000.00000000, 0, 2, '123@qq.com', '中山领航科技公司52n37v', NULL, '2024-03-22 00:29:02', NULL, '2024-03-22 00:49:54', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (193, 2, NULL, '办公器材53', '2020年新购置办公设备、电脑设备53ifezm', 53000.00000000, 0, 1, '123@qq.com', '中山领航科技公司53faxn', NULL, '2024-03-22 00:29:02', NULL, '2024-03-22 00:49:55', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (194, 2, NULL, '办公器材54', '2020年新购置办公设备、电脑设备54i1bv5', 54000.00000000, 0, 3, '123@qq.com', '中山领航科技公司54viw2', NULL, '2024-03-22 00:29:02', NULL, '2024-03-22 00:49:55', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (195, 2, NULL, '办公器材55', '2020年新购置办公设备、电脑设备558n4pb', 55000.00000000, 0, 3, '123@qq.com', '中山领航科技公司554qjp', NULL, '2024-03-22 00:29:02', NULL, '2024-03-22 00:49:55', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (196, 2, NULL, '办公器材56', '2020年新购置办公设备、电脑设备56gmbow', 56000.00000000, 0, 1, '123@qq.com', '中山领航科技公司56zsxm', NULL, '2024-03-22 00:29:03', NULL, '2024-03-22 00:49:55', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (197, 2, NULL, '办公器材57', '2020年新购置办公设备、电脑设备575yetp', 57000.00000000, 0, 3, '123@qq.com', '中山领航科技公司57ia84', NULL, '2024-03-22 00:29:03', NULL, '2024-03-22 00:49:55', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (198, 2, NULL, '办公器材58', '2020年新购置办公设备、电脑设备581n5ay', 58000.00000000, 0, 1, '123@qq.com', '中山领航科技公司58qa13', NULL, '2024-03-22 00:29:03', NULL, '2024-03-22 00:49:55', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (199, 2, NULL, '办公器材59', '2020年新购置办公设备、电脑设备5966ns3', 59000.00000000, 0, 2, '123@qq.com', '中山领航科技公司59mlto', NULL, '2024-03-22 00:29:03', NULL, '2024-03-22 00:49:56', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (200, 2, NULL, '办公器材60', '2020年新购置办公设备、电脑设备60edo8r', 60000.00000000, 0, 3, '123@qq.com', '中山领航科技公司60kmzh', NULL, '2024-03-22 00:29:03', NULL, '2024-03-22 00:49:56', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (201, 2, NULL, '办公器材61', '2020年新购置办公设备、电脑设备61d34ic', 61000.00000000, 0, 2, '123@qq.com', '中山领航科技公司61hvan', NULL, '2024-03-22 00:29:04', NULL, '2024-03-22 00:49:56', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (202, 2, NULL, '办公器材62', '2020年新购置办公设备、电脑设备6202ley', 62000.00000000, 0, 3, '123@qq.com', '中山领航科技公司628cm4', NULL, '2024-03-22 00:29:04', NULL, '2024-03-22 00:49:56', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (203, 2, NULL, '办公器材63', '2020年新购置办公设备、电脑设备632b2t1', 63000.00000000, 0, 1, '123@qq.com', '中山领航科技公司63x77w', NULL, '2024-03-22 00:29:04', NULL, '2024-03-22 00:49:56', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (204, 2, NULL, '办公器材64', '2020年新购置办公设备、电脑设备64bp178', 64000.00000000, 0, 1, '123@qq.com', '中山领航科技公司649ax9', NULL, '2024-03-22 00:29:04', NULL, '2024-03-22 00:49:56', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (205, 2, NULL, '办公器材65', '2020年新购置办公设备、电脑设备65lqkr8', 65000.00000000, 0, 3, '123@qq.com', '中山领航科技公司65eo1n', NULL, '2024-03-22 00:29:05', NULL, '2024-03-22 00:49:56', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (206, 2, NULL, '办公器材66', '2020年新购置办公设备、电脑设备66de07r', 66000.00000000, 0, 2, '123@qq.com', '中山领航科技公司66eznp', NULL, '2024-03-22 00:29:05', NULL, '2024-03-22 00:49:57', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (207, 2, NULL, '办公器材67', '2020年新购置办公设备、电脑设备67j7z2v', 67000.00000000, 0, 3, '123@qq.com', '中山领航科技公司6797q0', NULL, '2024-03-22 00:29:05', NULL, '2024-03-22 00:49:57', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (208, 2, NULL, '办公器材68', '2020年新购置办公设备、电脑设备68xsc36', 68000.00000000, 0, 3, '123@qq.com', '中山领航科技公司68mw32', NULL, '2024-03-22 00:29:05', NULL, '2024-03-22 00:49:57', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (209, 2, NULL, '办公器材69', '2020年新购置办公设备、电脑设备69p3i2n', 69000.00000000, 0, 2, '123@qq.com', '中山领航科技公司69l3y8', NULL, '2024-03-22 00:29:06', NULL, '2024-03-22 00:49:57', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (210, 2, NULL, '办公器材70', '2020年新购置办公设备、电脑设备70p716y', 70000.00000000, 0, 1, '123@qq.com', '中山领航科技公司70v55f', NULL, '2024-03-22 00:29:06', NULL, '2024-03-22 00:49:57', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (211, 2, NULL, '办公器材1', '2020年新购置办公设备、电脑设备1ffscb', 1000.00000000, 0, 1, '123@qq.com', '中山领航科技公司13sfg', NULL, '2024-03-22 00:29:06', NULL, '2024-03-22 00:49:57', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (212, 2, NULL, '办公器材2', '2020年新购置办公设备、电脑设备2x5yvh', 2000.00000000, 0, 1, '123@qq.com', '中山领航科技公司2sg8d', NULL, '2024-03-22 00:29:06', NULL, '2024-03-22 00:49:58', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (213, 2, NULL, '办公器材3', '2020年新购置办公设备、电脑设备3zkvi5', 3000.00000000, 0, 2, '123@qq.com', '中山领航科技公司3viyn', NULL, '2024-03-22 00:29:07', NULL, '2024-03-22 00:49:58', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (214, 2, NULL, '办公器材4', '2020年新购置办公设备、电脑设备4n8jfb', 4000.00000000, 0, 3, '123@qq.com', '中山领航科技公司44cqb', NULL, '2024-03-22 00:29:07', NULL, '2024-03-22 00:49:58', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (215, 2, NULL, '办公器材5', '2020年新购置办公设备、电脑设备55uo47', 5000.00000000, 0, 2, '123@qq.com', '中山领航科技公司5ah6f', NULL, '2024-03-22 00:29:07', NULL, '2024-03-22 00:49:58', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (216, 2, NULL, '办公器材6', '2020年新购置办公设备、电脑设备64si04', 6000.00000000, 0, 2, '123@qq.com', '中山领航科技公司6az86', NULL, '2024-03-22 00:29:07', NULL, '2024-03-22 00:49:58', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (217, 2, NULL, '办公器材7', '2020年新购置办公设备、电脑设备7xociw', 7000.00000000, 0, 3, '123@qq.com', '中山领航科技公司7brrs', NULL, '2024-03-22 00:29:07', NULL, '2024-03-22 00:49:59', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (218, 2, NULL, '办公器材8', '2020年新购置办公设备、电脑设备8h6hi5', 8000.00000000, 0, 1, '123@qq.com', '中山领航科技公司8iq28', NULL, '2024-03-22 00:29:08', NULL, '2024-03-22 00:49:59', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (219, 2, NULL, '办公器材9', '2020年新购置办公设备、电脑设备966ou8', 9000.00000000, 0, 1, '123@qq.com', '中山领航科技公司9uymj', NULL, '2024-03-22 00:29:08', NULL, '2024-03-22 00:49:59', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (220, 2, NULL, '办公器材10', '2020年新购置办公设备、电脑设备105epmw', 10000.00000000, 0, 2, '123@qq.com', '中山领航科技公司10anwt', NULL, '2024-03-22 00:29:08', NULL, '2024-03-22 00:49:59', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (221, 2, NULL, '办公器材11', '2020年新购置办公设备、电脑设备11ql2rt', 11000.00000000, 0, 1, '123@qq.com', '中山领航科技公司112df3', NULL, '2024-03-22 00:29:08', NULL, '2024-03-22 00:49:59', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (222, 2, NULL, '办公器材12', '2020年新购置办公设备、电脑设备12yz1nw', 12000.00000000, 0, 2, '123@qq.com', '中山领航科技公司12tj24', NULL, '2024-03-22 00:29:08', NULL, '2024-03-22 00:49:59', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (223, 2, NULL, '办公器材13', '2020年新购置办公设备、电脑设备13kmk0l', 13000.00000000, 0, 1, '123@qq.com', '中山领航科技公司13w4m6', NULL, '2024-03-22 00:29:09', NULL, '2024-03-22 00:49:59', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (224, 2, NULL, '办公器材14', '2020年新购置办公设备、电脑设备145m8rz', 14000.00000000, 0, 3, '123@qq.com', '中山领航科技公司141cif', NULL, '2024-03-22 00:29:09', NULL, '2024-03-22 00:50:00', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (225, 2, NULL, '办公器材15', '2020年新购置办公设备、电脑设备153fdxh', 15000.00000000, 0, 3, '123@qq.com', '中山领航科技公司15adm0', NULL, '2024-03-22 00:29:09', NULL, '2024-03-22 00:50:00', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (226, 2, NULL, '办公器材16', '2020年新购置办公设备、电脑设备16jk0z1', 16000.00000000, 0, 1, '123@qq.com', '中山领航科技公司16yw1y', NULL, '2024-03-22 00:29:09', NULL, '2024-03-22 00:50:00', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (227, 2, NULL, '办公器材17', '2020年新购置办公设备、电脑设备17rajse', 17000.00000000, 0, 3, '123@qq.com', '中山领航科技公司172c4m', NULL, '2024-03-22 00:29:10', NULL, '2024-03-22 00:50:00', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (228, 2, NULL, '办公器材18', '2020年新购置办公设备、电脑设备184baub', 18000.00000000, 0, 1, '123@qq.com', '中山领航科技公司18ku6j', NULL, '2024-03-22 00:29:10', NULL, '2024-03-22 00:50:00', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (229, 2, NULL, '办公器材19', '2020年新购置办公设备、电脑设备19a4jih', 19000.00000000, 0, 2, '123@qq.com', '中山领航科技公司19p3d8', NULL, '2024-03-22 00:29:10', NULL, '2024-03-22 00:50:00', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (230, 2, NULL, '办公器材20', '2020年新购置办公设备、电脑设备20kqvx5', 20000.00000000, 0, 2, '123@qq.com', '中山领航科技公司20snpl', NULL, '2024-03-22 00:29:10', NULL, '2024-03-22 00:50:01', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (231, 2, NULL, '办公器材21', '2020年新购置办公设备、电脑设备21g16rc', 21000.00000000, 0, 1, '123@qq.com', '中山领航科技公司21vsae', NULL, '2024-03-22 00:29:10', NULL, '2024-03-22 00:50:01', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (232, 2, NULL, '办公器材22', '2020年新购置办公设备、电脑设备224iawi', 22000.00000000, 0, 2, '123@qq.com', '中山领航科技公司22n9lk', NULL, '2024-03-22 00:29:11', NULL, '2024-03-22 00:50:01', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (233, 2, NULL, '办公器材23', '2020年新购置办公设备、电脑设备23thiec', 23000.00000000, 0, 2, '123@qq.com', '中山领航科技公司237br4', NULL, '2024-03-22 00:29:11', NULL, '2024-03-22 00:50:01', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (234, 2, NULL, '办公器材24', '2020年新购置办公设备、电脑设备243vjtv', 24000.00000000, 0, 1, '123@qq.com', '中山领航科技公司24fhuh', NULL, '2024-03-22 00:29:11', NULL, '2024-03-22 00:50:01', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (235, 2, NULL, '办公器材25', '2020年新购置办公设备、电脑设备25q4i47', 25000.00000000, 0, 1, '123@qq.com', '中山领航科技公司258dio', NULL, '2024-03-22 00:29:11', NULL, '2024-03-22 00:50:01', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (236, 2, NULL, '办公器材26', '2020年新购置办公设备、电脑设备26dzez1', 26000.00000000, 0, 1, '123@qq.com', '中山领航科技公司26ssqp', NULL, '2024-03-22 00:29:12', NULL, '2024-03-22 00:50:02', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (237, 2, NULL, '办公器材27', '2020年新购置办公设备、电脑设备272i8a8', 27000.00000000, 0, 1, '123@qq.com', '中山领航科技公司273kc7', NULL, '2024-03-22 00:29:12', NULL, '2024-03-22 00:50:02', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (238, 2, NULL, '办公器材28', '2020年新购置办公设备、电脑设备285ptp6', 28000.00000000, 0, 2, '123@qq.com', '中山领航科技公司287jvc', NULL, '2024-03-22 00:29:12', NULL, '2024-03-22 00:50:02', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (239, 2, NULL, '办公器材29', '2020年新购置办公设备、电脑设备29ac8nj', 29000.00000000, 0, 3, '123@qq.com', '中山领航科技公司29sl2h', NULL, '2024-03-22 00:29:12', NULL, '2024-03-22 00:50:02', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (240, 2, NULL, '办公器材30', '2020年新购置办公设备、电脑设备3004sqj', 30000.00000000, 0, 1, '123@qq.com', '中山领航科技公司30pqid', NULL, '2024-03-22 00:29:13', NULL, '2024-03-22 00:50:02', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (241, 2, NULL, '办公器材31', '2020年新购置办公设备、电脑设备313phzg', 31000.00000000, 0, 2, '123@qq.com', '中山领航科技公司31g3w9', NULL, '2024-03-22 00:29:13', NULL, '2024-03-22 00:50:02', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (242, 2, NULL, '办公器材32', '2020年新购置办公设备、电脑设备32m7776', 32000.00000000, 0, 1, '123@qq.com', '中山领航科技公司326nh0', NULL, '2024-03-22 00:29:13', NULL, '2024-03-22 00:50:03', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (243, 2, NULL, '办公器材33', '2020年新购置办公设备、电脑设备33bvij2', 33000.00000000, 0, 1, '123@qq.com', '中山领航科技公司33vir3', NULL, '2024-03-22 00:29:13', NULL, '2024-03-22 00:50:03', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (244, 2, NULL, '办公器材34', '2020年新购置办公设备、电脑设备347petb', 34000.00000000, 0, 3, '123@qq.com', '中山领航科技公司34jd1b', NULL, '2024-03-22 00:29:14', NULL, '2024-03-22 00:50:03', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (245, 2, NULL, '办公器材35', '2020年新购置办公设备、电脑设备35d5u9t', 35000.00000000, 0, 2, '123@qq.com', '中山领航科技公司351pri', NULL, '2024-03-22 00:29:14', NULL, '2024-03-22 00:50:03', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (246, 2, NULL, '办公器材36', '2020年新购置办公设备、电脑设备36t63f7', 36000.00000000, 0, 1, '123@qq.com', '中山领航科技公司362pgl', NULL, '2024-03-22 00:29:14', NULL, '2024-03-22 00:50:03', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (247, 2, NULL, '办公器材37', '2020年新购置办公设备、电脑设备37o8j3o', 37000.00000000, 0, 2, '123@qq.com', '中山领航科技公司372mmj', NULL, '2024-03-22 00:29:14', NULL, '2024-03-22 00:50:03', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (248, 2, NULL, '办公器材38', '2020年新购置办公设备、电脑设备38otw1v', 38000.00000000, 0, 3, '123@qq.com', '中山领航科技公司38us0j', NULL, '2024-03-22 00:29:15', NULL, '2024-03-22 00:50:03', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (249, 2, NULL, '办公器材39', '2020年新购置办公设备、电脑设备393yk15', 39000.00000000, 0, 1, '123@qq.com', '中山领航科技公司39sl2w', NULL, '2024-03-22 00:29:15', NULL, '2024-03-22 00:50:04', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (250, 2, NULL, '办公器材40', '2020年新购置办公设备、电脑设备40pj6md', 40000.00000000, 0, 1, '123@qq.com', '中山领航科技公司40atro', NULL, '2024-03-22 00:29:15', NULL, '2024-03-22 00:50:04', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (251, 2, NULL, '办公器材41', '2020年新购置办公设备、电脑设备41fx9j3', 41000.00000000, 0, 1, '123@qq.com', '中山领航科技公司41aojk', NULL, '2024-03-22 00:29:15', NULL, '2024-03-22 00:50:04', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (252, 2, NULL, '办公器材42', '2020年新购置办公设备、电脑设备42f9r0p', 42000.00000000, 0, 2, '123@qq.com', '中山领航科技公司42jutg', NULL, '2024-03-22 00:29:15', NULL, '2024-03-22 00:50:04', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (253, 2, NULL, '办公器材43', '2020年新购置办公设备、电脑设备437auqe', 43000.00000000, 0, 2, '123@qq.com', '中山领航科技公司43h8kf', NULL, '2024-03-22 00:29:16', NULL, '2024-03-22 00:50:04', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (254, 2, NULL, '办公器材44', '2020年新购置办公设备、电脑设备44xi7cz', 44000.00000000, 0, 1, '123@qq.com', '中山领航科技公司44j9ju', NULL, '2024-03-22 00:29:16', NULL, '2024-03-22 00:50:04', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (255, 2, NULL, '办公器材45', '2020年新购置办公设备、电脑设备454xy31', 45000.00000000, 0, 2, '123@qq.com', '中山领航科技公司454xos', NULL, '2024-03-22 00:29:16', NULL, '2024-03-22 00:50:05', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (256, 2, NULL, '办公器材46', '2020年新购置办公设备、电脑设备46mt3cd', 46000.00000000, 0, 3, '123@qq.com', '中山领航科技公司4698jf', NULL, '2024-03-22 00:29:16', NULL, '2024-03-22 00:50:05', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (257, 2, NULL, '办公器材47', '2020年新购置办公设备、电脑设备47lxctv', 47000.00000000, 0, 1, '123@qq.com', '中山领航科技公司47lo8y', NULL, '2024-03-22 00:29:17', NULL, '2024-03-22 00:50:05', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (258, 2, NULL, '办公器材48', '2020年新购置办公设备、电脑设备481kxph', 48000.00000000, 0, 2, '123@qq.com', '中山领航科技公司48q3fr', NULL, '2024-03-22 00:29:17', NULL, '2024-03-22 00:50:05', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (259, 2, NULL, '办公器材49', '2020年新购置办公设备、电脑设备49qiqg8', 49000.00000000, 0, 3, '123@qq.com', '中山领航科技公司49o57s', NULL, '2024-04-09 00:29:17', NULL, '2024-04-09 00:28:25', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (260, 2, NULL, '办公器材50', '2020年新购置办公设备、电脑设备50sbd9k', 50000.00000000, 0, 3, '123@qq.com', '中山领航科技公司50kqaf', NULL, '2024-04-09 00:29:17', NULL, '2024-04-09 00:28:31', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (261, 2, NULL, '办公器材51', '2020年新购置办公设备、电脑设备51xnbc5', 51000.00000000, 0, 2, '123@qq.com', '中山领航科技公司512s39', NULL, '2024-03-20 00:29:18', NULL, '2024-04-09 00:28:41', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (262, 2, NULL, '办公器材52', '2020年新购置办公设备、电脑设备52kyaxa', 52000.00000000, 0, 3, '123@qq.com', '中山领航科技公司52rlxu', NULL, '2024-03-22 00:29:18', NULL, '2024-03-22 00:50:06', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (263, 2, NULL, '办公器材53', '2020年新购置办公设备、电脑设备537cejj', 53000.00000000, 0, 1, '123@qq.com', '中山领航科技公司53ny90', NULL, '2024-03-22 00:29:18', NULL, '2024-03-22 00:50:06', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (264, 2, NULL, '办公器材54', '2020年新购置办公设备、电脑设备54ads8o', 54000.00000000, 0, 3, '123@qq.com', '中山领航科技公司547zzs', NULL, '2024-04-02 00:29:18', NULL, '2024-04-09 00:28:52', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (265, 2, NULL, '办公器材55', '2020年新购置办公设备、电脑设备55xwkv1', 55000.00000000, 0, 2, '123@qq.com', '中山领航科技公司553l2h', NULL, '2024-03-22 00:29:19', NULL, '2024-03-22 00:50:06', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (266, 2, NULL, '办公器材56', '2020年新购置办公设备、电脑设备56f5tn0', 56000.00000000, 0, 1, '123@qq.com', '中山领航科技公司56d0sh', NULL, '2024-03-22 00:29:19', NULL, '2024-03-22 00:50:06', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (267, 2, NULL, '办公器材57', '2020年新购置办公设备、电脑设备57ej4p8', 57000.00000000, 0, 1, '123@qq.com', '中山领航科技公司572il9', NULL, '2024-03-22 00:29:19', NULL, '2024-03-22 00:50:07', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (268, 2, NULL, '办公器材58', '2020年新购置办公设备、电脑设备581wzw3', 58000.00000000, 0, 1, '123@qq.com', '中山领航科技公司585kl2', NULL, '2024-03-22 00:29:19', NULL, '2024-03-22 00:50:07', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (269, 2, NULL, '办公器材59', '2020年新购置办公设备、电脑设备59e12gg', 59000.00000000, 0, 3, '123@qq.com', '中山领航科技公司59l4hl', NULL, '2024-03-22 00:29:19', NULL, '2024-03-22 00:50:07', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (270, 2, NULL, '办公器材60', '2020年新购置办公设备、电脑设备604rlui', 60000.00000000, 0, 3, '123@qq.com', '中山领航科技公司604eva', NULL, '2024-03-22 00:29:20', NULL, '2024-03-22 00:50:07', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (271, 2, NULL, '办公器材61', '2020年新购置办公设备、电脑设备61hjv84', 61000.00000000, 0, 3, '123@qq.com', '中山领航科技公司61n1pw', NULL, '2024-03-22 00:29:20', NULL, '2024-03-22 00:50:07', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (272, 2, NULL, '办公器材62', '2020年新购置办公设备、电脑设备62uxylo', 62000.00000000, 0, 2, '123@qq.com', '中山领航科技公司62h83z', NULL, '2024-03-22 00:29:20', NULL, '2024-03-22 00:50:07', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (273, 2, NULL, '办公器材63', '2020年新购置办公设备、电脑设备63hqmyl', 63000.00000000, 0, 3, '123@qq.com', '中山领航科技公司63p89t', NULL, '2024-03-22 00:29:21', NULL, '2024-03-22 00:50:08', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (274, 2, NULL, '办公器材64', '2020年新购置办公设备、电脑设备643rtc2', 64000.00000000, 0, 1, '123@qq.com', '中山领航科技公司64g120', NULL, '2024-03-22 00:29:21', NULL, '2024-03-22 00:50:08', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (275, 2, NULL, '办公器材65', '2020年新购置办公设备、电脑设备65d5h55', 65000.00000000, 0, 3, '123@qq.com', '中山领航科技公司654lnh', NULL, '2024-03-22 00:29:21', NULL, '2024-03-22 00:50:08', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (276, 2, NULL, '办公器材66', '2020年新购置办公设备、电脑设备66fiqm6', 66000.00000000, 0, 1, '123@qq.com', '中山领航科技公司669ksr', NULL, '2024-03-22 00:29:21', NULL, '2024-03-22 00:50:08', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (277, 2, NULL, '办公器材67', '2020年新购置办公设备、电脑设备6714ef0', 67000.00000000, 0, 3, '123@qq.com', '中山领航科技公司671hwv', NULL, '2024-03-22 00:29:22', NULL, '2024-03-22 00:50:08', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (278, 2, NULL, '办公器材68', '2020年新购置办公设备、电脑设备680chwf', 68000.00000000, 0, 3, '123@qq.com', '中山领航科技公司680zgt', NULL, '2024-03-22 00:29:22', NULL, '2024-03-22 00:50:08', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (279, 2, NULL, '办公器材69', '2020年新购置办公设备、电脑设备69g4nzl', 69000.00000000, 0, 1, '123@qq.com', '中山领航科技公司69bf6o', NULL, '2024-03-22 00:29:22', NULL, '2024-03-22 00:50:08', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (280, 2, NULL, '办公器材70', '2020年新购置办公设备、电脑设备7018axe', 70000.00000000, 0, 3, '123@qq.com', '中山领航科技公司707vom', NULL, '2024-03-22 00:29:22', NULL, '2024-03-22 00:50:09', NULL, NULL, 3, NULL); +INSERT INTO `gateway` VALUES (354, 2, NULL, '体育器材', '羽毛球十一副', 2290.00000000, 2, 0, '29602589903@qq.com', '中山领航科技公司票据部门', NULL, '2024-03-22 01:09:28', NULL, '2024-03-22 01:09:47', NULL, '84fa4f586f190886ea8708c49e8645f5a9a1ea04', 3, ''); + +-- ---------------------------- +-- Table structure for sys_dept +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dept`; +CREATE TABLE `sys_dept` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', + `pid` bigint NULL DEFAULT NULL COMMENT '上级部门', + `sub_count` int NULL DEFAULT 0 COMMENT '子部门数目', + `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '名称', + `dept_sort` int NULL DEFAULT 999 COMMENT '排序', + `enabled` bit(1) NULL DEFAULT NULL COMMENT '状态', + `create_by` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '创建者', + `update_by` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '更新者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `inx_pid`(`pid` ASC) USING BTREE, + INDEX `inx_enabled`(`enabled` ASC) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 236 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '部门' ROW_FORMAT = COMPACT; + +-- ---------------------------- +-- Records of sys_dept +-- ---------------------------- +INSERT INTO `sys_dept` VALUES (210, NULL, 0, '管理部门', 999, b'1', NULL, NULL, '2024-01-15 05:59:55', '2024-01-23 08:47:48', '管理部门'); +INSERT INTO `sys_dept` VALUES (215, NULL, 0, '华南地区', 999, b'1', NULL, NULL, '2024-01-24 02:21:08', '2024-02-05 03:53:00', '华南地区'); +INSERT INTO `sys_dept` VALUES (216, NULL, 0, '华北地区', 999, b'1', NULL, NULL, '2024-01-24 02:23:49', NULL, '华北地区'); +INSERT INTO `sys_dept` VALUES (217, NULL, 0, '东北地区', 999, b'1', NULL, NULL, '2024-01-24 02:24:06', NULL, '东北地区'); +INSERT INTO `sys_dept` VALUES (218, NULL, 0, '华东地区', 999, b'1', NULL, NULL, '2024-01-24 02:24:28', '2024-02-05 03:53:04', '华东地区'); +INSERT INTO `sys_dept` VALUES (219, NULL, 0, '华中地区', 999, b'1', NULL, NULL, '2024-01-24 02:24:49', NULL, '华中地区'); +INSERT INTO `sys_dept` VALUES (220, NULL, 0, '西南地区', 999, b'1', NULL, NULL, '2024-01-24 02:25:06', NULL, '西南地区'); +INSERT INTO `sys_dept` VALUES (221, NULL, 0, '西北地区', 999, b'1', NULL, NULL, '2024-01-24 02:26:28', NULL, '西北地区'); +INSERT INTO `sys_dept` VALUES (222, NULL, 0, '港澳台地区', 999, b'1', NULL, NULL, '2024-01-24 02:26:55', '2024-01-25 11:29:52', '港澳台地区'); +INSERT INTO `sys_dept` VALUES (235, NULL, 0, '用户部门', 999, b'1', NULL, NULL, '2024-03-22 00:07:32', NULL, '普通用户'); + +-- ---------------------------- +-- Table structure for sys_role +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role`; +CREATE TABLE `sys_role` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', + `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '名称', + `level` int NULL DEFAULT NULL COMMENT '角色级别', + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '描述', + `data_scope` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '数据权限', + `create_by` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '创建者', + `update_by` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '更新者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `enabled` bit(1) NULL DEFAULT NULL COMMENT '状态', + `remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `uniq_name`(`name` ASC) USING BTREE, + INDEX `role_name_index`(`name` ASC) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 84 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '角色表' ROW_FORMAT = COMPACT; + +-- ---------------------------- +-- Records of sys_role +-- ---------------------------- +INSERT INTO `sys_role` VALUES (50, 'admin', NULL, NULL, NULL, NULL, NULL, '2024-01-15 05:59:55', '2024-01-30 08:16:43', b'1', 'admin'); +INSERT INTO `sys_role` VALUES (51, 'user', NULL, NULL, NULL, NULL, NULL, '2024-01-16 09:22:30', '2024-02-21 07:06:10', b'1', '客户'); +INSERT INTO `sys_role` VALUES (54, 'auditor', NULL, NULL, NULL, NULL, NULL, '2024-01-19 16:15:45', '2024-01-24 14:48:55', b'1', '审核员'); + +-- ---------------------------- +-- Table structure for sys_role_authorities +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role_authorities`; +CREATE TABLE `sys_role_authorities` ( + `role_id` bigint NOT NULL, + `authority` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL, + INDEX `FKbyfnfkpgrf4jmo3nf97arsphd`(`role_id` ASC) USING BTREE +) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = COMPACT; + +-- ---------------------------- +-- Records of sys_role_authorities +-- ---------------------------- +INSERT INTO `sys_role_authorities` VALUES (50, 'ROLE_CREATE'); +INSERT INTO `sys_role_authorities` VALUES (50, 'DEPT_QUERY'); +INSERT INTO `sys_role_authorities` VALUES (50, 'DEPT_DELETE'); +INSERT INTO `sys_role_authorities` VALUES (50, 'ROLE_QUERY'); +INSERT INTO `sys_role_authorities` VALUES (50, 'ROLE_UPDATE'); +INSERT INTO `sys_role_authorities` VALUES (50, 'USER_UPDATE'); +INSERT INTO `sys_role_authorities` VALUES (50, 'USER_QUERY'); +INSERT INTO `sys_role_authorities` VALUES (50, 'USER_CREATE'); +INSERT INTO `sys_role_authorities` VALUES (50, 'DEPT_UPDATE'); +INSERT INTO `sys_role_authorities` VALUES (50, 'USER_DELETE'); +INSERT INTO `sys_role_authorities` VALUES (50, 'DEPT_CREATE'); +INSERT INTO `sys_role_authorities` VALUES (50, 'gateway_QUERY'); +INSERT INTO `sys_role_authorities` VALUES (50, 'gateway_CREATE'); +INSERT INTO `sys_role_authorities` VALUES (51, 'ROLE_QUERY'); +INSERT INTO `sys_role_authorities` VALUES (51, 'gateway_CREATE'); +INSERT INTO `sys_role_authorities` VALUES (51, 'USER_QUERY'); +INSERT INTO `sys_role_authorities` VALUES (51, 'DEPT_QUERY'); +INSERT INTO `sys_role_authorities` VALUES (51, 'gateway_QUERY'); +INSERT INTO `sys_role_authorities` VALUES (54, 'gateway_QUERY'); +INSERT INTO `sys_role_authorities` VALUES (54, 'gateway_AUDIT'); +INSERT INTO `sys_role_authorities` VALUES (51, 'gateway_UPDATE'); +INSERT INTO `sys_role_authorities` VALUES (51, 'gateway_DELETE'); + +-- ---------------------------- +-- Table structure for sys_roles_depts +-- ---------------------------- +DROP TABLE IF EXISTS `sys_roles_depts`; +CREATE TABLE `sys_roles_depts` ( + `role_id` bigint NOT NULL, + `dept_id` bigint NOT NULL, + PRIMARY KEY (`role_id`, `dept_id`) USING BTREE, + INDEX `FK7qg6itn5ajdoa9h9o78v9ksur`(`dept_id` ASC) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '角色部门关联' ROW_FORMAT = COMPACT; + +-- ---------------------------- +-- Records of sys_roles_depts +-- ---------------------------- + +-- ---------------------------- +-- Table structure for sys_user +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user`; +CREATE TABLE `sys_user` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + `dept_id` bigint NULL DEFAULT NULL COMMENT '部门id', + `role_id` bigint NULL DEFAULT NULL COMMENT '角色id', + `username` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '用户名', + `password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '密码', + `phone` varchar(11) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '手机号码', + `email` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '电子邮箱', + `nick_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '昵称', + `gender` varchar(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '性别', + `avatar` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '头像', + `address` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '地址', + `is_admin` bit(1) NULL DEFAULT b'0' COMMENT '是否为admin账号', + `create_by` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '创建者', + `update_by` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '更新者', + `create_time` datetime NULL DEFAULT NULL, + `update_time` datetime NULL DEFAULT NULL, + `remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL, + `enabled` bit(1) NULL DEFAULT NULL COMMENT '状态', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = COMPACT; + +-- ---------------------------- +-- Records of sys_user +-- ---------------------------- +INSERT INTO `sys_user` VALUES (1, 210, 50, 'admin', '{bcrypt}$2a$10$lwEbMpGYMIcVpuVXIWBSlOO7d085buqONGjTuY4tg3rz84y/xFQXe', '19897785991', 'zsc3456@qq.com', '林艳燕', '1', '35bd7d32843a413f3cd2486114318d6ccd5f9d62', '青海省太原市南区阳光小区', b'0', NULL, NULL, '2024-01-11 09:57:48', '2024-01-11 18:31:29', NULL, b'1'); +INSERT INTO `sys_user` VALUES (2, 47, 51, 'user', '{bcrypt}$2a$10$R5qaOOGWtRafshnZhp7JH.UNAq5eul2c2CvM.GXreNIwZBMPsKmAy', '18112287699', 'd.fyxpbtmxsg@qq.com', 'user', NULL, '35bd7d32843a413f3cd2486114318d6ccd5f9d62', NULL, b'0', NULL, NULL, '2024-01-11 10:48:16', '2024-02-05 03:50:38', NULL, b'1'); +INSERT INTO `sys_user` VALUES (3, 215, 54, 'fan', '{bcrypt}$2a$10$bBm.mxf5abNzeJXFwMgIberTxMr1nVv5eUt805YCaPvDfKX0ldb/6', '18112287672', 'd.fyxpb@qq.com', '一89', NULL, '84fa4f586f190886ea8708c49e8645f5a9a1ea04', NULL, b'0', NULL, NULL, '2024-01-12 12:06:42', '2024-01-15 08:36:28', NULL, b'1'); +INSERT INTO `sys_user` VALUES (4, 219, 51, '1`1', '{bcrypt}$2a$10$ZDmPG6gqUaN0vsoNS6j70.uA5FKHZE5nRMKZf/6WHfrGgf/q3UJdW', '13502325', '2960203@qq.com', NULL, NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-16 03:52:13', '2024-02-13 08:40:27', NULL, b'1'); +INSERT INTO `sys_user` VALUES (5, NULL, 51, '12', '{bcrypt}$2a$10$N4PqKhlXpMAU7nJPI/Mm5uZDoYc7X0qvsSiUgtHBykVk3Cjs1Yxm.', '13502326', '29603@qq.com', NULL, NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-16 06:14:30', NULL, NULL, b'1'); +INSERT INTO `sys_user` VALUES (6, NULL, 51, 'sqwe', '{bcrypt}$2a$10$PDdjFOnTF123RcTiOKu9EuKTvtGPiyy2jJxjnk5ToUzmId20OoZsW', '131312313', '123@qq.com', NULL, NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-16 06:19:24', '2024-04-03 00:27:04', NULL, b'0'); +INSERT INTO `sys_user` VALUES (7, 215, 54, '123123', '{bcrypt}$2a$10$4./cDROSXEt5DHsNH6ouz.Ay0gd6wajuIkBXh1VHUySect9Lvmqxe', '13543225886', '29602324003@qq.com', NULL, NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-16 06:22:50', '2024-03-12 07:33:03', NULL, b'0'); +INSERT INTO `sys_user` VALUES (9, NULL, 51, '2131', '{bcrypt}$2a$10$Hko/uEB0/hLqZTcAis58LuPjEsQXOYKH4FH2woJJKa0MxsoZtNrOi', '13502325789', '098765@qq.com', NULL, NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-16 06:59:06', '2024-01-16 12:42:03', NULL, b'0'); +INSERT INTO `sys_user` VALUES (10, NULL, 51, 'adafafak', '{bcrypt}$2a$10$9X96pUTqP3ER7cEdESGhl.hf4t5113ck3p7uNqR8/xN6NzqZ5PHSy', '5678325826', '178689003@qq.com', NULL, NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-16 06:59:39', '2024-01-16 12:07:26', NULL, b'0'); +INSERT INTO `sys_user` VALUES (11, 218, 50, '4124', '{bcrypt}$2a$10$BQFP2Io0zIjjxzRpaP4FLOPvCt8Nr41Z2HU.tz.YhcDIDoUOltY9.', '13502345678', '25620045673@qq.com', NULL, NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-16 13:34:53', '2024-01-16 14:44:47', NULL, b'1'); +INSERT INTO `sys_user` VALUES (12, NULL, 51, '1', '{bcrypt}$2a$10$Zs.5ndLKDT8f.rugaQ8fvu7RHK61pU/in98M84JYFLP.j7qeti8QW', '13502234886', '29602303@qq.com', NULL, NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-18 04:25:27', '2024-01-18 04:27:00', NULL, b'1'); +INSERT INTO `sys_user` VALUES (13, NULL, 51, 'test`', '{bcrypt}$2a$10$npnzn1Xyw4h1yzOXaa5QIeIfF0Afk70n1OXqCnHYAtzP1IBdb.YKe', '12345678978', '29667803@qq.com', NULL, NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-18 04:27:32', '2024-01-25 08:57:43', NULL, b'1'); +INSERT INTO `sys_user` VALUES (14, 216, 51, '123', '{bcrypt}$2a$10$.iskk78ms1M226ag0N6K4OSMhkHHdvOwGdjCjhWQH8atr25bpVOP6', '18614928444', 'b.qbvpmj@qq.com', '123', NULL, NULL, '湖南省齐齐哈尔市禄劝彝族苗族自治县', b'0', NULL, NULL, '2024-01-24 02:40:26', '2024-01-24 03:14:14', NULL, b'1'); +INSERT INTO `sys_user` VALUES (15, 218, NULL, '许强', '123456', '18105318781', 'z.qqosgqfqe@qq.com', '邹静', NULL, 'http://dummyimage.com/100x100', '宁夏回族自治区海南藏族自治州宁国市', b'0', NULL, NULL, '2024-01-24 03:01:48', '2024-02-15 02:55:55', 'consequat', b'1'); +INSERT INTO `sys_user` VALUES (16, 50, 51, '顾娜', '{bcrypt}$2a$10$iMywIFDFOts8oJ1B1YcYJOdHbzBIonF4r5Ym7lTRoiDs4gr10BoQy', '18614928444', 'b.qbvpmj@qq.com', '宋杰', NULL, 'http://dummyimage.com/100x100', '湖南省齐齐哈尔市禄劝彝族苗族自治县', b'0', NULL, NULL, '2024-01-24 03:02:31', '2024-01-25 08:57:12', 'incididunt Ut irure deserunt', b'1'); +INSERT INTO `sys_user` VALUES (17, NULL, 51, 'qaz', '{bcrypt}$2a$10$PZgh7UTODg8kSTS7Y2Bdy.W.zk3bwhNn67cgZ/bJxsNlgkwjWz1NK', '13506785889', '296iuuii003@qq.com', 'bj ', NULL, NULL, '香港', b'0', NULL, NULL, '2024-01-24 03:14:48', '2024-01-25 08:59:17', NULL, b'1'); +INSERT INTO `sys_user` VALUES (18, NULL, 51, '信息', '{bcrypt}$2a$10$UJoxr13YaCPo//CA8mPGU.sl86CspnlzR3FknwIEjdvEjwjlnAATi', '12345676899', '6789252003@qq.com', 'h ', NULL, NULL, '香港', b'0', NULL, NULL, '2024-01-24 14:53:10', '2024-01-24 14:53:39', NULL, b'1'); +INSERT INTO `sys_user` VALUES (19, NULL, 51, '2414', '{bcrypt}$2a$10$v8BPvl5BrpMwPti8bYU.luBOo6SgCGInyANYatlcUjjpHqHKqmKLq', '12779800032', '', '', NULL, NULL, '', b'0', NULL, NULL, '2024-01-25 09:00:59', '2024-01-25 09:24:29', NULL, b'1'); +INSERT INTO `sys_user` VALUES (20, 219, 54, 'zxc', '{bcrypt}$2a$10$JMiwC4480AdMw.F7.GkqS.l2GW65lggmUrv/D0sQEOQsXj/SUQSgG', '13502456786', '2789092003@qq.com', 'zxc', NULL, NULL, NULL, b'0', NULL, NULL, '2024-01-25 15:21:19', NULL, NULL, b'1'); +INSERT INTO `sys_user` VALUES (21, 210, 54, 'asd', '{bcrypt}$2a$10$9yAql02BVzVoxpO0XG/hn.mKLY83sOPzn1NvLMHPnObu8Namfwc0O', '13909856700', '234567903@qq.com', 'asd', NULL, NULL, '湖南省齐齐1', b'0', NULL, NULL, '2024-01-25 15:24:14', '2024-01-26 01:48:10', NULL, b'1'); +INSERT INTO `sys_user` VALUES (22, 218, 54, 'asdg', '{bcrypt}$2a$10$cO4Hjo0UHq5Zu8VB/OW8EuRBKcTZ05obAjALMe.uiyjIdGBW5vUSa', '13909889700', '234599903@qq.com', '1246人员', NULL, NULL, '湖南省', b'0', NULL, NULL, '2024-01-26 05:59:34', '2024-01-26 06:00:03', NULL, b'1'); +INSERT INTO `sys_user` VALUES (23, 215, 54, 'hyq', '{bcrypt}$2a$10$NliUdQD1/jXcsNOV.zhXuOgNsOxAhEeb37TTLwey8Hs6WvmjABP5y', '13599005886', '29602589903@qq.com', 'nckn67', NULL, NULL, '香港', b'0', NULL, NULL, '2024-01-29 12:41:07', '2024-01-29 12:52:02', NULL, b'1'); +INSERT INTO `sys_user` VALUES (24, 215, 54, 'cqp', '{bcrypt}$2a$10$M3Chl1WodN5WErvtgpjBJ.TAdpstLsyMG7pYgmh.gqslYr64ai32m', '13599005906', '29602580903@qq.com', 'cyp', NULL, NULL, '香港', b'0', NULL, NULL, '2024-02-15 02:59:46', '2024-02-15 03:02:10', NULL, b'1'); +INSERT INTO `sys_user` VALUES (25, 215, 51, '多表', '{bcrypt}$2a$10$KlIUOr4OzTX3Ayfg.bB0hei0.IsyoFiOmlfayxAtMRxKQ2Kos5yVC', '13599005810', '2960903@qq.com', '是的', NULL, NULL, '香港', b'0', NULL, NULL, '2024-02-15 14:29:43', NULL, NULL, b'1'); +INSERT INTO `sys_user` VALUES (26, 219, 51, 'userTest', '{bcrypt}$2a$10$o7oW3IYSOOL8FaOaRn/F6OIEPpjmkwqRc7gQ5ZJb4h.BieOdq8QwW', '18614978444', 'b.qb78mj@qq.com', 'user', NULL, NULL, '湖南省齐齐哈尔市禄劝彝族', b'0', NULL, NULL, '2024-02-17 11:43:41', '2024-02-19 02:22:32', NULL, b'1'); +INSERT INTO `sys_user` VALUES (27, 216, 51, 'zsc', '{bcrypt}$2a$10$XT8/VM/2O2Ttg83zP3Zwv.f6UTHrgl9fuhBnr9gTb4uA0niGy52P.', '13334502972', '29653503@qq.com', 'zsc', NULL, NULL, '香港', b'0', NULL, NULL, '2024-02-19 02:24:31', NULL, NULL, b'1'); +INSERT INTO `sys_user` VALUES (28, 215, 51, 'Java', '{bcrypt}$2a$10$nX5JUekwjDxFbz0McpyTwuwQjjKK2330iPe4vsDrVcr6O4KNxuEfi', '13345678978', '123Java@qq.com', 'Javanb', NULL, NULL, '中山市石岐区', b'0', NULL, NULL, '2024-02-21 01:48:14', '2024-02-21 01:49:50', NULL, b'1'); +INSERT INTO `sys_user` VALUES (29, 215, 54, 'spring', '{bcrypt}$2a$10$fDsf0aOysaRdrEPT1xpAl.lF9Rs5ughW9Bgq/Nl4H10gq//NbXIv.', '16567898765', '1234spring@qq.om', 'spring1', NULL, NULL, '中山市', b'0', NULL, NULL, '2024-02-21 01:49:13', '2024-02-21 01:56:05', NULL, b'1'); +INSERT INTO `sys_user` VALUES (30, 215, 54, 'asc', '{bcrypt}$2a$10$dy5Z4O5Q90jpRLCkttvSDOjdoB84UV9M5PPcN2Dq72.9y870mkYb2', '18614928489', '567890@qq.com', 'asc', NULL, '195bd3517bfcd9915906957730bdd6fef7fa5a86', '湖南省齐齐哈尔市禄劝彝族苗族自治县', b'0', NULL, NULL, '2024-03-07 07:50:28', '2024-03-07 07:56:33', NULL, b'1'); +INSERT INTO `sys_user` VALUES (31, 215, 51, 'chen', '{bcrypt}$2a$10$rT2dErDtNNgKhELuKTRAoO4PGmu454S2QKIbuohEXps7hIciT8gnu', '13582728733', '13582728733@qq.com', 'chen_test', NULL, NULL, '香港', b'0', NULL, NULL, '2024-03-21 12:08:16', '2024-03-21 12:10:49', NULL, b'1'); +INSERT INTO `sys_user` VALUES (32, 235, 51, 'zhang', '{bcrypt}$2a$10$5RsUeZGrMzWr0SBbwePrGO6RB0WvRXOH9sSMYIIRthT6KHYUgfkgO', '13467697689', '13467697689@qq.com', 'ZHNAG', NULL, NULL, '', b'0', NULL, NULL, '2024-03-22 00:09:34', NULL, NULL, b'1'); + +-- ---------------------------- +-- Table structure for sys_users_roles +-- ---------------------------- +DROP TABLE IF EXISTS `sys_users_roles`; +CREATE TABLE `sys_users_roles` ( + `user_id` bigint NOT NULL COMMENT '用户ID', + `role_id` bigint NOT NULL COMMENT '角色ID', + PRIMARY KEY (`user_id`, `role_id`) USING BTREE, + INDEX `FKq4eq273l04bpu4efj0jd0jb98`(`role_id` ASC) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '用户角色关联' ROW_FORMAT = COMPACT; + +-- ---------------------------- +-- Records of sys_users_roles +-- ---------------------------- + +-- ---------------------------- +-- Table structure for ticket +-- ---------------------------- +DROP TABLE IF EXISTS `ticket`; +CREATE TABLE `ticket` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '票据id 主键id', + `uuid` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '票据uuid 提供给前端显示用', + `user_id` bigint NULL DEFAULT NULL COMMENT '用户id 票据创建者id', + `title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '票据标题', + `body` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '主体内容 票据详细内容', + `money` decimal(32, 8) NULL DEFAULT NULL COMMENT '金额 票据金额', + `status` tinyint NULL DEFAULT NULL COMMENT '状态 0:未提交,草稿;1:未审核;2:审核通过;3:退回、审核未通过', + `type` tinyint NULL DEFAULT NULL COMMENT '票据类型', + `contact_email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系方式email邮箱', + `company_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户公司名称 票据对应的企业名称', + `created_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `created_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updated_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `updated_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 295 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '票据表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Records of ticket +-- ---------------------------- +INSERT INTO `ticket` VALUES (1, 'ca2d8e2f-61b5-4896-a793-0135325ead8c', NULL, '办公器材1', '2020年新购置办公设备、电脑设备1', 1000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (2, 'b2e6e7e0-4080-4bfc-8b37-3819e25a30d1', NULL, '办公器材2', '2020年新购置办公设备、电脑设备2', 2000.00000000, 3, 1, NULL, '中山领航科技公司', NULL, NULL, NULL, '2022-05-19 11:56:38'); +INSERT INTO `ticket` VALUES (3, 'ce3a7151-27c9-4325-9932-4d05b7ea4db9', NULL, '办公器材3', '2020年新购置办公设备、电脑设备3', 3000.00000000, 1, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, '2022-05-19 11:56:49'); +INSERT INTO `ticket` VALUES (4, 'bf7e8c2e-942c-4cbb-b293-3281c8316310', NULL, '办公器材4', '2020年新购置办公设备、电脑设备4', 4000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (5, 'f0431e1a-e5fc-4531-a5b0-7dad687a0dea', NULL, '办公器材5', '2020年新购置办公设备、电脑设备5', 5000.00000000, 4, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, '2022-05-19 11:56:52'); +INSERT INTO `ticket` VALUES (6, '2189f56a-0b0d-4074-a59f-d1853d9a0dc4', NULL, '办公器材6', '2020年新购置办公设备、电脑设备6', 6000.00000000, 3, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, '2022-05-19 11:56:57'); +INSERT INTO `ticket` VALUES (7, 'ea6281ad-b670-4943-a0ae-0e3f74888c8c', NULL, '办公器材7', '2020年新购置办公设备、电脑设备7', 7000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (8, '5870dc81-52fe-443f-a822-aecaf318f814', NULL, '办公器材8', '2020年新购置办公设备、电脑设备8', 8000.00000000, 3, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, '2022-05-19 11:57:02'); +INSERT INTO `ticket` VALUES (9, '829645cc-17c3-4a4a-ba07-3bb8e59e19e3', NULL, '办公器材9', '2020年新购置办公设备、电脑设备9', 9000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (10, '887808dd-5e09-46eb-b7f7-e4230e37e9c0', NULL, '办公器材10', '2020年新购置办公设备、电脑设备10', 10000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (11, '59f6ce13-cba8-4215-848f-168a9faa2c56', NULL, '办公器材11', '2020年新购置办公设备、电脑设备11', 11000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (12, 'b01d97c4-7b80-4c9e-8592-53e5156dda94', NULL, '办公器材12', '2020年新购置办公设备、电脑设备12', 12000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (13, 'a72cc9e7-1606-4151-9645-47086ef78bd3', NULL, '办公器材13', '2020年新购置办公设备、电脑设备13', 13000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (14, '7e26445a-58af-41e0-8695-d16e390c1093', NULL, '办公器材14', '2020年新购置办公设备、电脑设备14', 14000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (15, '860f97be-1c2a-45bd-8db8-ea8aebadfcfc', NULL, '办公器材15', '2020年新购置办公设备、电脑设备15', 15000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (16, '16fc85e8-af8b-4a0a-b9e0-5469cbdc1681', NULL, '办公器材16', '2020年新购置办公设备、电脑设备16', 16000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (17, 'c35cb85b-8ccd-43ef-b31d-d489c9df708d', NULL, '办公器材17', '2020年新购置办公设备、电脑设备17', 17000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (18, '9b46e710-1459-4b62-86c4-7d964b4a21fe', NULL, '办公器材18', '2020年新购置办公设备、电脑设备18', 18000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (19, '9dbd892b-f71f-4a50-b077-a5edef0258e7', NULL, '办公器材19', '2020年新购置办公设备、电脑设备19', 19000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (20, '8a434d66-5bfd-499a-bda8-35aa39e4eecb', NULL, '办公器材20', '2020年新购置办公设备、电脑设备20', 20000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (21, '3695682b-48d4-4ad4-ab23-9abd4df1d41c', NULL, '办公器材21', '2020年新购置办公设备、电脑设备21', 21000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (22, 'b0035e72-76a4-4e3d-827e-abc9802570fc', NULL, '办公器材22', '2020年新购置办公设备、电脑设备22', 22000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (23, '01a6cec4-69bc-4dd2-ad5a-ecfe7e33e2d6', NULL, '办公器材23', '2020年新购置办公设备、电脑设备23', 23000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (24, '04b00ea3-b282-4797-b39c-379bd26071f0', NULL, '办公器材24', '2020年新购置办公设备、电脑设备24', 24000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (25, '71f52359-f705-416b-bbf3-3625248d86d4', NULL, '办公器材25', '2020年新购置办公设备、电脑设备25', 25000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (26, 'f14f6eda-87fa-4084-9cda-cc56fcce1445', NULL, '办公器材26', '2020年新购置办公设备、电脑设备26', 26000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (27, '0cf409a8-5e40-403d-82b0-41c1c8b1e49c', NULL, '办公器材27', '2020年新购置办公设备、电脑设备27', 27000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (28, '04d9dbd3-949c-4dde-b45f-8b90314d6691', NULL, '办公器材28', '2020年新购置办公设备、电脑设备28', 28000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (29, '08754bb3-b87c-41bd-87b9-f166fb2b6da6', NULL, '办公器材29', '2020年新购置办公设备、电脑设备29', 29000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (30, 'e93097aa-29a9-4e2e-9c4b-965b73129e23', NULL, '办公器材30', '2020年新购置办公设备、电脑设备30', 30000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (31, 'cedf43e0-8483-4e2c-bc48-a54e1261d958', NULL, '办公器材31', '2020年新购置办公设备、电脑设备31', 31000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (32, '2117de95-f848-403e-b3f4-6606153d06ce', NULL, '办公器材32', '2020年新购置办公设备、电脑设备32', 32000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (33, '7627b2d7-c93f-48e2-a42e-e6ddd92a07e0', NULL, '办公器材33', '2020年新购置办公设备、电脑设备33', 33000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (34, '013d5582-7880-4bf8-8be5-1bf15a961a9b', NULL, '办公器材34', '2020年新购置办公设备、电脑设备34', 34000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (35, '017012a7-67a5-4bf9-94df-e49583e0a873', NULL, '办公器材35', '2020年新购置办公设备、电脑设备35', 35000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (36, 'db7f8ba4-054d-4167-8725-8d544dc78103', NULL, '办公器材36', '2020年新购置办公设备、电脑设备36', 36000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (37, '2b50fbeb-9bb7-49d8-a4ae-644e5763fb88', NULL, '办公器材37', '2020年新购置办公设备、电脑设备37', 37000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (38, '224f23c8-0fd8-45b7-8e0b-602bae75acd3', NULL, '办公器材38', '2020年新购置办公设备、电脑设备38', 38000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (39, 'ff9cb798-3e14-43ff-922d-e6a9c61b1362', NULL, '办公器材39', '2020年新购置办公设备、电脑设备39', 39000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (40, '2d2043ff-e546-4494-a161-bf9aaeb469a5', NULL, '办公器材40', '2020年新购置办公设备、电脑设备40', 40000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (41, '91482bfb-701f-4567-bb8f-d2d92a85fe5c', NULL, '办公器材41', '2020年新购置办公设备、电脑设备41', 41000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (42, '150b3176-4160-45da-915a-0ffd5153f261', NULL, '办公器材42', '2020年新购置办公设备、电脑设备42', 42000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (43, 'f0c17cef-5134-4b2a-99f2-455f0b9eb9da', NULL, '办公器材43', '2020年新购置办公设备、电脑设备43', 43000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (44, '73c6e549-e4a6-4b63-ade3-97abe1104ec2', NULL, '办公器材44', '2020年新购置办公设备、电脑设备44', 44000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (45, '4d5c356f-4285-454f-a7c1-ae74eaa68110', NULL, '办公器材45', '2020年新购置办公设备、电脑设备45', 45000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (46, 'f5eac5f6-acf0-4cb3-b96b-064206dc246f', NULL, '办公器材46', '2020年新购置办公设备、电脑设备46', 46000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (47, '49e6b509-b0b2-4f9c-8bac-87db4c8f73ca', NULL, '办公器材47', '2020年新购置办公设备、电脑设备47', 47000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (48, '947a48d0-f76f-425c-9486-0e3d9489ae44', NULL, '办公器材48', '2020年新购置办公设备、电脑设备48', 48000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (49, '9225a890-b55d-458c-869b-24057050d0ee', NULL, '办公器材49', '2020年新购置办公设备、电脑设备49', 49000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (50, '3074dc85-365b-43bd-8deb-30bcddc0876b', NULL, '办公器材50', '2020年新购置办公设备、电脑设备50', 50000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (51, '33123edb-bfd5-472c-94a5-eae8827f7c16', NULL, '办公器材51', '2020年新购置办公设备、电脑设备51', 51000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (52, 'c21d1eda-dbb3-40cd-b2a6-2819aaf921cc', NULL, '办公器材52', '2020年新购置办公设备、电脑设备52', 52000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (53, '60270b62-9e75-4413-b541-e24766dda628', NULL, '办公器材53', '2020年新购置办公设备、电脑设备53', 53000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (54, 'fcb185e2-ac54-4505-8edb-34139f09a26c', NULL, '办公器材54', '2020年新购置办公设备、电脑设备54', 54000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (55, 'b898a333-775d-45f9-a8c5-7d126e448e3f', NULL, '办公器材55', '2020年新购置办公设备、电脑设备55', 55000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (56, '9469b111-6682-4f82-9b1b-71362c889be9', NULL, '办公器材56', '2020年新购置办公设备、电脑设备56', 56000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (57, 'ac6e89ec-234f-471a-9daf-5ae91c98df11', NULL, '办公器材57', '2020年新购置办公设备、电脑设备57', 57000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (58, 'd44bbdcb-f55b-41e3-8432-c7815412992c', NULL, '办公器材58', '2020年新购置办公设备、电脑设备58', 58000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (59, '2e519b03-d342-47a1-8010-307f247edaeb', NULL, '办公器材59', '2020年新购置办公设备、电脑设备59', 59000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (60, 'f459f53c-8864-46d1-8f77-194d55b3241e', NULL, '办公器材60', '2020年新购置办公设备、电脑设备60', 60000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (61, 'f80ecbb2-f7a5-4873-8b49-6cdabc552a94', NULL, '办公器材61', '2020年新购置办公设备、电脑设备61', 61000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (62, '37f44c46-42f1-4483-b296-1458342ea3da', NULL, '办公器材62', '2020年新购置办公设备、电脑设备62', 62000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (63, '707b1f25-51e9-4f2b-a4c0-eaa017fa7fc5', NULL, '办公器材63', '2020年新购置办公设备、电脑设备63', 63000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (64, 'beed752b-91a5-46fc-8def-7074c26eb6ea', NULL, '办公器材64', '2020年新购置办公设备、电脑设备64', 64000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (65, '40f16b89-2ab5-42f8-889d-6bdf5dd53e62', NULL, '办公器材65', '2020年新购置办公设备、电脑设备65', 65000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (66, '09b7d1c5-d7ed-4a23-acb9-53dcf9b46dda', NULL, '办公器材66', '2020年新购置办公设备、电脑设备66', 66000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (67, 'a0508b65-f90b-435c-bcd7-098732cf2eaa', NULL, '办公器材67', '2020年新购置办公设备、电脑设备67', 67000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (68, '559f1a73-8b13-444f-aa3c-ae908e114534', NULL, '办公器材68', '2020年新购置办公设备、电脑设备68', 68000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (69, 'dbb87519-b0b6-4708-92af-ad7dd5e3fc10', NULL, '办公器材69', '2020年新购置办公设备、电脑设备69', 69000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (70, '396b4b1c-7f43-4c5a-aa0d-10d90bbd55d7', NULL, '办公器材70', '2020年新购置办公设备、电脑设备70', 70000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (71, 'e221bb8a-583d-4bba-a0d3-6be08a0c3454', NULL, '办公器材1', '2020年新购置办公设备、电脑设备1', 1000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (72, '3bac031f-a028-497c-8ee7-7c91c85a0eb4', NULL, '办公器材2', '2020年新购置办公设备、电脑设备2', 2000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (73, '7b3d8e37-ffbd-49c7-bf1a-c63967310b9a', NULL, '办公器材3', '2020年新购置办公设备、电脑设备3', 3000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (74, '7c99fdf0-59b9-4468-a6ce-3316032fe480', NULL, '办公器材4', '2020年新购置办公设备、电脑设备4', 4000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (75, '1ed2eddf-e418-4467-a073-e639dd9425e3', NULL, '办公器材5', '2020年新购置办公设备、电脑设备5', 5000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (76, '7ebbace6-6cde-4a34-bbee-ce410a328841', NULL, '办公器材6', '2020年新购置办公设备、电脑设备6', 6000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (77, '9cb43813-bef3-425d-8e4e-dc5d3395e712', NULL, '办公器材7', '2020年新购置办公设备、电脑设备7', 7000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (78, '6e3f2d04-49be-48de-9bbf-2f1138f7aaac', NULL, '办公器材8', '2020年新购置办公设备、电脑设备8', 8000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (79, '18fb8331-8434-4796-996d-70b581e76696', NULL, '办公器材9', '2020年新购置办公设备、电脑设备9', 9000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (80, '7fe612ab-6a6e-498f-a8ed-9766575e9967', NULL, '办公器材10', '2020年新购置办公设备、电脑设备10', 10000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (81, '9afb3fcb-a855-4877-bcf5-3923b70d27e7', NULL, '办公器材11', '2020年新购置办公设备、电脑设备11', 11000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (82, 'fa857c0e-c648-4c64-aa63-ceb5add64894', NULL, '办公器材12', '2020年新购置办公设备、电脑设备12', 12000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (83, 'd0476b00-8166-4264-b444-91aa442dfacc', NULL, '办公器材13', '2020年新购置办公设备、电脑设备13', 13000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (84, '4e90f47a-d165-4234-ad9d-a60ea7cd40c2', NULL, '办公器材14', '2020年新购置办公设备、电脑设备14', 14000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (85, 'e11a201c-15d3-4919-b804-33ee53c852ad', NULL, '办公器材15', '2020年新购置办公设备、电脑设备15', 15000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (86, 'a5389ed2-1823-464e-8caa-45559369bc7e', NULL, '办公器材16', '2020年新购置办公设备、电脑设备16', 16000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (87, 'bf2e3300-523b-4e6b-b4ac-cb4c30edba8d', NULL, '办公器材17', '2020年新购置办公设备、电脑设备17', 17000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (88, '08394d70-6626-4a17-9818-141d52c97ddc', NULL, '办公器材18', '2020年新购置办公设备、电脑设备18', 18000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (89, '57c0b135-0093-4d5c-9623-d64603415d89', NULL, '办公器材19', '2020年新购置办公设备、电脑设备19', 19000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (90, '815847f8-6972-465f-b4b4-2177d62ef60e', NULL, '办公器材20', '2020年新购置办公设备、电脑设备20', 20000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (91, 'bf1803fa-3bf5-4f67-aed6-431e0e271355', NULL, '办公器材21', '2020年新购置办公设备、电脑设备21', 21000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (92, '3e252000-fd0b-4342-824b-850a32ee18e0', NULL, '办公器材22', '2020年新购置办公设备、电脑设备22', 22000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (93, '989ba383-07e2-45e6-8c81-24501fe472f9', NULL, '办公器材23', '2020年新购置办公设备、电脑设备23', 23000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (94, '5492db3d-4ce4-4618-8e91-d89de607c688', NULL, '办公器材24', '2020年新购置办公设备、电脑设备24', 24000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (95, '85c1c9dc-7733-42dc-98a6-6a07f9a022c6', NULL, '办公器材25', '2020年新购置办公设备、电脑设备25', 25000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (96, '8df5e733-947a-40e4-839e-2b316e280cd9', NULL, '办公器材26', '2020年新购置办公设备、电脑设备26', 26000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (97, '2dcdec99-aabf-4b64-81e9-bb00dc549e5d', NULL, '办公器材27', '2020年新购置办公设备、电脑设备27', 27000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (98, '888c548a-8fe2-4d4f-a422-56cc45d4c14c', NULL, '办公器材28', '2020年新购置办公设备、电脑设备28', 28000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (99, '03bc128b-c346-4e97-a646-3f85f34f2b97', NULL, '办公器材29', '2020年新购置办公设备、电脑设备29', 29000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (100, 'd7f8bbc0-08fb-4cef-b01a-9018c699005e', NULL, '办公器材30', '2020年新购置办公设备、电脑设备30', 30000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (101, '1d216a3f-865b-4fa4-abb4-b4b6daa3d73f', NULL, '办公器材31', '2020年新购置办公设备、电脑设备31', 31000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (102, '6356c74f-43a8-48c2-953c-3b2e5cd75b2b', NULL, '办公器材32', '2020年新购置办公设备、电脑设备32', 32000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (103, '5cd9e3e2-1e9b-4704-88e7-510726bac596', NULL, '办公器材33', '2020年新购置办公设备、电脑设备33', 33000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (104, 'c664d9cf-223d-4bd0-81b0-6c4655237e18', NULL, '办公器材34', '2020年新购置办公设备、电脑设备34', 34000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (105, '35095916-1375-4312-8010-1d5685918f5f', NULL, '办公器材35', '2020年新购置办公设备、电脑设备35', 35000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (106, 'bd5eed24-7595-4964-a654-2301a16027fd', NULL, '办公器材36', '2020年新购置办公设备、电脑设备36', 36000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (107, 'aa3f7115-2623-427e-8844-7f2b43e7dda4', NULL, '办公器材37', '2020年新购置办公设备、电脑设备37', 37000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (108, '4a0693d3-7ff1-41f4-80e2-c7106d65a7f0', NULL, '办公器材38', '2020年新购置办公设备、电脑设备38', 38000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (109, '99033a61-03ff-4a30-aea4-05ba32002b7c', NULL, '办公器材39', '2020年新购置办公设备、电脑设备39', 39000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (110, 'e22c9d38-3a15-4897-aade-4e0c3cb38f01', NULL, '办公器材40', '2020年新购置办公设备、电脑设备40', 40000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (111, '6d65c271-5243-45a9-86d6-a06b63f68b2c', NULL, '办公器材41', '2020年新购置办公设备、电脑设备41', 41000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (112, '2264cd0d-09f4-428b-a4c6-3b6fabde620a', NULL, '办公器材42', '2020年新购置办公设备、电脑设备42', 42000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (113, 'd86a2b6f-bd23-4398-85b2-d5b723dfd1e2', NULL, '办公器材43', '2020年新购置办公设备、电脑设备43', 43000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (114, '430e25ad-8737-435c-8b66-9aa4ac4014ae', NULL, '办公器材44', '2020年新购置办公设备、电脑设备44', 44000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (115, '30db67ca-58dd-4e71-9abd-fe9226b8f9ec', NULL, '办公器材45', '2020年新购置办公设备、电脑设备45', 45000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (116, '5e587682-691c-476e-96f3-e7c31ea9b644', NULL, '办公器材46', '2020年新购置办公设备、电脑设备46', 46000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (117, '69f0226d-0456-459d-bdb8-f57b8d14d06e', NULL, '办公器材47', '2020年新购置办公设备、电脑设备47', 47000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (118, '618df6e7-8e2a-48ea-8093-437442caf53b', NULL, '办公器材48', '2020年新购置办公设备、电脑设备48', 48000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (119, '6da4c233-4b53-49d1-be2e-17674facce7a', NULL, '办公器材49', '2020年新购置办公设备、电脑设备49', 49000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (120, '53f35838-8cdf-4dd6-b248-c8d289859155', NULL, '办公器材50', '2020年新购置办公设备、电脑设备50', 50000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (121, '0235e934-efd5-4d59-8ef8-47e2e1b634c7', NULL, '办公器材51', '2020年新购置办公设备、电脑设备51', 51000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (122, '8fb3e002-da67-492c-a4f6-e6982dcd9d0f', NULL, '办公器材52', '2020年新购置办公设备、电脑设备52', 52000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (123, 'aae679b3-d5a9-4f1d-9ce2-dcad36b0446a', NULL, '办公器材53', '2020年新购置办公设备、电脑设备53', 53000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (124, '09adbaf2-8b89-4f18-af27-cff91877f43d', NULL, '办公器材54', '2020年新购置办公设备、电脑设备54', 54000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (125, 'a4f2354e-2398-4da6-9a53-ee612d4b51d3', NULL, '办公器材55', '2020年新购置办公设备、电脑设备55', 55000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (126, 'aa37eb85-2cd0-47b2-ae43-790ab8c928ce', NULL, '办公器材56', '2020年新购置办公设备、电脑设备56', 56000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (127, 'f9f4a150-0134-4dc1-8dae-3943e72a919c', NULL, '办公器材57', '2020年新购置办公设备、电脑设备57', 57000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (128, 'edb51ea1-9e1d-4581-98b0-4d443d61618a', NULL, '办公器材58', '2020年新购置办公设备、电脑设备58', 58000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (129, '06842727-b302-433a-aced-07ad3f1a2278', NULL, '办公器材59', '2020年新购置办公设备、电脑设备59', 59000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (130, '33f5afa4-2795-4e94-a4ac-86e982fc1b09', NULL, '办公器材60', '2020年新购置办公设备、电脑设备60', 60000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (131, '7a6d5cfc-4c2a-466f-b368-12787401607e', NULL, '办公器材61', '2020年新购置办公设备、电脑设备61', 61000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (132, 'b9e5b1e8-3bb9-4b24-8fd9-16878121085d', NULL, '办公器材62', '2020年新购置办公设备、电脑设备62', 62000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (133, '1c88456f-0c45-422a-9ade-8103df92ac2f', NULL, '办公器材63', '2020年新购置办公设备、电脑设备63', 63000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (134, 'a3884476-970d-4b69-a75a-9c401c018d1b', NULL, '办公器材64', '2020年新购置办公设备、电脑设备64', 64000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (135, '6dbded60-2b08-411f-b9d2-2ef4f8ba7782', NULL, '办公器材65', '2020年新购置办公设备、电脑设备65', 65000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (136, 'c8d91037-c876-410c-9402-ff2cd7237555', NULL, '办公器材66', '2020年新购置办公设备、电脑设备66', 66000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (137, '421ec9cb-8ed0-4231-9bab-d94f74926d6e', NULL, '办公器材67', '2020年新购置办公设备、电脑设备67', 67000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (138, '0539a198-fe5f-4620-b328-b24a3aeffe4a', NULL, '办公器材68', '2020年新购置办公设备、电脑设备68', 68000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (139, 'cf9463d9-cb12-4894-afc2-0ed3ab59a81d', NULL, '办公器材69', '2020年新购置办公设备、电脑设备69', 69000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (140, '3e802264-9caf-4507-b0e1-f9e9443b9903', NULL, '办公器材70', '2020年新购置办公设备、电脑设备70', 70000.00000000, 2, 2, NULL, '中山领航科技公司', NULL, NULL, NULL, NULL); +INSERT INTO `ticket` VALUES (141, '46217d91-b57b-4935-8299-891dafa39056', NULL, '办公器材1', '2020年新购置办公设备、电脑设备1rg2jp', 1000.00000000, 0, 1, NULL, '中山领航科技公司1u95a', NULL, '2022-05-18 14:21:35', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (142, 'e36e36db-27b5-4e6e-97e4-1c7bdf6bbf71', NULL, '办公器材2', '2020年新购置办公设备、电脑设备2vi5co', 2000.00000000, 0, 2, NULL, '中山领航科技公司2y141', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (143, '0f5a1f12-9788-4330-bc2d-30a381a9f3e6', NULL, '办公器材3', '2020年新购置办公设备、电脑设备3jdi4m', 3000.00000000, 0, 1, NULL, '中山领航科技公司3i868', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (144, 'e29be752-b553-44de-bc65-918764ac884f', NULL, '办公器材4', '2020年新购置办公设备、电脑设备4rt1mi', 4000.00000000, 0, 2, NULL, '中山领航科技公司4or7t', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (145, 'd62b8c6d-8cb9-4453-aa97-1a6e5de542d8', NULL, '办公器材5', '2020年新购置办公设备、电脑设备5gm8je', 5000.00000000, 0, 2, NULL, '中山领航科技公司5bbw6', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (146, '49b32a81-804c-4472-aebf-6279f4937564', NULL, '办公器材6', '2020年新购置办公设备、电脑设备66kv01', 6000.00000000, 0, 2, NULL, '中山领航科技公司6k3zb', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (147, '8efacbe0-3240-4ed6-bd2b-c4129d48d549', NULL, '办公器材7', '2020年新购置办公设备、电脑设备7bcvt6', 7000.00000000, 0, 1, NULL, '中山领航科技公司7x0hd', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (148, '59414ba7-b72f-4603-80ed-1b2eeb397edc', NULL, '办公器材8', '2020年新购置办公设备、电脑设备80flxv', 8000.00000000, 0, 1, NULL, '中山领航科技公司8dpt0', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (149, 'aba582d0-8daa-40db-a609-d94b9329ed41', NULL, '办公器材9', '2020年新购置办公设备、电脑设备9knejc', 9000.00000000, 0, 3, NULL, '中山领航科技公司92tqb', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (150, '6d69c295-a536-43c6-9268-f3a2afc573d3', NULL, '办公器材10', '2020年新购置办公设备、电脑设备105t1tr', 10000.00000000, 0, 3, NULL, '中山领航科技公司10d1lo', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (151, '0e4161d0-7cb2-4a67-b0a7-2be98010b7b4', NULL, '办公器材11', '2020年新购置办公设备、电脑设备111xlms', 11000.00000000, 0, 1, NULL, '中山领航科技公司11kuzc', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (152, '74e4b024-853c-48b5-8b75-aa9d126af2cb', NULL, '办公器材12', '2020年新购置办公设备、电脑设备12y1vn8', 12000.00000000, 0, 2, NULL, '中山领航科技公司127p84', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (153, 'c937b64f-80f8-41c0-91dc-6a1613270e74', NULL, '办公器材13', '2020年新购置办公设备、电脑设备13bw9c4', 13000.00000000, 0, 3, NULL, '中山领航科技公司13wlwb', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (154, '02df0b56-1e01-4513-8c82-664eda75a756', NULL, '办公器材14', '2020年新购置办公设备、电脑设备14elkq6', 14000.00000000, 0, 3, NULL, '中山领航科技公司14ulkn', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (155, '5bd7f806-1ed2-4eca-b3ad-20d13ae10155', NULL, '办公器材15', '2020年新购置办公设备、电脑设备15mwr23', 15000.00000000, 0, 2, NULL, '中山领航科技公司15shrv', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (156, '576ae214-de3b-4520-aa6c-e1c4b437384d', NULL, '办公器材16', '2020年新购置办公设备、电脑设备169elat', 16000.00000000, 0, 2, NULL, '中山领航科技公司1683ll', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:35'); +INSERT INTO `ticket` VALUES (157, 'ddb79787-7d8d-479f-8c76-94e587fc9f0c', NULL, '办公器材17', '2020年新购置办公设备、电脑设备1753m9u', 17000.00000000, 0, 2, NULL, '中山领航科技公司171t5j', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (158, '8809af40-2311-45b3-9330-366fcf546b78', NULL, '办公器材18', '2020年新购置办公设备、电脑设备18zvyly', 18000.00000000, 0, 1, NULL, '中山领航科技公司18gm2d', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (159, '91e46817-78ef-4150-a659-fab24e8822e5', NULL, '办公器材19', '2020年新购置办公设备、电脑设备19cbb27', 19000.00000000, 0, 3, NULL, '中山领航科技公司19nh9z', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (160, '2bbf6133-b4eb-465f-9bbe-2104f244020c', NULL, '办公器材20', '2020年新购置办公设备、电脑设备20vh15m', 20000.00000000, 0, 3, NULL, '中山领航科技公司20662y', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (161, '6752cca7-4a95-4765-962d-9d419b6d5721', NULL, '办公器材21', '2020年新购置办公设备、电脑设备21qdbkp', 21000.00000000, 0, 3, NULL, '中山领航科技公司217r4j', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (162, '22beffc0-8cfb-4df6-bf76-33cf1dcc593c', NULL, '办公器材22', '2020年新购置办公设备、电脑设备227cb7t', 22000.00000000, 0, 2, NULL, '中山领航科技公司22fpuj', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (163, '647e89b4-4c74-47f8-b48b-cd7139485ccc', NULL, '办公器材23', '2020年新购置办公设备、电脑设备2370mdc', 23000.00000000, 0, 3, NULL, '中山领航科技公司23joum', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (164, '636d4c2d-b15f-441a-81cd-4492e063a8a6', NULL, '办公器材24', '2020年新购置办公设备、电脑设备243ky3i', 24000.00000000, 0, 2, NULL, '中山领航科技公司2456bq', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (165, '773b343f-8af8-4dfd-82d7-4dd1a5942e5e', NULL, '办公器材25', '2020年新购置办公设备、电脑设备25or2hu', 25000.00000000, 0, 2, NULL, '中山领航科技公司25e92u', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (166, '4298a615-9d24-46ed-b9b4-e3e893b057a5', NULL, '办公器材26', '2020年新购置办公设备、电脑设备265rmr8', 26000.00000000, 0, 1, NULL, '中山领航科技公司26a98e', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (167, 'f85927a9-1bec-47df-9e4c-838732f6d160', NULL, '办公器材27', '2020年新购置办公设备、电脑设备27of5iq', 27000.00000000, 0, 3, NULL, '中山领航科技公司27j4ho', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (168, '117f3e65-57ca-4f18-912b-7e6682ae63d8', NULL, '办公器材28', '2020年新购置办公设备、电脑设备289wma2', 28000.00000000, 0, 1, NULL, '中山领航科技公司28yxcu', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (169, 'f0df6ed9-db06-4f0b-b1ea-6e10d753e1e1', NULL, '办公器材29', '2020年新购置办公设备、电脑设备29vea6v', 29000.00000000, 0, 1, NULL, '中山领航科技公司29jdfl', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (170, '7948a629-039e-43fb-a38d-9d86c6481d8a', NULL, '办公器材30', '2020年新购置办公设备、电脑设备30ol3bj', 30000.00000000, 0, 3, NULL, '中山领航科技公司30sboc', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (171, '3d8bcf42-6605-4dfe-9485-ae3b0db46e21', NULL, '办公器材31', '2020年新购置办公设备、电脑设备31x5ax4', 31000.00000000, 0, 1, NULL, '中山领航科技公司313aqm', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (172, '0c10b1cb-3fe2-45f6-9e5b-512064bdba57', NULL, '办公器材32', '2020年新购置办公设备、电脑设备326lbiv', 32000.00000000, 0, 1, NULL, '中山领航科技公司320gp2', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (173, '2e7247d7-1bf5-4e92-be8b-741702f393c1', NULL, '办公器材33', '2020年新购置办公设备、电脑设备33lvlf3', 33000.00000000, 0, 2, NULL, '中山领航科技公司33fgyy', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (174, '9c92f801-e2b9-4624-85dc-b8db18604b5a', NULL, '办公器材34', '2020年新购置办公设备、电脑设备34rp1rm', 34000.00000000, 0, 1, NULL, '中山领航科技公司3469kt', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (175, 'e0c97ac9-9113-4318-b3bd-706370145de5', NULL, '办公器材35', '2020年新购置办公设备、电脑设备35tdcr6', 35000.00000000, 0, 2, NULL, '中山领航科技公司35zwkj', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (176, 'f0e12cfc-5d79-4edf-9725-40314e5b1294', NULL, '办公器材36', '2020年新购置办公设备、电脑设备36vc5mz', 36000.00000000, 0, 1, NULL, '中山领航科技公司36ciq4', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (177, '638df300-77d1-42dc-9aa6-d4a5e32b3781', NULL, '办公器材37', '2020年新购置办公设备、电脑设备37kfzmd', 37000.00000000, 0, 1, NULL, '中山领航科技公司37qgyk', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (178, 'dd46d5f3-a45e-428e-9ae9-57f0ea516a79', NULL, '办公器材38', '2020年新购置办公设备、电脑设备388yoqm', 38000.00000000, 0, 1, NULL, '中山领航科技公司38syrc', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (179, '7fb12000-dd69-4b9a-bccc-12e9587e304b', NULL, '办公器材39', '2020年新购置办公设备、电脑设备39fja9f', 39000.00000000, 0, 3, NULL, '中山领航科技公司39poq5', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (180, 'bf6bcd20-ee8f-4488-b4d8-70ed08fd9004', NULL, '办公器材40', '2020年新购置办公设备、电脑设备40lt212', 40000.00000000, 0, 1, NULL, '中山领航科技公司40t6la', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (181, '052d95ab-c4c5-41d8-8d04-01f153da84d3', NULL, '办公器材41', '2020年新购置办公设备、电脑设备41h74d0', 41000.00000000, 0, 1, NULL, '中山领航科技公司41ufqf', NULL, '2022-05-18 14:21:36', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (182, '49af5bc7-8644-4116-a10e-42743a971752', NULL, '办公器材42', '2020年新购置办公设备、电脑设备421hhbo', 42000.00000000, 0, 2, NULL, '中山领航科技公司42ilxo', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (183, 'aa26d921-ae4c-4f7d-b7bd-b54db8e52b28', NULL, '办公器材43', '2020年新购置办公设备、电脑设备43kmamx', 43000.00000000, 0, 3, NULL, '中山领航科技公司43yg8t', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (184, '2ff751e6-a516-48c8-aac9-c32dcbf783cd', NULL, '办公器材44', '2020年新购置办公设备、电脑设备44q57sj', 44000.00000000, 0, 1, NULL, '中山领航科技公司448pnc', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (185, 'c4359227-9e42-4c8a-97ba-faf1e13605f1', NULL, '办公器材45', '2020年新购置办公设备、电脑设备45xvoar', 45000.00000000, 0, 1, NULL, '中山领航科技公司45zpz1', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (186, '8a2bccd6-f6a3-4c2b-b889-c4b7e117220c', NULL, '办公器材46', '2020年新购置办公设备、电脑设备469qz1t', 46000.00000000, 0, 1, NULL, '中山领航科技公司469rvv', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (187, 'c9fb3fa2-5d02-4f71-a6da-09f3ebf36659', NULL, '办公器材47', '2020年新购置办公设备、电脑设备47t2jq7', 47000.00000000, 0, 1, NULL, '中山领航科技公司47t7w6', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (188, '4d5cebbf-e9b9-4ba0-8771-8e61e2ed502c', NULL, '办公器材48', '2020年新购置办公设备、电脑设备48c793y', 48000.00000000, 0, 2, NULL, '中山领航科技公司48f7nf', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (189, 'e6cfb34c-67eb-4594-bc40-980727257fb8', NULL, '办公器材49', '2020年新购置办公设备、电脑设备490iuth', 49000.00000000, 0, 2, NULL, '中山领航科技公司49gsgf', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (190, '10550062-6d27-4a70-9140-c43c989df019', NULL, '办公器材50', '2020年新购置办公设备、电脑设备50q149t', 50000.00000000, 0, 3, NULL, '中山领航科技公司50lypl', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (191, '7a838307-f0ca-4fa1-a74e-cb8d92afb034', NULL, '办公器材51', '2020年新购置办公设备、电脑设备51229zg', 51000.00000000, 0, 1, NULL, '中山领航科技公司51slct', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (192, 'de1de110-51d5-4aa2-88ce-bb2eb0a20e66', NULL, '办公器材52', '2020年新购置办公设备、电脑设备5257rt6', 52000.00000000, 0, 2, NULL, '中山领航科技公司52n37v', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (193, '71e67eba-2422-44d7-98a8-0e2c79d115b2', NULL, '办公器材53', '2020年新购置办公设备、电脑设备53ifezm', 53000.00000000, 0, 1, NULL, '中山领航科技公司53faxn', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (194, 'ca684133-6dc5-48a2-9204-e63cdc10abc3', NULL, '办公器材54', '2020年新购置办公设备、电脑设备54i1bv5', 54000.00000000, 0, 3, NULL, '中山领航科技公司54viw2', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (195, '104c2fec-efa5-42dd-84c0-e65ef07dc024', NULL, '办公器材55', '2020年新购置办公设备、电脑设备558n4pb', 55000.00000000, 0, 3, NULL, '中山领航科技公司554qjp', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (196, 'e6ec1135-5509-4c69-9395-d6efe6c52619', NULL, '办公器材56', '2020年新购置办公设备、电脑设备56gmbow', 56000.00000000, 0, 1, NULL, '中山领航科技公司56zsxm', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (197, '4c16cbac-a95d-4ae7-9a71-7a8de86e2681', NULL, '办公器材57', '2020年新购置办公设备、电脑设备575yetp', 57000.00000000, 0, 3, NULL, '中山领航科技公司57ia84', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (198, '9de0b485-e531-4ad8-98f0-17a983c1fc50', NULL, '办公器材58', '2020年新购置办公设备、电脑设备581n5ay', 58000.00000000, 0, 1, NULL, '中山领航科技公司58qa13', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (199, 'b2a9e902-2cf8-458b-a890-bbea6da62503', NULL, '办公器材59', '2020年新购置办公设备、电脑设备5966ns3', 59000.00000000, 0, 2, NULL, '中山领航科技公司59mlto', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (200, 'a663d3cb-4670-4b65-8bf0-c897c85a701d', NULL, '办公器材60', '2020年新购置办公设备、电脑设备60edo8r', 60000.00000000, 0, 3, NULL, '中山领航科技公司60kmzh', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (201, 'e6fb356f-151f-40bc-991f-741f87b148a5', NULL, '办公器材61', '2020年新购置办公设备、电脑设备61d34ic', 61000.00000000, 0, 2, NULL, '中山领航科技公司61hvan', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (202, 'b1718d34-bc49-42a1-af91-56b72176733f', NULL, '办公器材62', '2020年新购置办公设备、电脑设备6202ley', 62000.00000000, 0, 3, NULL, '中山领航科技公司628cm4', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (203, '532e6d67-d40b-4e23-a9a7-f39b2709da9f', NULL, '办公器材63', '2020年新购置办公设备、电脑设备632b2t1', 63000.00000000, 0, 1, NULL, '中山领航科技公司63x77w', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (204, 'ece5ce7a-c9e4-41fc-afae-fc3b3e144643', NULL, '办公器材64', '2020年新购置办公设备、电脑设备64bp178', 64000.00000000, 0, 1, NULL, '中山领航科技公司649ax9', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (205, 'a1e47ab3-5145-42aa-83e2-34e1fa39e85e', NULL, '办公器材65', '2020年新购置办公设备、电脑设备65lqkr8', 65000.00000000, 0, 3, NULL, '中山领航科技公司65eo1n', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:36'); +INSERT INTO `ticket` VALUES (206, '0f4f8997-81ff-4e04-b2b2-c328c93c30ac', NULL, '办公器材66', '2020年新购置办公设备、电脑设备66de07r', 66000.00000000, 0, 2, NULL, '中山领航科技公司66eznp', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:37'); +INSERT INTO `ticket` VALUES (207, '2692bb03-5f41-4a8b-880e-ae05969a444b', NULL, '办公器材67', '2020年新购置办公设备、电脑设备67j7z2v', 67000.00000000, 0, 3, NULL, '中山领航科技公司6797q0', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:37'); +INSERT INTO `ticket` VALUES (208, '6ddaea47-8d0b-44a5-9fe4-a2e123e143d5', NULL, '办公器材68', '2020年新购置办公设备、电脑设备68xsc36', 68000.00000000, 0, 3, NULL, '中山领航科技公司68mw32', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:37'); +INSERT INTO `ticket` VALUES (209, '8c94e6b3-cbbe-4d28-a6e8-30acf19186ef', NULL, '办公器材69', '2020年新购置办公设备、电脑设备69p3i2n', 69000.00000000, 0, 2, NULL, '中山领航科技公司69l3y8', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:37'); +INSERT INTO `ticket` VALUES (210, 'f772fd30-c7e8-4687-892a-715535e0d097', NULL, '办公器材70', '2020年新购置办公设备、电脑设备70p716y', 70000.00000000, 0, 1, NULL, '中山领航科技公司70v55f', NULL, '2022-05-18 14:21:37', NULL, '2022-05-18 14:21:37'); +INSERT INTO `ticket` VALUES (211, 'b9510858-4b74-4bea-9170-44d025e2635e', NULL, '办公器材1', '2020年新购置办公设备、电脑设备1ffscb', 1000.00000000, 0, 1, NULL, '中山领航科技公司13sfg', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:26'); +INSERT INTO `ticket` VALUES (212, '29f89f7e-3d18-468a-a53f-fd30d5aeb3b4', NULL, '办公器材2', '2020年新购置办公设备、电脑设备2x5yvh', 2000.00000000, 0, 1, NULL, '中山领航科技公司2sg8d', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (213, '81a01f82-a97d-463a-a468-4ec117719d11', NULL, '办公器材3', '2020年新购置办公设备、电脑设备3zkvi5', 3000.00000000, 0, 2, NULL, '中山领航科技公司3viyn', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (214, '5e0a842d-083f-430b-9c65-af5b22680991', NULL, '办公器材4', '2020年新购置办公设备、电脑设备4n8jfb', 4000.00000000, 0, 3, NULL, '中山领航科技公司44cqb', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (215, '8269ccc7-17d4-4b1d-9580-2bf91911f791', NULL, '办公器材5', '2020年新购置办公设备、电脑设备55uo47', 5000.00000000, 0, 2, NULL, '中山领航科技公司5ah6f', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (216, '8d324b70-f3a2-4623-944f-851790c029ef', NULL, '办公器材6', '2020年新购置办公设备、电脑设备64si04', 6000.00000000, 0, 2, NULL, '中山领航科技公司6az86', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (217, 'd8e39e8a-de8b-4834-a8b5-5b0f16955649', NULL, '办公器材7', '2020年新购置办公设备、电脑设备7xociw', 7000.00000000, 0, 3, NULL, '中山领航科技公司7brrs', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (218, 'a105aa7e-90c7-459e-9bfc-bf5eb17978a2', NULL, '办公器材8', '2020年新购置办公设备、电脑设备8h6hi5', 8000.00000000, 0, 1, NULL, '中山领航科技公司8iq28', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (219, '21f768f5-862a-4064-a37a-30d30038b492', NULL, '办公器材9', '2020年新购置办公设备、电脑设备966ou8', 9000.00000000, 0, 1, NULL, '中山领航科技公司9uymj', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (220, 'b82c3b4f-cffe-40e0-9359-8154f03d429a', NULL, '办公器材10', '2020年新购置办公设备、电脑设备105epmw', 10000.00000000, 0, 2, NULL, '中山领航科技公司10anwt', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (221, '0c2b22ce-ba46-48d5-9697-dcb3815a21e5', NULL, '办公器材11', '2020年新购置办公设备、电脑设备11ql2rt', 11000.00000000, 0, 1, NULL, '中山领航科技公司112df3', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (222, 'd5266309-37be-442e-8f8a-0b5ae70c5e01', NULL, '办公器材12', '2020年新购置办公设备、电脑设备12yz1nw', 12000.00000000, 0, 2, NULL, '中山领航科技公司12tj24', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (223, 'a88d0c04-4d16-4735-bb21-ed501deafca9', NULL, '办公器材13', '2020年新购置办公设备、电脑设备13kmk0l', 13000.00000000, 0, 1, NULL, '中山领航科技公司13w4m6', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (224, '934b0eb8-e597-42c1-94a9-bcea37addb7c', NULL, '办公器材14', '2020年新购置办公设备、电脑设备145m8rz', 14000.00000000, 0, 3, NULL, '中山领航科技公司141cif', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (225, '6658d85a-4ae7-4b9c-81dc-4fc1e94f0cef', NULL, '办公器材15', '2020年新购置办公设备、电脑设备153fdxh', 15000.00000000, 0, 3, NULL, '中山领航科技公司15adm0', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (226, '3aac958a-497b-49d4-bd53-18e6a4737fd7', NULL, '办公器材16', '2020年新购置办公设备、电脑设备16jk0z1', 16000.00000000, 0, 1, NULL, '中山领航科技公司16yw1y', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (227, '952debb0-8aa7-4e7a-84e8-13449b75e3ba', NULL, '办公器材17', '2020年新购置办公设备、电脑设备17rajse', 17000.00000000, 0, 3, NULL, '中山领航科技公司172c4m', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (228, 'cd063e57-8846-456f-b93e-e5ff23a6f6de', NULL, '办公器材18', '2020年新购置办公设备、电脑设备184baub', 18000.00000000, 0, 1, NULL, '中山领航科技公司18ku6j', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (229, '5a0ac86b-4f8c-464b-9968-fdffb1ca08d0', NULL, '办公器材19', '2020年新购置办公设备、电脑设备19a4jih', 19000.00000000, 0, 2, NULL, '中山领航科技公司19p3d8', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (230, '1d04ccb4-fd84-4a16-a569-97948ab17d67', NULL, '办公器材20', '2020年新购置办公设备、电脑设备20kqvx5', 20000.00000000, 0, 2, NULL, '中山领航科技公司20snpl', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (231, 'deff420c-e419-4791-9bb1-11e46656707a', NULL, '办公器材21', '2020年新购置办公设备、电脑设备21g16rc', 21000.00000000, 0, 1, NULL, '中山领航科技公司21vsae', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (232, 'c6b758a1-5341-40e2-857c-bcee1863e286', NULL, '办公器材22', '2020年新购置办公设备、电脑设备224iawi', 22000.00000000, 0, 2, NULL, '中山领航科技公司22n9lk', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (233, '28053e6d-d9ee-406b-b54c-6a4d71a69608', NULL, '办公器材23', '2020年新购置办公设备、电脑设备23thiec', 23000.00000000, 0, 2, NULL, '中山领航科技公司237br4', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (234, '1da520d6-79c9-4a11-abee-0b9951052554', NULL, '办公器材24', '2020年新购置办公设备、电脑设备243vjtv', 24000.00000000, 0, 1, NULL, '中山领航科技公司24fhuh', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (235, '5cf6d6d6-a036-41b2-b5b9-2d981c293594', NULL, '办公器材25', '2020年新购置办公设备、电脑设备25q4i47', 25000.00000000, 0, 1, NULL, '中山领航科技公司258dio', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (236, 'd6c09574-b510-4262-8ea0-e211bcb2275d', NULL, '办公器材26', '2020年新购置办公设备、电脑设备26dzez1', 26000.00000000, 0, 1, NULL, '中山领航科技公司26ssqp', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (237, 'e9b1d801-d0ea-4ad1-8fac-410111dfcf6f', NULL, '办公器材27', '2020年新购置办公设备、电脑设备272i8a8', 27000.00000000, 0, 1, NULL, '中山领航科技公司273kc7', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (238, '4e3be186-2d08-4f88-9172-ce062d99ca03', NULL, '办公器材28', '2020年新购置办公设备、电脑设备285ptp6', 28000.00000000, 0, 2, NULL, '中山领航科技公司287jvc', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (239, 'fc7cf339-91a8-426d-b7e7-998224df1ac5', NULL, '办公器材29', '2020年新购置办公设备、电脑设备29ac8nj', 29000.00000000, 0, 3, NULL, '中山领航科技公司29sl2h', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (240, '98d9530b-bd3d-4c6f-b102-3070c911329b', NULL, '办公器材30', '2020年新购置办公设备、电脑设备3004sqj', 30000.00000000, 0, 1, NULL, '中山领航科技公司30pqid', NULL, '2022-05-18 14:22:27', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (241, '09bf8026-2175-49ab-b42c-d09a2a25e6b7', NULL, '办公器材31', '2020年新购置办公设备、电脑设备313phzg', 31000.00000000, 0, 2, NULL, '中山领航科技公司31g3w9', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (242, '911f650b-290f-40e7-975a-a2f41ed24317', NULL, '办公器材32', '2020年新购置办公设备、电脑设备32m7776', 32000.00000000, 0, 1, NULL, '中山领航科技公司326nh0', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (243, '4e7ac569-ed8d-491b-8460-fbd4a641e713', NULL, '办公器材33', '2020年新购置办公设备、电脑设备33bvij2', 33000.00000000, 0, 1, NULL, '中山领航科技公司33vir3', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (244, 'b0f896ec-8a44-4070-ba8f-27cb6de246c9', NULL, '办公器材34', '2020年新购置办公设备、电脑设备347petb', 34000.00000000, 0, 3, NULL, '中山领航科技公司34jd1b', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (245, 'c095470f-2994-4d28-89eb-a45d620030a1', NULL, '办公器材35', '2020年新购置办公设备、电脑设备35d5u9t', 35000.00000000, 0, 2, NULL, '中山领航科技公司351pri', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (246, '33b1e73a-3c85-4b96-9cec-3aec38da8bfa', NULL, '办公器材36', '2020年新购置办公设备、电脑设备36t63f7', 36000.00000000, 0, 1, NULL, '中山领航科技公司362pgl', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (247, 'fffca2a8-c17d-4add-a199-9e110d994a1a', NULL, '办公器材37', '2020年新购置办公设备、电脑设备37o8j3o', 37000.00000000, 0, 2, NULL, '中山领航科技公司372mmj', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (248, 'ff92bdf2-c65e-420d-bd27-8d5e8f5d9194', NULL, '办公器材38', '2020年新购置办公设备、电脑设备38otw1v', 38000.00000000, 0, 3, NULL, '中山领航科技公司38us0j', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (249, '887f4d06-d991-4b3d-9cb4-cf1eedad0f68', NULL, '办公器材39', '2020年新购置办公设备、电脑设备393yk15', 39000.00000000, 0, 1, NULL, '中山领航科技公司39sl2w', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (250, '4ff74457-41c5-4722-9476-2ca6aa283114', NULL, '办公器材40', '2020年新购置办公设备、电脑设备40pj6md', 40000.00000000, 0, 1, NULL, '中山领航科技公司40atro', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (251, 'f104f1bd-4bcf-4a5e-b47e-95650a6fe2b3', NULL, '办公器材41', '2020年新购置办公设备、电脑设备41fx9j3', 41000.00000000, 0, 1, NULL, '中山领航科技公司41aojk', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (252, '48294a4d-cd8e-44ef-83d5-77ccfa886ffd', NULL, '办公器材42', '2020年新购置办公设备、电脑设备42f9r0p', 42000.00000000, 0, 2, NULL, '中山领航科技公司42jutg', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (253, '956ace3a-ec9d-46e7-a15e-a7f0bd8e06f1', NULL, '办公器材43', '2020年新购置办公设备、电脑设备437auqe', 43000.00000000, 0, 2, NULL, '中山领航科技公司43h8kf', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (254, '7071e4bd-6200-4ee6-9050-29c103e38aca', NULL, '办公器材44', '2020年新购置办公设备、电脑设备44xi7cz', 44000.00000000, 0, 1, NULL, '中山领航科技公司44j9ju', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (255, '7c906ebe-2f60-4c8b-9eaa-0fe0cd87823d', NULL, '办公器材45', '2020年新购置办公设备、电脑设备454xy31', 45000.00000000, 0, 2, NULL, '中山领航科技公司454xos', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (256, '28bc65ea-91d0-4c15-9384-1dc7844c42f6', NULL, '办公器材46', '2020年新购置办公设备、电脑设备46mt3cd', 46000.00000000, 0, 3, NULL, '中山领航科技公司4698jf', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (257, 'bf16e448-cb40-45ad-998b-3e8bacb374d2', NULL, '办公器材47', '2020年新购置办公设备、电脑设备47lxctv', 47000.00000000, 0, 1, NULL, '中山领航科技公司47lo8y', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (258, '57a693cd-d460-47af-a32b-4521ecb5e648', NULL, '办公器材48', '2020年新购置办公设备、电脑设备481kxph', 48000.00000000, 0, 2, NULL, '中山领航科技公司48q3fr', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (259, '756e15cb-44c8-429f-a505-611100d4bf98', NULL, '办公器材49', '2020年新购置办公设备、电脑设备49qiqg8', 49000.00000000, 0, 3, NULL, '中山领航科技公司49o57s', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (260, 'c5312981-96f5-4e44-a5ff-e9cd20cd4142', NULL, '办公器材50', '2020年新购置办公设备、电脑设备50sbd9k', 50000.00000000, 0, 3, NULL, '中山领航科技公司50kqaf', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (261, '03a07876-e5ce-405a-8461-e226f85dd691', NULL, '办公器材51', '2020年新购置办公设备、电脑设备51xnbc5', 51000.00000000, 0, 2, NULL, '中山领航科技公司512s39', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (262, 'd23f56cd-9c16-4631-86e2-cb23e15619fb', NULL, '办公器材52', '2020年新购置办公设备、电脑设备52kyaxa', 52000.00000000, 0, 3, NULL, '中山领航科技公司52rlxu', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (263, '4f0fd292-133e-4c39-b927-7c98fd1f9591', NULL, '办公器材53', '2020年新购置办公设备、电脑设备537cejj', 53000.00000000, 0, 1, NULL, '中山领航科技公司53ny90', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (264, '197055ab-c761-4867-a3a3-1ee29c5f37cc', NULL, '办公器材54', '2020年新购置办公设备、电脑设备54ads8o', 54000.00000000, 0, 3, NULL, '中山领航科技公司547zzs', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (265, 'b67b2c05-528f-4ca6-9587-39c0cdd1a5f7', NULL, '办公器材55', '2020年新购置办公设备、电脑设备55xwkv1', 55000.00000000, 0, 2, NULL, '中山领航科技公司553l2h', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (266, 'fdea9507-7527-47be-9a7a-f9ebf853ac3a', NULL, '办公器材56', '2020年新购置办公设备、电脑设备56f5tn0', 56000.00000000, 0, 1, NULL, '中山领航科技公司56d0sh', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (267, 'f0739044-ebb4-40e7-ae35-3ab5f6e3512a', NULL, '办公器材57', '2020年新购置办公设备、电脑设备57ej4p8', 57000.00000000, 0, 1, NULL, '中山领航科技公司572il9', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (268, '6141cc1e-9394-46c7-970e-fd3a83c989a7', NULL, '办公器材58', '2020年新购置办公设备、电脑设备581wzw3', 58000.00000000, 0, 1, NULL, '中山领航科技公司585kl2', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (269, 'e01248a8-ec6b-498a-ba2c-88997d231a72', NULL, '办公器材59', '2020年新购置办公设备、电脑设备59e12gg', 59000.00000000, 0, 3, NULL, '中山领航科技公司59l4hl', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (270, '73165a08-4dae-425f-995d-96f2db67ce2e', NULL, '办公器材60', '2020年新购置办公设备、电脑设备604rlui', 60000.00000000, 0, 3, NULL, '中山领航科技公司604eva', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (271, 'b187df88-e6e0-4267-8447-e4a831256c37', NULL, '办公器材61', '2020年新购置办公设备、电脑设备61hjv84', 61000.00000000, 0, 3, NULL, '中山领航科技公司61n1pw', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (272, '3a6f862e-2bfd-4d0d-aa01-56ae17056d2c', NULL, '办公器材62', '2020年新购置办公设备、电脑设备62uxylo', 62000.00000000, 0, 2, NULL, '中山领航科技公司62h83z', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (273, '544c066c-302a-46c1-96ba-987aac04c8ef', NULL, '办公器材63', '2020年新购置办公设备、电脑设备63hqmyl', 63000.00000000, 0, 3, NULL, '中山领航科技公司63p89t', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (274, '425af4a4-8b80-4da4-8af1-6f0c4ae411b6', NULL, '办公器材64', '2020年新购置办公设备、电脑设备643rtc2', 64000.00000000, 0, 1, NULL, '中山领航科技公司64g120', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (275, 'b12d1fc6-624a-4b88-8c49-c42b8639484f', NULL, '办公器材65', '2020年新购置办公设备、电脑设备65d5h55', 65000.00000000, 0, 3, NULL, '中山领航科技公司654lnh', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (276, '1abbbba4-24ed-456f-8653-245219a66d1a', NULL, '办公器材66', '2020年新购置办公设备、电脑设备66fiqm6', 66000.00000000, 0, 1, NULL, '中山领航科技公司669ksr', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (277, 'e5ba6ed0-4030-4e54-b1ba-0110d5cc2003', NULL, '办公器材67', '2020年新购置办公设备、电脑设备6714ef0', 67000.00000000, 0, 3, NULL, '中山领航科技公司671hwv', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (278, '8341684a-a879-4fdf-9251-7b388ef2c011', NULL, '办公器材68', '2020年新购置办公设备、电脑设备680chwf', 68000.00000000, 0, 3, NULL, '中山领航科技公司680zgt', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (279, '15867ef1-edd5-4046-b94a-038e0aa106f7', NULL, '办公器材69', '2020年新购置办公设备、电脑设备69g4nzl', 69000.00000000, 0, 1, NULL, '中山领航科技公司69bf6o', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (280, '86ec5ff3-299d-44e8-a77a-89aa92cecb20', NULL, '办公器材70', '2020年新购置办公设备、电脑设备7018axe', 70000.00000000, 0, 3, NULL, '中山领航科技公司707vom', NULL, '2022-05-18 14:22:28', NULL, '2022-05-18 14:22:27'); +INSERT INTO `ticket` VALUES (281, '616fbfd68d174262af7715baa0d79419', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2022-05-20 10:02:43', NULL, '2022-05-20 10:02:43'); +INSERT INTO `ticket` VALUES (282, 'a1be84e2b33a494e8f881dbc5724eb5a', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2022-05-20 10:06:06', NULL, '2022-05-20 10:06:06'); +INSERT INTO `ticket` VALUES (283, '8aec9e472a204919832a9c58bd0da160', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2022-05-20 10:12:20', NULL, '2022-05-20 10:12:20'); +INSERT INTO `ticket` VALUES (284, '9242b5b044ef4568bd62936f0d1f6d2a', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2022-05-20 10:16:54', NULL, '2022-05-20 10:16:54'); +INSERT INTO `ticket` VALUES (285, '2efa122762be48758dad9da431c133ce', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2022-05-20 10:17:28', NULL, '2022-05-20 10:17:28'); +INSERT INTO `ticket` VALUES (286, '5381f174c284467db7ee1b6f9b550774', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2022-05-20 10:18:42', NULL, '2022-05-20 10:18:42'); +INSERT INTO `ticket` VALUES (287, 'd50059bae7d741a191fff90abe132297', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2022-05-20 10:25:57', NULL, '2022-05-20 10:25:57'); +INSERT INTO `ticket` VALUES (288, 'a8f89d3e48144e26b6c1cbbee2a160a6', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, '2022-05-20 17:04:37', NULL, '2022-05-20 17:04:37'); +INSERT INTO `ticket` VALUES (289, 'ba667266252549ebae0f8ec83afc24ec', NULL, '测试票据标题1', '默认测试内容;购买办公用品、办公椅、书柜书架1批,清单共20项..', 9999.00000000, 2, 1, 'test@company.com', '测试票据公司1', NULL, '2022-06-12 23:28:20', NULL, '2022-06-12 23:28:20'); +INSERT INTO `ticket` VALUES (290, '3287d95e518442e58659bf2277b5f60f', NULL, '测试票据标题1', '默认测试内容;购买办公用品、办公椅、书柜书架1批,清单共20项..', 9999.00000000, 2, 1, 'test@company.com', '测试票据公司1', NULL, '2022-06-12 23:29:43', NULL, '2022-06-12 23:29:43'); +INSERT INTO `ticket` VALUES (291, '26691137da574a388d79590c12b28cae', NULL, '测试票据标题1', '默认测试内容;购买办公用品、办公椅、书柜书架1批,清单共20项..', 9999.00000000, 4, 1, 'test@company.com', '测试票据公司1', NULL, '2022-06-12 23:31:01', NULL, '2022-06-13 00:05:29'); +INSERT INTO `ticket` VALUES (292, 'fbc92dbf7245405ab6cfbfdadfef8a21', NULL, '测试票据标题12222', '默认测试内容;购买办公用品、办公椅、书柜书架1批,清单共20项..', 9999.00000000, 3, 1, 'test@company.com', '测试票据公司1', NULL, '2022-06-12 23:34:11', NULL, '2022-06-13 00:05:21'); +INSERT INTO `ticket` VALUES (293, '326d4b6c47754fff871ac8c68ec1c103', NULL, '测试票据标题100-2022', '默认测试内容;购买办公用品、办公椅、书柜书架1批,清单共20项..', 9999.00000000, 3, 1, 'test@company.com', '432432432', NULL, '2022-06-12 23:34:51', NULL, '2022-06-13 00:04:43'); +INSERT INTO `ticket` VALUES (294, '00161b50de994c54ab42823234375a77', NULL, '测试票据标题1', '默认测试内容;购买办公用品、办公椅、书柜书架1批,清单共20项..', 9999.00000000, 2, 1, 'test@company.com', '测试票据公司1', NULL, '2022-06-12 23:35:07', NULL, '2022-06-12 23:35:07'); + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/main/resources/mailTemplate/mailtemplate.ftl b/src/main/resources/mailTemplate/mailtemplate.ftl new file mode 100644 index 0000000..12307d9 --- /dev/null +++ b/src/main/resources/mailTemplate/mailtemplate.ftl @@ -0,0 +1,61 @@ + + + + + + + + + + +
+ + + + + + + + + +
+ 验证码 +
+
+ +

+ + + 尊敬的用户: + +

+ +

您好!感谢您使用票据管理系统,您的账号正在进行邮箱验证,验证码为:{0},有效期1分钟,请尽快填写验证码完成验证!


+ +

+ + + Dear user: + +

+

Hello! Thanks for using Ticket system, your account is being authenticated by email, the + verification code is:{0}, valid for 1 minutes. Please fill in the verification code as soon as + possible!

+
+
+ +
+

此为系统邮件,请勿回复
+ Please do not reply to this system email +

+ +
+
+
+
+
+ + + diff --git a/src/main/resources/mappers/AuthorityMapper.xml b/src/main/resources/mappers/AuthorityMapper.xml new file mode 100644 index 0000000..b8856f3 --- /dev/null +++ b/src/main/resources/mappers/AuthorityMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/DeptMapper.xml b/src/main/resources/mappers/DeptMapper.xml new file mode 100644 index 0000000..f1a3d6c --- /dev/null +++ b/src/main/resources/mappers/DeptMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mappers/RoleAuthoritiesReposity.xml b/src/main/resources/mappers/RoleAuthoritiesReposity.xml new file mode 100644 index 0000000..d47228b --- /dev/null +++ b/src/main/resources/mappers/RoleAuthoritiesReposity.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/RoleMapper.xml b/src/main/resources/mappers/RoleMapper.xml new file mode 100644 index 0000000..bf013c0 --- /dev/null +++ b/src/main/resources/mappers/RoleMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mappers/UserMapper.xml b/src/main/resources/mappers/UserMapper.xml new file mode 100644 index 0000000..904519a --- /dev/null +++ b/src/main/resources/mappers/UserMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, username, password, email, phone, create_time + + + + + + + diff --git a/src/main/resources/static/72c789ad-9a8e-47ff-8841-62392bf60e5c.png b/src/main/resources/static/72c789ad-9a8e-47ff-8841-62392bf60e5c.png new file mode 100644 index 0000000..1d208d1 Binary files /dev/null and b/src/main/resources/static/72c789ad-9a8e-47ff-8841-62392bf60e5c.png differ diff --git a/src/main/resources/static/7497edfe-71d6-4b1d-ac2c-662949d22b15.png b/src/main/resources/static/7497edfe-71d6-4b1d-ac2c-662949d22b15.png new file mode 100644 index 0000000..de47baf Binary files /dev/null and b/src/main/resources/static/7497edfe-71d6-4b1d-ac2c-662949d22b15.png differ diff --git a/src/main/resources/static/8eb36c39-77b3-4ad2-9624-132b68017b3c.png b/src/main/resources/static/8eb36c39-77b3-4ad2-9624-132b68017b3c.png new file mode 100644 index 0000000..93ba305 Binary files /dev/null and b/src/main/resources/static/8eb36c39-77b3-4ad2-9624-132b68017b3c.png differ diff --git a/src/test/java/com/zsc/edu/gateway/BaseServiceTest.java b/src/test/java/com/zsc/edu/gateway/BaseServiceTest.java new file mode 100644 index 0000000..2535e0a --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/BaseServiceTest.java @@ -0,0 +1,92 @@ +package com.zsc.edu.gateway; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.zsc.edu.gateway.domain.DeptBuilder; +import com.zsc.edu.gateway.domain.RoleBuilder; +import com.zsc.edu.gateway.domain.UserBuilder; +import com.zsc.edu.gateway.framework.security.UserDetailsImpl; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.entity.User; +import com.zsc.edu.gateway.modules.system.repo.DeptRepository; +import com.zsc.edu.gateway.modules.system.repo.RoleRepository; +import com.zsc.edu.gateway.modules.system.repo.UserRepository; +import com.zsc.edu.gateway.modules.system.service.RoleService; +import com.zsc.edu.gateway.modules.system.service.UserService; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.security.crypto.password.PasswordEncoder; + +/** + * @author pengzheng + */ +//@ActiveProfiles("test") +@SpringBootTest +abstract public class BaseServiceTest { + + protected static UserDetailsImpl userDetails; + protected static User user1; + protected static User user2; + private static boolean dataInit; + private static UserRepository userRepoStatic; + private static DeptRepository deptRepoStatic; + private static RoleRepository roleRepoStatic; + private static RoleService roleServiceStatic; + @Autowired + private UserService service; + @Autowired + private UserRepository userRepo; + @Autowired + private DeptRepository deptRepo; + @Autowired + private RoleRepository roleRepo; + @Autowired + private RoleService roleService; + @Autowired + private PasswordEncoder passwordEncoder; + + @AfterAll + static void afterAll() { + userRepoStatic.delete(new QueryWrapper<>()); + roleRepoStatic.delete(new QueryWrapper<>()); + deptRepoStatic.delete(new QueryWrapper<>()); + dataInit = false; + } + + @BeforeEach + public void baseSetUp() { + if (!dataInit) { + Dept dept1 = DeptBuilder.aDept().name("神湾分局").build(); + deptRepo.insert(dept1); + Role role1 = RoleBuilder.aRole().name("超级管理员").build(); + roleRepo.insert(role1); + + user1 = UserBuilder.anUser() + .username("admin") + .email("123@qq.com") + .phone("13412334452") + .dept(dept1) + .role(role1) + .password(passwordEncoder.encode("admin")) + .build(); + userRepo.insert(user1); + + user2 = UserBuilder.anUser() + .username("13412334452") + .email("13412334452@zsc.edu.cn") + .phone("13412334452") + .password(passwordEncoder.encode("user1")) + .build(); + userRepo.insert(user2); + userDetails = UserDetailsImpl.from(user1); + + dataInit = true; + deptRepoStatic = deptRepo; + roleRepoStatic = roleRepo; + userRepoStatic = userRepo; + roleServiceStatic = roleService; + } + } +} diff --git a/src/test/java/com/zsc/edu/gateway/IotGatewayApplicationTests.java b/src/test/java/com/zsc/edu/gateway/IotGatewayApplicationTests.java new file mode 100644 index 0000000..6050b07 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/IotGatewayApplicationTests.java @@ -0,0 +1,13 @@ +package com.zsc.edu.gateway; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class IotGatewayApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/src/test/java/com/zsc/edu/gateway/MockMvcConfigBase.java b/src/test/java/com/zsc/edu/gateway/MockMvcConfigBase.java new file mode 100644 index 0000000..c0c929d --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/MockMvcConfigBase.java @@ -0,0 +1,65 @@ +package com.zsc.edu.gateway; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.zsc.edu.gateway.domain.DeptBuilder; +import com.zsc.edu.gateway.domain.RoleBuilder; +import com.zsc.edu.gateway.domain.UserBuilder; +import com.zsc.edu.gateway.framework.security.CustomAccessDeniedHandler; +import com.zsc.edu.gateway.framework.security.CustomAuthenticationFailureHandler; +import com.zsc.edu.gateway.framework.security.UserDetailsImpl; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.entity.User; +import com.zsc.edu.gateway.modules.system.mapper.RoleMapper; +import com.zsc.edu.gateway.modules.system.mapper.UserMapper; +import com.zsc.edu.gateway.modules.system.service.UserService; +import jakarta.annotation.Resource; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.security.core.session.SessionRegistry; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.test.web.servlet.MockMvc; + +import javax.sql.DataSource; +import java.util.HashSet; + +/** + * @author pengzheng + */ +@ExtendWith(SpringExtension.class) +//@AutoConfigureRestDocs +//@ActiveProfiles("test") +abstract public class MockMvcConfigBase { + + protected static UserDetailsImpl userDetails; + protected static User user; + @MockBean + protected DataSource dataSource; + @MockBean + protected SessionRegistry sessionRegistry; + @MockBean + protected UserMapper userMapper; + @MockBean + protected RoleMapper roleMapper; + + @MockBean + private UserService userService; + @MockBean + protected CustomAuthenticationFailureHandler customAuthenticationFailureHandler; + @MockBean + protected CustomAccessDeniedHandler customAccessDeniedHandler; + @Resource + protected MockMvc mockMvc; + @Resource + protected ObjectMapper objectMapper; + + @BeforeAll + public static void setup() { + Dept dept = DeptBuilder.aDept().name("Platform").build(); + Role role = RoleBuilder.aRole().authorities(new HashSet<>()).build(); +// Role role = RoleBuilder.aRole().authorities(new HashSet<>(Arrays.asList(Authority))).build(); + user = UserBuilder.anUser().username("admin").dept(dept).role(role).build(); + userDetails = UserDetailsImpl.from(user); + } +} diff --git a/src/test/java/com/zsc/edu/gateway/domain/AuthorityBuilder.java b/src/test/java/com/zsc/edu/gateway/domain/AuthorityBuilder.java new file mode 100644 index 0000000..e4b0d41 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/domain/AuthorityBuilder.java @@ -0,0 +1,45 @@ +package com.zsc.edu.gateway.domain; + +import com.zsc.edu.gateway.modules.system.entity.Authority; + +import java.util.Set; + +public class AuthorityBuilder extends BaseEntityBuilder{ + + private String name; + private Boolean enabled; + private String remark; + private Set aut; + + public static AuthorityBuilder aAuthority(){ + return new AuthorityBuilder(); + } + + public AuthorityBuilder name(String name){ + this.name = name; + return this; + } + + public AuthorityBuilder enabled(Boolean enabled){ + this.enabled = enabled; + return this; + } + + public AuthorityBuilder remark(String remark){ + this.remark = remark; + return this; + } + + public AuthorityBuilder authorities(Set authorities){ + this.aut = authorities; + return this; + } + public Authority build(){ + Authority authority = new Authority(); + authority.setName(name); + authority.setEnabled(enabled); + authority.setRemark(remark); + return authority; + } + +} diff --git a/src/test/java/com/zsc/edu/gateway/domain/BaseEntityBuilder.java b/src/test/java/com/zsc/edu/gateway/domain/BaseEntityBuilder.java new file mode 100644 index 0000000..b4a5bd3 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/domain/BaseEntityBuilder.java @@ -0,0 +1,22 @@ +package com.zsc.edu.gateway.domain; + +import java.time.LocalDateTime; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; + +/** + * @author pengzheng + */ +public class BaseEntityBuilder { + public Long id = -1L; + public String remark; + public LocalDateTime createAt; + public LocalDateTime updateAt; + + public BaseEntityBuilder() { + remark = randomAlphabetic(5); + createAt = LocalDateTime.now(); + updateAt = LocalDateTime.now(); + } + +} diff --git a/src/test/java/com/zsc/edu/gateway/domain/DeptBuilder.java b/src/test/java/com/zsc/edu/gateway/domain/DeptBuilder.java new file mode 100644 index 0000000..b56a803 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/domain/DeptBuilder.java @@ -0,0 +1,51 @@ +package com.zsc.edu.gateway.domain; + +import com.zsc.edu.gateway.modules.system.entity.Dept; + +import java.util.HashSet; + +public class DeptBuilder extends BaseEntityBuilder { + + public String name; + public Dept parent; + public Long pid; + + public HashSet children; + + + public static DeptBuilder aDept(){ + return new DeptBuilder(); + } + + public DeptBuilder name(String name){ + this.name = name; + return this; + } + + + public DeptBuilder parent(Dept parent) { + this.parent = parent; + return this; + } + + public DeptBuilder pid(Long pid) { + this.pid = pid; + return this; + } + + public DeptBuilder children(HashSet children) { + this.children = children; + return this; + } + + + public Dept build(){ + Dept dept = new Dept(); + dept.setName(name); + dept.setPid(pid); + dept.setChildren(children); + return dept; + } + + +} diff --git a/src/test/java/com/zsc/edu/gateway/domain/RoleBuilder.java b/src/test/java/com/zsc/edu/gateway/domain/RoleBuilder.java new file mode 100644 index 0000000..ddcd859 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/domain/RoleBuilder.java @@ -0,0 +1,54 @@ +package com.zsc.edu.gateway.domain; + +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.Role; + +import java.util.HashSet; +import java.util.Set; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; + +/** + * @author pengzheng + */ +public final class RoleBuilder extends BaseEntityBuilder { + public String name; + public boolean enable; + public Set authorities; + + private RoleBuilder() { + this.name = randomAlphabetic(5); + this.enable = true; + this.authorities = new HashSet<>(); + } + + public static RoleBuilder aRole() { + return new RoleBuilder(); + } + + public RoleBuilder name(String name) { + this.name = name; + return this; + } + + public RoleBuilder enable(boolean enable) { + this.enable = enable; + return this; + } + + public RoleBuilder authorities(Set authorities) { + this.authorities = authorities; + return this; + } + + public Role build() { + Role role = new Role(); + role.setRemark(remark); + role.setCreateTime(createAt); + role.setUpdateTime(updateAt); + role.setName(name); + role.setEnabled(enable); + role.setAuthorities(authorities); + return role; + } +} diff --git a/src/test/java/com/zsc/edu/gateway/domain/UserBuilder.java b/src/test/java/com/zsc/edu/gateway/domain/UserBuilder.java new file mode 100644 index 0000000..56efa60 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/domain/UserBuilder.java @@ -0,0 +1,83 @@ +package com.zsc.edu.gateway.domain; + +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.entity.User; + +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric; + +/** + * @author pengzheng + */ +public final class UserBuilder extends BaseEntityBuilder { + public String username; + public String password; + public String phone; + public String email; + public boolean enable; + public Dept dept; + public Role role; + + private UserBuilder() { + this.username = randomAlphabetic(5); + this.password = randomAlphabetic(5); + this.phone = "139" + randomAlphanumeric(8); + this.email = randomAlphanumeric(8) + "@" + randomAlphanumeric(6) + ".com"; + this.enable = true; + } + + public static UserBuilder anUser() { + return new UserBuilder(); + } + + public UserBuilder username(String username) { + this.username = username; + return this; + } + + public UserBuilder password(String password) { + this.password = password; + return this; + } + + public UserBuilder phone(String phone) { + this.phone = phone; + return this; + } + + public UserBuilder email(String email) { + this.email = email; + return this; + } + + public UserBuilder enable(boolean enable) { + this.enable = enable; + return this; + } + + public UserBuilder dept(Dept dept) { + this.dept = dept; + return this; + } + + public UserBuilder role(Role role) { + this.role = role; + return this; + } + + public User build() { + User user = new User(); + user.setRemark(remark); + user.setCreateTime(createAt); + user.setUpdateTime(updateAt); + user.setUsername(username); + user.setPassword(password); + user.setPhone(phone); + user.setEmail(email); + user.setEnableState(enable); + user.setDept(dept); + user.setRole(role); + return user; + } +} diff --git a/src/test/java/com/zsc/edu/gateway/rest/AuthorityControllerTest.java b/src/test/java/com/zsc/edu/gateway/rest/AuthorityControllerTest.java new file mode 100644 index 0000000..ff64221 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/rest/AuthorityControllerTest.java @@ -0,0 +1,85 @@ +package com.zsc.edu.gateway.rest; + +import com.zsc.edu.gateway.MockMvcConfigBase; +import com.zsc.edu.gateway.domain.AuthorityBuilder; +import com.zsc.edu.gateway.modules.system.controller.AuthorityController; +import com.zsc.edu.gateway.modules.system.dto.AuthorityDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.service.AuthorityService; +import org.assertj.core.util.Lists; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.mockito.Spy; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.MediaType; + +import java.util.List; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf; +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@WebMvcTest(AuthorityController.class) +public class AuthorityControllerTest extends MockMvcConfigBase { + + @Spy + private static Authority aut1; + + private static Authority aut2; + + @MockBean + private AuthorityService service; + + + @BeforeAll + static void beforeAll() { + aut1 = AuthorityBuilder.aAuthority().name("AUTHORITY_ONE").build(); + aut1.setId(1L); + aut2 = AuthorityBuilder.aAuthority().name("AUTHORITY_TWO").build(); + } + + @Test + void create() throws Exception { + AuthorityDto dto = new AuthorityDto(); + dto.name=aut1.getName(); + when(service.create(any())).thenReturn(aut1); + mockMvc.perform(post("/api/rest/auth") + .with(csrf().asHeader()) + .with(user(userDetails)) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto)) + ).andExpect(status().isOk()).andDo(print()); + verify(service).create(any()); + } + + @Test + void list() throws Exception { + List authorities = Lists.newArrayList(aut1, aut2); + when(service.list()).thenReturn(authorities); + mockMvc.perform(get("/api/rest/auth").with(user(userDetails)) + ).andExpect(status().isOk()).andDo(print()); + verify(service).list(); + } + + + @Test + void update() throws Exception { + AuthorityDto dto = new AuthorityDto(); + dto.name = aut1.getName(); + when(service.update((AuthorityDto) any(), any())).thenReturn(true); + mockMvc.perform(patch("/api/rest/auth/{id}", aut1.id) + .with(csrf().asHeader()) + .with(user(userDetails)) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto)) + ) + .andExpect(status().isOk()).andDo(print()); + verify(service).update((AuthorityDto) any(), any()); + } +} diff --git a/src/test/java/com/zsc/edu/gateway/rest/DeptControllerTest.java b/src/test/java/com/zsc/edu/gateway/rest/DeptControllerTest.java new file mode 100644 index 0000000..c71ccff --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/rest/DeptControllerTest.java @@ -0,0 +1,128 @@ +package com.zsc.edu.gateway.rest; + +//import com.zsc.edu.gateway.MockMvcConfigBase; +import com.zsc.edu.gateway.MockMvcConfigBase; +import com.zsc.edu.gateway.domain.DeptBuilder; +import com.zsc.edu.gateway.modules.system.controller.DeptController; +import com.zsc.edu.gateway.modules.system.dto.DeptDto; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.zsc.edu.gateway.modules.system.mapper.DeptMapper; +import com.zsc.edu.gateway.modules.system.service.DeptService; +import com.zsc.edu.gateway.modules.system.service.UserService; +import org.assertj.core.util.Lists; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.mockito.Spy; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.MediaType; + +import java.util.List; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf; +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@WebMvcTest(DeptController.class) +public class DeptControllerTest extends MockMvcConfigBase { + + @Spy + private static Dept dept1; + + private static Dept dept2; + + @MockBean + private DeptService service; + + + + @BeforeAll + static void beforeAll() { + dept1 = DeptBuilder.aDept().name("测试部门1").build(); + dept1.setId(1L); + dept2 = DeptBuilder.aDept().name("测试部门2").pid(dept1.id).build(); + } + + @Test + void create() throws Exception{ + DeptDto dto = new DeptDto(); + dto.name = dept1.getName(); + when(service.create(any())).thenReturn(dept1); + mockMvc.perform(post("/api/rest/dept") + .with(csrf().asHeader()) + .with(user(userDetails)) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto)) + ).andExpect(status().isOk()).andDo(print()); + verify(service).create(any()); + } + + @Test + void list() throws Exception { + List depts = Lists.newArrayList(dept1, dept2); + when(service.list()).thenReturn(depts); + mockMvc.perform(get("/api/rest/dept").with(user(userDetails))) + .andExpect(status().isOk()) + .andDo(print()); + verify(service).list(); + } + + @Test + void update() throws Exception { + DeptDto dto = new DeptDto(); + dto.name = dept1.getName(); + when(service.edit(any(), any())).thenReturn(true); + mockMvc.perform(patch("/api/rest/dept/1") + .with(csrf().asHeader()) + .with(user(userDetails)) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto)) + ) + .andExpect(status().isOk()).andDo(print()); + verify(service).edit(any(), any()); + } +// +// @Test +// void remove() throws Exception { +// when(service.deleteById(anyLong())).thenReturn(lampGroup1); +// mockMvc.perform(delete("/api/rest/lamp-group/{id}", lampGroup1.id) +// .with(csrf().asHeader()) +// .with(user(userDetails)) +// ) +// .andExpect(status().isOk()) +// .andDo(document("lamp-group/delete")); +// verify(service).deleteById(anyLong()); +// } +// +// @Test +// void detail() throws Exception { +// when(service.detail(anyLong())).thenReturn(lampGroup1); +// mockMvc.perform(get("/api/rest/lamp-group/{id}", lampGroup1.id) +// .with(user(userDetails)) +// ) +// .andExpect(status().isOk()) +// .andDo(document("lamp-group/detail")); +// verify(service).detail(anyLong()); +// } +// +// @Test +// void batchDelete() throws Exception { +// Long[] ids = new Long[]{1l, 2l, 3l, 4l, 5l, 6l, 7l, 8l, 9l, 10l, 11l, 12l}; +// when(service.batchDelete(any())).thenReturn(ids); +// mockMvc.perform(post("/api/rest/lamp-group/batchRemove") +// .contentType(MediaType.APPLICATION_JSON) +// .content(objectMapper.writeValueAsString(ids)) +// .with(csrf().asHeader()) +// .with(user(userDetails)) +// ) +// .andExpect(status().isOk()) +// .andDo(document("lamp-group/batchRemove")); +// verify(service).batchDelete(any()); +// } + +} diff --git a/src/test/java/com/zsc/edu/gateway/rest/RoleControllerTest.java b/src/test/java/com/zsc/edu/gateway/rest/RoleControllerTest.java new file mode 100644 index 0000000..e884d73 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/rest/RoleControllerTest.java @@ -0,0 +1,136 @@ +package com.zsc.edu.gateway.rest; + +import com.zsc.edu.gateway.MockMvcConfigBase; +import com.zsc.edu.gateway.domain.RoleBuilder; +import com.zsc.edu.gateway.modules.system.controller.RoleController; +import com.zsc.edu.gateway.modules.system.dto.RoleDto; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.service.RoleService; +import org.assertj.core.util.Lists; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.MediaType; + +import java.util.List; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf; +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@WebMvcTest(RoleController.class) +public class RoleControllerTest extends MockMvcConfigBase { + + private static Role role1; + + private static Role role2; + + @MockBean + private RoleService service; + + @BeforeAll + static void beforeAll() { + role1 = RoleBuilder.aRole().name("管理员").build(); + role2 = RoleBuilder.aRole().name("普通用户").build(); + } + + @Test + void create() throws Exception{ + RoleDto dto = new RoleDto(); + dto.name = role1.getName(); + when(service.create(any())).thenReturn(role1); + mockMvc.perform(post("/api/rest/role") + .with(csrf().asHeader()) + .with(user(userDetails)) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto)) + ).andExpect(status().isOk()).andDo(print()); + verify(service).create(any()); + } + + @Test + void list() throws Exception { + List Roles = Lists.newArrayList(role1, role2); + when(service.list()).thenReturn(Roles); + mockMvc.perform(get("/api/rest/role").with(user(userDetails))) + .andExpect(status().isOk()) + .andDo(print()); + verify(service).list(); + } + + @Test + void update() throws Exception { + RoleDto dto = new RoleDto(); + dto.name = role1.getName(); + when(service.update(any(), any())).thenReturn(true); + mockMvc.perform(patch("/api/rest/role/{id}", role1.id) + .with(csrf().asHeader()) + .with(user(userDetails)) + .contentType(MediaType.APPLICATION_JSON) + .content(objectMapper.writeValueAsString(dto)) + ) + .andExpect(status().isOk()).andDo(print()); + verify(service).update(any(), any()); + } +// @Test +// void update() throws Exception { +// AuthorityDto dto = new AuthorityDto(); +// dto.name = aut1.getName(); +// when(service.update((AuthorityDto) any(), any())).thenReturn(true); +// mockMvc.perform(patch("/api/rest/auth/{id}", aut1.id) +// .with(csrf().asHeader()) +// .with(user(userDetails)) +// .contentType(MediaType.APPLICATION_JSON) +// .content(objectMapper.writeValueAsString(dto)) +// ) +// .andExpect(status().isOk()).andDo(print()); +// verify(service).update((AuthorityDto) any(), any()); +// } +// +// @Test +// void remove() throws Exception { +// when(service.deleteById(anyLong())).thenReturn(lampGroup1); +// mockMvc.perform(delete("/api/rest/lamp-group/{id}", lampGroup1.id) +// .with(csrf().asHeader()) +// .with(user(userDetails)) +// ) +// .andExpect(status().isOk()) +// .andDo(document("lamp-group/delete")); +// verify(service).deleteById(anyLong()); +// } +// +// @Test +// void detail() throws Exception { +// when(service.detail(anyLong())).thenReturn(lampGroup1); +// mockMvc.perform(get("/api/rest/lamp-group/{id}", lampGroup1.id) +// .with(user(userDetails)) +// ) +// .andExpect(status().isOk()) +// .andDo(document("lamp-group/detail")); +// verify(service).detail(anyLong()); +// } +// +// @Test +// void batchDelete() throws Exception { +// Long[] ids = new Long[]{1l, 2l, 3l, 4l, 5l, 6l, 7l, 8l, 9l, 10l, 11l, 12l}; +// when(service.batchDelete(any())).thenReturn(ids); +// mockMvc.perform(post("/api/rest/lamp-group/batchRemove") +// .contentType(MediaType.APPLICATION_JSON) +// .content(objectMapper.writeValueAsString(ids)) +// .with(csrf().asHeader()) +// .with(user(userDetails)) +// ) +// .andExpect(status().isOk()) +// .andDo(document("lamp-group/batchRemove")); +// verify(service).batchDelete(any()); +// } + +} diff --git a/src/test/java/com/zsc/edu/gateway/service/AuthorityServiceTest.java b/src/test/java/com/zsc/edu/gateway/service/AuthorityServiceTest.java new file mode 100644 index 0000000..d59e93a --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/service/AuthorityServiceTest.java @@ -0,0 +1,86 @@ +package com.zsc.edu.gateway.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.zsc.edu.gateway.domain.AuthorityBuilder; +import com.zsc.edu.gateway.exception.ConstraintException; +import com.zsc.edu.gateway.modules.system.dto.AuthorityDto; +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.repo.AuthorityRepository; +import com.zsc.edu.gateway.modules.system.service.AuthorityService; +import jakarta.annotation.Resource; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +@SpringBootTest +public class AuthorityServiceTest { + @Resource + private AuthorityRepository repo; + @Autowired + private AuthorityService service; + + + + private Authority aut1; + private Authority aut2; + + @BeforeEach + void setUp() { + aut1 = AuthorityBuilder.aAuthority().name("TEST_AUTHORITY_ONE").build(); + repo.insert(aut1); + aut2 = AuthorityBuilder.aAuthority().name("TEST_AUTHORITY_TWO").build(); + repo.insert(aut2); + } + + @Test + void list() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + assertEquals(2, service.list(queryWrapper.like(Authority::getName, "TEST_AUTHORITY")).size()); + assertEquals(1, service.list(queryWrapper.eq(Authority::getName, aut1.getName())).size()); + assertEquals(2, service.list().size()); + } + + @Test + void createAuthority() { + AuthorityDto dto = new AuthorityDto(); + dto.setName("TEST_AUTHORITY"); + dto.setEnabled(true); + dto.setRemark("测试权限增加"); + AuthorityDto dto2 = new AuthorityDto(); + dto2.setName(aut2.getName()); + dto2.setEnabled(aut2.getEnabled()); + dto2.setRemark(aut2.getRemark()); + Authority authority=service.create(dto); + assertNotNull(authority.getId()); + List list = service.list(); + assertEquals(3, list.size()); + // 不能创建其他已存在的同名同代码部门 + assertThrows(ConstraintException.class, () -> service.create(dto2)); + } + + @Test + void updateAuthority() { + AuthorityDto dto = new AuthorityDto(); + dto.setName("TEST_AUTHORITY_BBS"); + dto.setRemark("测试权限增加..."); + assertTrue(service.update(dto, aut2.id)); + Authority authority = service.getOne(new LambdaQueryWrapper().eq(Authority::getName, dto.getName())); + assertEquals(authority.getName(), dto.getName()); + assertEquals(authority.getId(), aut2.id); + // 不能改为其他已存在的同名同代码部门 + assertThrows(ConstraintException.class, + () -> service.update(new AuthorityDto(aut1.getName(), true,null), aut2.id)); + } + + @AfterEach + void tearDown() { + repo.delete(new QueryWrapper<>()); + } +} diff --git a/src/test/java/com/zsc/edu/gateway/service/DeptServiceTest.java b/src/test/java/com/zsc/edu/gateway/service/DeptServiceTest.java new file mode 100644 index 0000000..cc8b996 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/service/DeptServiceTest.java @@ -0,0 +1,138 @@ +package com.zsc.edu.gateway.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.zsc.edu.gateway.domain.DeptBuilder; +import com.zsc.edu.gateway.exception.ConstraintException; +import com.zsc.edu.gateway.modules.system.dto.DeptDto; +import com.zsc.edu.gateway.modules.system.entity.Dept; +import com.zsc.edu.gateway.modules.system.repo.DeptRepository; +import com.zsc.edu.gateway.modules.system.service.DeptService; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.dao.DuplicateKeyException; + +import jakarta.annotation.Resource; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * @author pengzheng + */ +//@ActiveProfiles("test") +@SpringBootTest +class DeptServiceTest { + + @Autowired + private DeptService service; + + @Resource + private DeptRepository repo; + + private Dept dept1; + private Dept dept2; + + private Dept dept3; + private Dept dept4; + + @BeforeEach + void setUp() { + dept1 = DeptBuilder.aDept().name("测试部门1").build(); + repo.insert(dept1); + dept2 = DeptBuilder.aDept().name("测试部门2").pid(dept1.id).build(); + repo.insert(dept2); + dept3 = DeptBuilder.aDept().name("测试部门3").pid(dept1.id).build(); + repo.insert(dept3); + dept4 = DeptBuilder.aDept().name("测试部门4").pid(dept3.id).build(); + repo.insert(dept4); + } + + @AfterEach + void tearDown() { + repo.delete(new QueryWrapper<>()); + } + + @Test + void list() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + assertEquals(4, service.list(queryWrapper.like(Dept::getName, "测试部门")).size()); + assertEquals(1, service.list(queryWrapper.eq(Dept::getName, dept1.getName())).size()); + assertEquals(4, service.list().size()); + } + +// @Test +// void listTree() { +// Dept result = service.listTree(dept1.id); +// int count = result.children.size(); +// assertEquals(2, count); +// } + + @Test + void createAdmin() { + Dept dept = new Dept(); + dept.setName("东菱经销商3"); + dept.setRemark("remark..."); + dept.setPid(dept1.id); + service.save(dept); + assertEquals(5, service.list().size()); + // 不能创建其他已存在的同名同代码部门 + assertThrows(DuplicateKeyException.class, () -> service.save(dept1)); + } + + @Test + void create() { +// Dept dept = new Dept(); +// dept.setName("东菱经销商5"); +// dept.setRemark("remark..."); +// dept.setPid(dept1.id); + DeptDto dto = new DeptDto(); + dto.setName("东菱经销商5"); + dto.setRemark("remark..."); + dto.setPid(dept1.id); + DeptDto dto2 = new DeptDto(); + dto2.setName(dept2.getName()); + dto2.setRemark("remark..."); + dto2.setPid(dept1.id); + Dept dept = service.create(dto); + assertNotNull(dept.getId()); + assertEquals(6, service.list().size()); + // 不能创建其他已存在的同名同代码部门 + assertThrows(ConstraintException.class, () -> service.create(dto2)); + } + + @Test + void updateAdmin() { + DeptDto dto = new DeptDto(); + dto.setName("东菱经销商5"); + dto.setRemark("remark..."); + assertTrue(service.edit(dto, dept2.id)); + Dept tmp = service.getOne(new LambdaQueryWrapper().eq(Dept::getName, dto.getName())); + assertEquals(tmp.getName(), dto.getName()); + assertEquals(tmp.getId(), dept2.id); + // 不能改为其他已存在的同名同代码部门 + assertThrows(ConstraintException.class, + () -> service.edit(new DeptDto(dept3.getName(), "remark",null), dept2.id)); + } + + +// @Test +// void tree() { +// Dept result = service.listTree(dept3.id); +// HashSet deptPath = DeptTreeUtil.getDeptPath(result); +// System.out.println(deptPath); +// assertEquals(2, deptPath.size()); +// } + +// @Test +// void findTreeChild() { +// Dept result = service.listTree(dept1.id); +// Dept childNode = DeptTreeUtil.getChildNode(result.children, dept2.id); +// System.out.println(childNode.id); +// assertEquals(dept2.id, childNode.id); +// } + + +} diff --git a/src/test/java/com/zsc/edu/gateway/service/RoleServiceTest.java b/src/test/java/com/zsc/edu/gateway/service/RoleServiceTest.java new file mode 100644 index 0000000..88d64bb --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/service/RoleServiceTest.java @@ -0,0 +1,94 @@ +package com.zsc.edu.gateway.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.zsc.edu.gateway.domain.RoleBuilder; +import com.zsc.edu.gateway.modules.system.dto.RoleDto; +import com.zsc.edu.gateway.modules.system.entity.Role; +import com.zsc.edu.gateway.modules.system.repo.AuthorityRepository; +import com.zsc.edu.gateway.modules.system.repo.RoleRepository; +import com.zsc.edu.gateway.modules.system.service.RoleService; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import jakarta.annotation.Resource; +import java.util.Arrays; +import java.util.HashSet; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * @author harry yao + */ +//@ActiveProfiles("test") +@SpringBootTest +class RoleServiceTest { + + @Autowired + private RoleService service; + + @Resource + private RoleRepository repo; + + private Role role1; + private Role role2; + + private Role Role3; + private Role Role4; +// @Resource + private AuthorityRepository authorityRepository; + + @BeforeEach + void setUp() { + role1 = RoleBuilder.aRole().name("超级管理员").build(); + repo.insert(role1); + role2 = RoleBuilder.aRole().name("普通用户").build(); + repo.insert(role2); + } + + @AfterEach + void tearDown() { + repo.delete(new QueryWrapper<>()); + } + + @Test + void list() { + assertEquals(2, service.list().size()); + assertEquals(1, service.list(new LambdaQueryWrapper().like(Role::getName, "普通用户")).size()); + assertEquals(1, service.list(new LambdaQueryWrapper().eq(Role::getName, role1.getName())).size()); + } + + @Test + void create() { +// Role Role = new Role(); +// Role.setName("东菱经销商5"); +// Role.setRemark("remark..."); +// Role.setPid(Role1.id); + RoleDto dto = new RoleDto(); + dto.setName("东菱经销商5"); + dto.setRemark("remark..."); + dto.setAuthorities(new HashSet<>(Arrays.asList(authorityRepository.selectOne(null)))); + Role Role = service.create(dto); + assertNotNull(Role.getId()); + assertEquals(3, service.list().size()); + // 不能创建其他已存在的同名同代码部门 +// assertThrows(ConstraintException.class, () -> service.create(dto2)); + } + + @Test + void update() { + RoleDto dto = new RoleDto(); + dto.setName("超级管理员2"); + dto.setRemark("remark..."); + dto.setAuthorities(authorityRepository.selectAuthoritiesByRoleId(1L)); + assertTrue(service.edit(dto, role2.id)); + } + + @Test + void roleVo(){ + repo.deleteById(role1.id); + } +} diff --git a/src/test/java/com/zsc/edu/gateway/service/UserServiceTest.java b/src/test/java/com/zsc/edu/gateway/service/UserServiceTest.java new file mode 100644 index 0000000..e882ad2 --- /dev/null +++ b/src/test/java/com/zsc/edu/gateway/service/UserServiceTest.java @@ -0,0 +1,44 @@ +package com.zsc.edu.gateway.service; + +import com.zsc.edu.gateway.modules.system.entity.Authority; +import com.zsc.edu.gateway.modules.system.entity.RoleAuthority; +import com.zsc.edu.gateway.modules.system.entity.User; +import com.zsc.edu.gateway.modules.system.repo.AuthorityRepository; +import com.zsc.edu.gateway.modules.system.repo.RoleAuthoritiesRepository; +import com.zsc.edu.gateway.modules.system.repo.UserRepository; +import jakarta.annotation.Resource; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @author ftz + * 创建时间:29/12/2023 上午11:21 + * 描述: TODO + */ +@SpringBootTest +public class UserServiceTest { + @Resource + private RoleAuthoritiesRepository roleAuthoritiesRepository; + @Resource + private UserRepository userRepository; + @Resource + private AuthorityRepository authorityRepository; + @Test + void test() { + User user=userRepository.selectByUsername("admin"); + Set authorities= authorityRepository.selectAuthoritiesByRoleId(user.getRoleId()); + user.role.authorities=authorities; + System.out.println(user); + + } + @Test + void test1() { + User user=userRepository.selectByUsername("admin"); + System.out.println(user); + + } +}