first commit

This commit is contained in:
编码猿
2024-09-27 01:32:49 +08:00
commit 28ebe05a64
7399 changed files with 1174529 additions and 0 deletions

25
moehu/qzkf-application/.gitignore vendored Executable file
View File

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

View File

@@ -0,0 +1 @@
43aaf480-bbab-460e-ad49-f7b22e13f8fe

View File

@@ -0,0 +1 @@
32c381ff-d5c8-435f-8900-ba4766550b1b

Binary file not shown.

View File

@@ -0,0 +1 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip

View File

@@ -0,0 +1 @@
8ec7f86e-4f20-4def-83be-551e449efd24

286
moehu/qzkf-application/mvnw vendored Executable file
View File

@@ -0,0 +1,286 @@
#!/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.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
# TODO classpath?
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
wget "$jarUrl" -O "$wrapperJarPath"
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
curl -o "$wrapperJarPath" "$jarUrl"
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

161
moehu/qzkf-application/mvnw.cmd vendored Executable file
View File

@@ -0,0 +1,161 @@
@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 Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a member defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
echo Found %WRAPPER_JAR%
) else (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
echo Finished downloading %WRAPPER_JAR%
)
@REM End of extension
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%

374
moehu/qzkf-application/pom.xml Executable file
View File

@@ -0,0 +1,374 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.qizhi</groupId>
<artifactId>qzkf</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>qzkf-application</name>
<description></description>
<properties>
<java.version>1.8</java.version>
<swagger.version>2.9.2</swagger.version>
<mybatis-spring-boot-starter.version>2.1.4</mybatis-spring-boot-starter.version>
<pagehelper.version>1.2.10</pagehelper.version>
<tk.mybatis.version>2.1.4</tk.mybatis.version>
<modelmapper.version>2.3.2</modelmapper.version>
<quartz.version>2.3.0</quartz.version>
<commons-io.version>2.6</commons-io.version>
<commons-lang3.version>3.6</commons-lang3.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.1.4</version>
</dependency>
<!--热启动:每自修改后, 程序自动启动spring Application上下文。 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<!-- Mybatis -->
<!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.3</version>
</dependency>
<!-- mybatis分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.version}</version>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>${tk.mybatis.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.6</version>
</dependency>
<!-- 对象自动映射工具 -->
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>${modelmapper.version}</version>
</dependency>
<!-- mysql数据库驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.9</version>
</dependency>
<!-- 阿里json -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.9</version>
</dependency>
<!-- 阿里云短信 -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.1.0</version>
</dependency>
<!-- swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<!-- swagger2 ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!-- commons -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<!-- okhttp3-->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.10.0</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<!-- jwt -->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.netty/netty-all -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.6.Final</version>
</dependency>
<!--RabbitMQ -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<version>1.5.2.RELEASE</version>
</dependency>
<!-- quartz -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>${quartz.version}</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
</dependency>
<dependency>
<groupId>com.github.tobato</groupId>
<artifactId>fastdfs-client</artifactId>
<version>1.26.5</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20170516</version>
</dependency>
<dependency>
<groupId>com.github.qcloudsms</groupId>
<artifactId>qcloudsms</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dm</artifactId>
<version>3.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.oschina.zcx7878/fastdfs-client-java -->
<dependency>
<groupId>net.oschina.zcx7878</groupId>
<artifactId>fastdfs-client-java</artifactId>
<version>1.27.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
<version>4.0.0-RC1</version>
</dependency>
<dependency>
<groupId>io.shardingsphere</groupId>
<artifactId>sharding-transaction-spring-boot-starter</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-jwt -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.15</version>
</dependency>
<!-- poi office -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.5</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.jeffreyning</groupId>-->
<!-- <artifactId>extcol</artifactId>-->
<!-- <version>0.0.2-RELEASE</version>-->
<!-- </dependency>-->
</dependencies>
<!--<build>-->
<!--<resources>-->
<!--<resource>-->
<!--<directory>src/main/resources</directory>-->
<!--<filtering>true</filtering>-->
<!--<excludes>-->
<!--<exclude>qqwry.dat</exclude>-->
<!--<exclude>*.yml</exclude>-->
<!--</excludes>-->
<!--</resource>-->
<!--</resources>-->
<!--<plugins>-->
<!--<plugin>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-maven-plugin</artifactId>-->
<!--</plugin>-->
<!--</plugins>-->
<!--</build>-->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>libs/</classpathPrefix>
<mainClass>com.qizhi.QzkfApplication</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/config</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<exclude>qqwry.dat</exclude>
<include>**/*.yml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<encoding>UTF-8</encoding>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1 @@
150eecfc-8c97-4555-95ab-0298a528d74b

View File

@@ -0,0 +1 @@
7d379538-09a3-4556-8522-285f433903bd

View File

@@ -0,0 +1 @@
1221b640-7c0c-4a1a-960c-aa1829b0c4dd

View File

@@ -0,0 +1 @@
1f424bcd-6e84-4325-8b5d-3ffe2813443a

View File

@@ -0,0 +1 @@
7227f900-2b17-4dd8-ba2a-a25cba5d1c80

View File

@@ -0,0 +1,23 @@
package com.qizhi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication()
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@EnableTransactionManagement(proxyTargetClass = true)
@EnableCaching //开启缓存
public class QzkfApplication {
public static void main(String[] args) {
SpringApplication.run(QzkfApplication.class, args);
}
}

View File

@@ -0,0 +1 @@
a5cfe55e-90df-46c8-a580-09194bddd4a7

View File

@@ -0,0 +1 @@
e76920a2-c1b5-4720-b685-891e8c829d90

View File

@@ -0,0 +1 @@
acd4ece8-2e8f-47d6-a81c-7f581a635d3b

View File

@@ -0,0 +1,255 @@
package com.qizhi.business.com.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qizhi.business.com.dto.CompanyRespDto;
import com.qizhi.business.com.dto.CompanySaveReqDto;
import com.qizhi.business.com.entity.Company;
import com.qizhi.business.com.entity.User;
import com.qizhi.business.com.service.CompanyService;
import com.qizhi.business.com.service.UserService;
import com.qizhi.business.route.service.SetSessionService;
import com.qizhi.business.set.dto.QizhiRobotRespDto;
import com.qizhi.business.set.entity.SetRobot;
import com.qizhi.business.set.service.SetEvaluateService;
import com.qizhi.business.set.service.SetRobotService;
import com.qizhi.common.authentication.IgnoreSecurity;
import com.qizhi.common.utils.Md5Util;
import com.qizhi.common.utils.TableUtil;
import com.qizhi.extension.RestResponse;
import io.shardingsphere.transaction.annotation.ShardingTransactionType;
import io.shardingsphere.transaction.api.TransactionType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Condition;
import tk.mybatis.mapper.entity.Example;
import java.util.Calendar;
import java.util.List;
@Api("公司信息相关接口")
@RestController
@RequestMapping(value = "/company")
public class CompanyController {
@Autowired
private CompanyService companyService;
@Autowired
private UserService userService;
@Autowired
private SetEvaluateService evaluateService;
@Autowired
private SetSessionService setSessionService;
@Autowired
private SetRobotService setRobotService;
/**
* 根据companyId查询账户信息
* @param companyId
* @return
*/
@ApiOperation(value = "用户列表", notes = "查询用户列表分页接口")
@ApiImplicitParam(name = "companyId", required = true, value = "公司ID", dataType = "Long")
@RequestMapping(value = "getCompanyMsg", method = RequestMethod.POST)
public RestResponse<CompanyRespDto> getCompanyMsg(Long companyId) {
CompanyRespDto company=companyService.getCompanyById(companyId);
if (company==null){
return RestResponse.failed("不存在此公司");
}
return RestResponse.succesed(company);
}
/**
* 根据companyId修改公司名称
* @param companyId
* @param name
* @return
*/
@ApiOperation(value = "修改公司名称", notes = "根据公司Id修改公司名称")
@ApiImplicitParams({
@ApiImplicitParam(name = "companyId", required = true, value = "公司ID", dataType = "Long"),
@ApiImplicitParam(name = "name", value = "公司名称", dataType = "String"),
})
@RequestMapping(value = "editCompany", method = RequestMethod.POST)
public RestResponse<Void> editCompany(Long companyId,String name) {
Company company=companyService.findByCompanyId(companyId);
if (company==null){
return RestResponse.failed("不存在此公司");
}
company.setUpdateTime(System.currentTimeMillis());
company.setName(name);
companyService.update(company);
return RestResponse.succesed();
}
/**
* 客户管理页面添加公司
* @param companySaveReqDto
* @return
*/
@ApiOperation(value = "添加公司", notes = "添加公司详细信息")
@RequestMapping(value = "saveCompanyMsg", method = RequestMethod.POST)
@IgnoreSecurity
@ShardingTransactionType(TransactionType.LOCAL)
@Transactional(propagation = Propagation.REQUIRED)
public RestResponse<Void> saveCompanyMsg(@RequestBody CompanySaveReqDto companySaveReqDto)throws Exception {
Integer companyEmailCheck=companyService.getCompanyCountByEmail(companySaveReqDto.getEmail());
Integer companyTelCheck=companyService.getCompanyCountByTel(companySaveReqDto.getTelephone());
if(companyEmailCheck>0){
return RestResponse.failed("该邮箱已被注册,请使用其它邮箱");
}
if(companyTelCheck>0){
return RestResponse.failed("该手机号已被注册,请使用其它手机号");
}
List<User> userList=userService.getUserList();
if(userList.size()>0){
for (User u:userList) {
if(companySaveReqDto.getEmail().equals(u.getEmail())){
return RestResponse.failed("拥有此邮箱的客服已存在,请使用其他邮箱");
}
if(companySaveReqDto.getTelephone().equals(u.getTelephone())){
return RestResponse.failed("拥有此手机号码的客服已存在,请使用其他邮箱");
}
}
}
Company company=new Company();
company.setCompanyCode(TableUtil.getPK("C"));
company.setName(companySaveReqDto.getName());
company.setEmail(companySaveReqDto.getEmail());
company.setPassword(Md5Util.MD5(companySaveReqDto.getPassword()));
company.setTelephone(companySaveReqDto.getTelephone());
company.setCreateId(companySaveReqDto.getCreateId());
company.setStatus(0);
company.setCustomer(99999L);
company.setworkOrder(99999L);
company.setIsLogin(0);
//设置有效期限
Long time1=System.currentTimeMillis();
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 24);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.MILLISECOND, 0);
Long k=cal.getTimeInMillis();
Long time2=k+315360000000L;
company.setCreateTime(time1);
company.setDueTime(time2);
Long companyId=companyService.saveCompanyData(company);
//初始化评价标签
evaluateService.initEvaluate(company.getCompanyId());
//初始化会话设置
setSessionService.initSetSession(company.getCompanyId());
return RestResponse.succesed();
}
/**
* 判断是否登录
* @param companyId
* @return
*/
@ApiOperation(value = "判断是否登录", notes = "根据公司id查询主账号是否登录过")
@ApiImplicitParam(name = "companyId", value = "公司ID", dataType = "Long")
@RequestMapping(value = "findCompanyIsLogin", method = RequestMethod.POST)
public RestResponse<Integer> findCompanyIsLogin(Long companyId){
Company company=companyService.findByCompanyId(companyId);
Integer islogin=company.getIsLogin();
return RestResponse.succesed(islogin);
}
/**
* 主账号登录状态置1
* @param companyId
* @return
*/
@ApiOperation(value = "修改主账号登录状态", notes = "根据公司id修改主账号登录状态")
@ApiImplicitParam(name = "companyId", value = "公司ID", dataType = "Long")
@RequestMapping(value = "findIsLogin", method = RequestMethod.POST)
public RestResponse<Void> findIsLogin(Long companyId){
Company company=companyService.findByCompanyId(companyId);
company.setIsLogin(1);
companyService.update(company);
return RestResponse.succesed();
}
/**
* 客户管理查询
* @param inputText
* @return
*/
@ApiOperation(value = "查询公司", notes = "根据输入框的内容模糊匹配公司详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "inputText", value = "输入框", dataType = "String"),
@ApiImplicitParam(name = "page", required = true,value = "页数", dataType = "Integer"),
@ApiImplicitParam(name = "rows", required = true, value = "每页条数", dataType = "Integer"),
})
@RequestMapping(value = "searchCompany", method = RequestMethod.POST)
@IgnoreSecurity
public RestResponse<PageInfo> searchCompany(String inputText,Integer page,Integer rows) {
if(page==null){
page=1;
}
if(rows==null){
rows=10;
}
PageHelper.startPage(page,rows);
Condition condition = new Condition(Company.class);
Example.Criteria criteria = condition.createCriteria();
criteria.andNotEqualTo("status",-1);
if(StringUtils.isNotEmpty(inputText)){
criteria.andCondition("(name like '%"+inputText+"%' or email like '%"+inputText+"%'or telephone like '%"+inputText+"%')");
}
condition.orderBy("createTime").desc();
List<Company> companyList= companyService.getByCondition(condition);
PageInfo pageInfo=new PageInfo(companyList);
PageInfo companyDtoList=companyService.getAllCustomer(pageInfo);
return RestResponse.succesed(companyDtoList);
}
/**
* 客户管理页面对公司基础信息设置的修改
* @param companyId
* @param customer
* @param workOrder
* @param dueTime
* @param remark
* @return
*/
@ApiOperation(value = "客户管理修改公司", notes = "客户管理页面对公司基础信息设置的修改")
@ApiImplicitParams({
@ApiImplicitParam(name = "companyId", value = "公司ID", dataType = "Long"),
@ApiImplicitParam(name = "customer", value = "可添加在线客服数", dataType = "Long"),
@ApiImplicitParam(name = "workOrder", value = "可添加工单客服数", dataType = "Long"),
@ApiImplicitParam(name = "dueTime", value = "到期时间", dataType = "Long"),
@ApiImplicitParam(name = "remark", value = "备注", dataType = "String"),
})
@RequestMapping(value = "updataCompanyMsg", method = RequestMethod.POST)
@IgnoreSecurity
public RestResponse<Void> updataCompanyMsg(Long companyId,Long customer,Long workOrder,Long dueTime,String remark) {
Company company=companyService.findByCompanyId(companyId);
if (company==null){
return RestResponse.failed("不存在此公司");
}
company.setCustomer(customer);
company.setworkOrder(workOrder);
company.setDueTime(dueTime);
company.setRemark(remark);
companyService.update(company);
companyService.updateCompanyUsers(companyId);
return RestResponse.succesed();
}
}

View File

@@ -0,0 +1,71 @@
package com.qizhi.business.com.controller;
import com.qizhi.business.com.entity.Permission;
import com.qizhi.business.com.entity.router.VuePermission;
import com.qizhi.business.com.entity.router.VueRouter;
import com.qizhi.business.com.service.PermissionService;
import com.qizhi.extension.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api("权限相关接口")
@RestController
@RequestMapping(value = "/permission")
public class PermissionController {
@Autowired
private PermissionService permissionService;
/**
* 所有权限数据查询
*
* @return
*/
@ApiOperation(value = "获取权限数据", notes = "查询权限数据")
@RequestMapping(value = "getPermissionList", method = RequestMethod.POST)
public RestResponse<ArrayList<VuePermission<Permission>>> getPermissionList() {
ArrayList<VuePermission<Permission>> arrayList = this.permissionService.getAllPermission();
return RestResponse.succesed(arrayList);
}
/**
*
* @param userId
* @return
*/
@ApiOperation(value = "获取用户路由数据", notes = "获取用户路由数据")
@GetMapping("/{userId}")
public RestResponse<ArrayList<VueRouter<Permission>>> getUserRouters(@NotBlank(message = "{required}") @PathVariable Long userId) {
ArrayList<VueRouter<Permission>> arrayList = this.permissionService.getRoleRouters(userId);
return RestResponse.succesed(arrayList);
}
/**
* 所有权限按钮数据查询
*
* @return
*/
@ApiOperation(value = "获取权限数据", notes = "查询权限数据")
@RequestMapping(value = "queryPermissionBtn", method = RequestMethod.POST)
public RestResponse<Map<String,List<String>>> queryPermissionBtn(Long companyId, Long userId) {
List<String> buttonList=permissionService.queryButtonDataByUserId(companyId,userId);
List<String> menuList=permissionService.queryMenuDataByUserId(companyId,userId);
Map<String,List<String>> map=new HashMap<>();
map.put("buttonList",buttonList);
map.put("menuList",menuList);
return RestResponse.succesed(map);
}
}

View File

@@ -0,0 +1,58 @@
package com.qizhi.business.com.controller;
import com.qizhi.business.com.dto.SetUserReqDto;
import com.qizhi.business.com.dto.SetUserRespDto;
import com.qizhi.business.com.entity.SetUser;
import com.qizhi.business.com.service.PersonalSetService;
import com.qizhi.common.authentication.IgnoreSecurity;
import com.qizhi.extension.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@Api("个人设置相关接口")
@RestController
@RequestMapping(value = "/personalSet")
public class PersonalSetController {
@Autowired
private PersonalSetService personalSetService;
/**
* 根据当前登录者查询个人设置信息
*
* @param userId
* @return
*/
@ApiOperation(value = "查询个人设置信息", notes = "根据当前登录者查询个人设置信息")
@RequestMapping(value = "getPersonalSetInfo", method = RequestMethod.POST)
@ApiImplicitParam(name = "userId", required = true, value = "用户Id", dataType = "Long")
@IgnoreSecurity
public RestResponse<SetUserRespDto> getPersonalSetInfo(Long userId) {
SetUser setUser=personalSetService.findBy("userId",userId);
SetUserRespDto setUserRespDto=new SetUserRespDto();
if(setUser!=null){
ModelMapper modelMapper = new ModelMapper();
setUserRespDto=modelMapper.map(setUser,SetUserRespDto.class);
}
return RestResponse.succesed(setUserRespDto);
}
/**
*个人设置创建/编辑
* @param setUserReqDto
* @return
*/
@ApiOperation(value = "个人设置创建/编辑", notes = "个人设置创建/编辑")
@RequestMapping(value = "editSetUserInfo", method = RequestMethod.POST)
public RestResponse<SetUserRespDto> editSetUserInfo( SetUserReqDto setUserReqDto) {
SetUserRespDto returnValue=personalSetService.saveSetUserInfo(setUserReqDto);
return RestResponse.succesed(returnValue);
}
}

View File

@@ -0,0 +1,180 @@
package com.qizhi.business.com.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qizhi.business.com.dto.RoleReqDto;
import com.qizhi.business.com.dto.RoleRespDto;
import com.qizhi.business.com.entity.Role;
import com.qizhi.business.com.entity.RolePermission;
import com.qizhi.business.com.entity.User;
import com.qizhi.business.com.service.RolePermissionService;
import com.qizhi.business.com.service.RoleService;
import com.qizhi.business.com.service.UserService;
import com.qizhi.extension.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.modelmapper.ModelMapper;
import org.modelmapper.TypeToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Condition;
import java.util.List;
@Api("权限相关接口")
@RestController
@RequestMapping(value = "/role")
public class RoleController {
@Autowired
private UserService userService;
@Autowired
private RoleService roleService;
@Autowired
private RolePermissionService rolePermissionService;
/**
* 角色列表查询
*
* @return
*/
@ApiOperation(value = "获取角色列表信息", notes = "查询角色列表")
@RequestMapping(value = "getRoleList", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "companyId", value = "租户Id", dataType = "Integer"),
@ApiImplicitParam(name = "page", value = "页数", dataType = "Integer"),
@ApiImplicitParam(name = "rows", value = "每页条数", dataType = "Integer")
})
public RestResponse<PageInfo> getRoleList(Integer companyId,Integer page,Integer rows) {
if(page==null){
page=1;
}
if(rows==null){
rows=10;
}
PageHelper.startPage(page,rows);
Condition condition = new Condition(Role.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("companyId",companyId);
criteria.andNotEqualTo("delStatus",2);
List<Role> roleList = roleService.getRoleByCondition(condition);
PageInfo pageInfo = new PageInfo<>(roleList);
ModelMapper modelMapper = new ModelMapper();
List<RoleRespDto> roleRespDtoList = modelMapper.map(roleList,new TypeToken<List<RoleRespDto>>() {}.getType());
pageInfo.setList(roleRespDtoList);
return RestResponse.succesed(pageInfo);
}
/**
*删除角色
* @param roleId
* @return
*/
@ApiOperation(value = "删除角色", notes = "删除角色")
@RequestMapping(value = "deleteRole", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "roleId", required = true, value = "角色Id", dataType = "Long"),
})
public RestResponse<String> deleteUser(Long roleId) {
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("roleId",roleId);
criteria.andNotEqualTo("status",-1);
List<User> userList= userService.getUserByCondition(condition);//获得角色相关的用户信息
if(userList.size()>0){
return RestResponse.failed("有客服账号正在使用该角色,不能删除");
}
Role role=roleService.getRoleById(roleId);
if(role!=null&&role.getDelStatus()!=2){//存在未删除过
role.setDelStatus(2);
roleService.update(role);
return RestResponse.succesed();
}
return RestResponse.failed("角色信息不存在");
}
/**
*角色创建/编辑
* @param roleReqDto
* @return
*/
@ApiOperation(value = "角色创建/编辑", notes = "角色创建/编辑")
@RequestMapping(value = "editRoleInfo", method = RequestMethod.POST)
public RestResponse<Long> editRoleInfo(@RequestBody RoleReqDto roleReqDto) {
if(roleReqDto.getCompanyId()==null){
return RestResponse.failed("租户信息不存在");
}
if(roleReqDto.getRoleName()==null||"".equals(roleReqDto.getRoleName())){
return RestResponse.failed("角色名称不能为空");
}
Condition condition = new Condition(Role.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("roleName",roleReqDto.getRoleName());
criteria.andEqualTo("companyId",roleReqDto.getCompanyId());
criteria.andNotEqualTo("delStatus",2);
if(roleReqDto.getRoleId()!=null){
criteria.andNotEqualTo("roleId",roleReqDto.getRoleId());
}
List<Role> roleList=roleService.getRoleByCondition(condition);
if(roleList.size()>0){//存在
return RestResponse.failed("此角色已存在,请确认后重试");
}
Long roleId=roleService.saveRoleInfo(roleReqDto);
return RestResponse.succesed(roleId);
}
/**
* 根据ID查询角色
*
* @param roleId
* @return
*/
@ApiOperation(value = "获取角色详细信息", notes = "根据角色id来获取角色信息")
@RequestMapping(value = "getRoleInfoById", method = RequestMethod.POST)
@ApiImplicitParam(name = "roleId", required = true, value = "角色Id", dataType = "Long")
public RestResponse<ModelMap> getRoleInfoById(Long roleId) {
Role role=roleService.getRoleById(roleId);
ModelMapper modelMapper = new ModelMapper();
RoleRespDto roleRespDto = modelMapper.map(role, RoleRespDto.class);
ModelMap modelMap=new ModelMap();
modelMap.put("roleRespDto",roleRespDto);
//选中菜单按钮信息
Condition condition = new Condition(RolePermission.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("roleId",roleId);
List<RolePermission> list = rolePermissionService.getRolePermissionByCondition(condition);
modelMap.put("rolePermissionList",list);
return RestResponse.succesed(modelMap);
}
/**
* 查询启用的角色信息
*
* @return
*/
@ApiOperation(value = "查询启用的角色信息", notes = "查询启用的角色信息")
@RequestMapping(value = "getEnableRoleList", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "companyId", value = "租户Id", dataType = "Integer"),
})
public RestResponse<ModelMap> getEnableRoleList(Integer companyId) {
Condition condition = new Condition(Role.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("delStatus",1);
criteria.andEqualTo("companyId",companyId);
List<Role> roleList = roleService.getRoleByCondition(condition);
ModelMapper modelMapper = new ModelMapper();
List<RoleRespDto> roleRespDtoList = modelMapper.map(roleList,new TypeToken<List<RoleRespDto>>() {}.getType());
ModelMap map=new ModelMap();
map.put("list",roleRespDtoList);
return RestResponse.succesed(map);
}
}

View File

@@ -0,0 +1,586 @@
package com.qizhi.business.com.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qizhi.business.com.dto.*;
import com.qizhi.business.com.entity.Role;
import com.qizhi.business.com.entity.RolePermission;
import com.qizhi.business.com.entity.User;
import com.qizhi.business.com.service.PermissionService;
import com.qizhi.business.com.service.RolePermissionService;
import com.qizhi.business.com.service.RoleService;
import com.qizhi.business.com.service.UserService;
import com.qizhi.business.customer.dto.SelectDto;
import com.qizhi.business.customer.entity.IDMCompany;
import com.qizhi.business.customer.entity.IDMCustomer;
import com.qizhi.business.customer.service.IDMCompanyService;
import com.qizhi.business.customer.service.IDMCustomerService;
import com.qizhi.business.customer.service.IDMPositionService;
import com.qizhi.business.route.entity.OnlineStatusRecord;
import com.qizhi.business.route.enums.SessionConstant;
import com.qizhi.business.route.service.OnlineRedisService;
import com.qizhi.business.route.service.OnlineStatusRecordService;
import com.qizhi.business.route.service.RouteChannelService;
import com.qizhi.common.authentication.IgnoreSecurity;
import com.qizhi.common.cache.CachePrefix;
import com.qizhi.common.utils.Md5Util;
import com.qizhi.extension.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.modelmapper.ModelMapper;
import org.modelmapper.TypeToken;
import org.modelmapper.convention.MatchingStrategies;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Condition;
import tk.mybatis.mapper.entity.Example;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Api(tags = "账号管理相关接口")
@RestController
@RequestMapping(value = "/user")
public class UserController {
@Autowired
private UserService userService;
@Autowired
private RoleService roleService;
@Autowired
private RolePermissionService rolePermissionService;
@Autowired
private PermissionService permissionService;
@Autowired
private OnlineRedisService onlineRedisService;
@Autowired
private OnlineStatusRecordService onlineStatusRecordService;
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Autowired
private RouteChannelService routeChannelService;
@Autowired
private IDMCompanyService idmCompanyService;
@Autowired
private IDMCustomerService idmCustomerService;
@Autowired
private IDMPositionService idmPositionService;
/**
* 获取运维列表信息
*
* @return
*/
@ApiOperation(value = "获取运维列表信息", notes = "获取运维列表信息")
@RequestMapping(value = "getUserList", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "companyId", value = "租户Id", dataType = "Integer"),
@ApiImplicitParam(name = "loginId", value = "登录名", dataType = "String"),
@ApiImplicitParam(name = "name", value = "姓名", dataType = "String"),
@ApiImplicitParam(name = "idmCompanyCode", value = "分部编号", dataType = "String"),
@ApiImplicitParam(name = "roleId", value = "角色ID", dataType = "Long"),
@ApiImplicitParam(name = "status", value = "状态 0:正常 1:禁用", dataType = "String"),
@ApiImplicitParam(name = "page", value = "页数", dataType = "Integer"),
@ApiImplicitParam(name = "rows", value = "每页条数", dataType = "Integer")
})
public RestResponse<PageInfo> getUserList(Integer companyId,String loginId, String name, String idmCompanyCode, Long roleId, String status, Integer page, Integer rows) {
if(companyId==null){
return RestResponse.failed("租户信息不存在") ;
}
if(page==null){
page=1;
}
if(rows==null){
rows=10;
}
PageHelper.startPage(page,rows);
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
if(companyId != null && !"".equals(companyId)){
criteria.andEqualTo("companyId",companyId);
}
if(loginId != null && !"".equals(loginId)){
criteria.andLike("loginId","%"+loginId+"%");
}
if(name != null && !"".equals(name)){
criteria.andLike("name","%"+name+"%");
}
if(idmCompanyCode != null && !"".equals(idmCompanyCode)){
criteria.andEqualTo("idmCompanyCode",idmCompanyCode);
}
if(roleId != null){
criteria.andEqualTo("roleId",roleId);
}
if(status != null && !"".equals(status)){
criteria.andEqualTo("status",Integer.valueOf(status));
}else{
criteria.andNotEqualTo("status",-1);
}
condition.orderBy("createTime").desc();
List<User> userList = userService.getUserByCondition(condition);
PageInfo pageInfo = new PageInfo(userList);
ModelMapper modelMapper = new ModelMapper();
List<UserRespDto> userDtoList = modelMapper.map(userList,new TypeToken<List<UserRespDto>>() {}.getType());
if(userList.size()>0){
List<String> subCompanyCodes=userList.stream().map(User::getIdmCompanyCode).collect(Collectors.toList());
List<IDMCompany> companies = idmCompanyService.getIDMCompanyListByCodes(subCompanyCodes);
for (UserRespDto userRespDto:userDtoList) {
Long userRoleId=userRespDto.getRoleId();
Role role= roleService.getRoleById(userRoleId);
if(role!=null){
userRespDto.setRoleName(role.getRoleName());
}
for(IDMCompany idmCompany:companies){
if(idmCompany.getSubCompanyCode().equals(userRespDto.getIdmCompanyCode())){
userRespDto.setIdmCompanyName(idmCompany.getsComName());
break;
}
}
}
}
pageInfo.setList(userDtoList);
return RestResponse.succesed(pageInfo);
}
/**
*用户编辑
* @param userEditReqDto
* @return
*/
@ApiOperation(value = "用户编辑", notes = "用户编辑")
@RequestMapping(value = "/editUserInfo", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "userEditReqDto", required = true, value = "运维编辑信息DTO", dataType = "UserEditReqDto"),
})
public RestResponse<UserRespDto> editUserInfo(@RequestBody UserEditReqDto userEditReqDto) {
if(userEditReqDto.getCompanyId()==null){
return RestResponse.failed("租户信息不存在") ;
}
String returnValue=userService.editUserInfo(userEditReqDto);
if(!"".equals(returnValue)){
return RestResponse.failed(returnValue) ;
}
return RestResponse.succesed();
}
@ApiOperation(value = "创建运维用户(IDM)", notes = "创建运维用户(IDM)")
@RequestMapping(value = "/addUserInfo", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "idmUserReqDto", required = true, value = "运维信息DTO", dataType = "IDMUserReqDto"),
})
public RestResponse<UserRespDto> addUserInfo(@RequestBody IDMUserReqDto idmUserReqDto) {
if(idmUserReqDto.getCompanyId()==null){
return RestResponse.failed("租户信息不存在") ;
}
String returnValue=userService.addUserInfo(idmUserReqDto);
if(!"".equals(returnValue)){
return RestResponse.failed(returnValue) ;
}
return RestResponse.succesed();
}
/**
* 启用/禁用用户信息
* @param userId
* @param status
* @return
*/
@ApiOperation(value = "启用/禁用用户信息", notes = "启用/禁用用户")
@RequestMapping(value = "enableUser", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", required = true, value = "用户Id", dataType = "Long"),
@ApiImplicitParam(name = "status", value = "状态", dataType = "Integer"),
@ApiImplicitParam(name = "loginUserId", required = true, value = "当前登录者ID", dataType = "Long"),
})
public RestResponse<String> enableUser(Long userId,Integer status,Long loginUserId) {
//-1:删除 0:正常 1:禁用2:失效
User user=userService.getUserById(userId);
if(user!=null&&user.getStatus()!=-1){//存在未删除过
String returnValue = userService.updateUserStatus(user,status,loginUserId);//更新状态
if(!"".equals(returnValue)){
return RestResponse.failed(returnValue) ;
}
if(status == 1){
redisTemplate.delete(CachePrefix.UserCenter.jwt_token_user+"_"+ user.getUserId());
}
return RestResponse.succesed();
}
return RestResponse.failed("用户信息不存在");
}
/**
*删除用户
* @param userId
* @return
*/
@ApiOperation(value = "删除用户", notes = "删除用户")
@RequestMapping(value = "deleteUser", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", required = true, value = "用户Id", dataType = "Long"),
@ApiImplicitParam(name = "loginUserId", required = true, value = "当前登录者ID", dataType = "Long"),
})
public RestResponse<String> deleteUser(Long userId,Long loginUserId) {
int acceptCount= onlineRedisService.selectAcceptCountByUser(userId);
int queueCount=onlineRedisService.selectQueueCountByParam(userId,SessionConstant.QUEUE_FLAG_USER);
if(acceptCount>0||queueCount>0){
return RestResponse.failed("该客服当前有接待中或排队中的会话,不可删除");
}
User user=userService.getUserById(userId);
Boolean isUser = routeChannelService.queryByUserId(userId,user.getCompanyId());
if(isUser){
return RestResponse.failed("该客服当前有业务管理配置,不可删除");
}
if(user!=null&&user.getStatus()!=-1){//存在未删除过
userService.updateUserStatus(user,-1,loginUserId);//更新状态
redisTemplate.delete(CachePrefix.UserCenter.jwt_token_user+"_"+ user.getUserId());
return RestResponse.succesed();
}
return RestResponse.failed("用户信息不存在");
}
/**
*密码重置
* @param userId
* @param password
* @return
*/
@ApiOperation(value = "密码重置", notes = "密码重置")
@RequestMapping(value = "resetPwd", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", required = true, value = "用户Id", dataType = "Long"),
@ApiImplicitParam(name = "password", required = true, value = "密码", dataType = "String"),
@ApiImplicitParam(name = "loginUserId", required = true, value = "当前登录者ID", dataType = "Long"),
})
public RestResponse<String> resetPwd(Long userId,String password,Long loginUserId) {
User user=userService.getUserById(userId);
if(user!=null&&user.getStatus()!=-1){//存在未删除过
user.setPassword(Md5Util.MD5(password));
user.setUpdateId(loginUserId);
user.setUpdateTime(new Date().getTime());
userService.changeUserPassword(user);
return RestResponse.succesed();
}
return RestResponse.failed("用户信息不存在");
}
/**
* 根据ID查询用户
*
* @param userId
* @return
*/
@ApiOperation(value = "获取系统用户详细信息", notes = "根据url的id来获取系统用户详细信息")
@RequestMapping(value = "getUserById", method = RequestMethod.POST)
@ApiImplicitParam(name = "userId", required = true, value = "用户Id", dataType = "Long")
public RestResponse<UserRespDto> getUserById(Long userId) {
User user=userService.getUserById(userId);
if(user!=null){
ModelMapper modelMapper = new ModelMapper();
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
UserRespDto userRespDto = modelMapper.map(user, UserRespDto.class);
if(StringUtils.isNotBlank(userRespDto.getIdmCompanyCode())){
IDMCompany idmCompany = idmCompanyService.getIDMCompanyByCode(userRespDto.getIdmCompanyCode());
userRespDto.setIdmCompanyId(idmCompany.getId());
userRespDto.setIdmCompanyName(idmCompany.getsComName());
userRespDto.setIdmCompanyFullName(idmCompany.getsComFullName());
}
IDMCustomer idmCustomer = idmCustomerService.findBy("loginId",user.getLoginId());
if(idmCustomer!=null){
userRespDto.setIdmPositionName(idmCustomer.getPositionName());
}
return RestResponse.succesed(userRespDto);
}else{
return RestResponse.succesed(null);
}
}
/**
* 根据loginId查询用户详细信息
*
* @param loginId
* @return
*/
@ApiOperation(value = "根据loginId查询用户详细信息", notes = "根据loginId来获取系统用户详细信息")
@RequestMapping(value = "getUserByLoginId", method = RequestMethod.POST)
@ApiImplicitParam(name = "loginId", required = true, value = "用户登录Id", dataType = "String")
public RestResponse<UserRespDto> getUserByLoginId(Long companyId,String loginId) {
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("companyId",companyId);
criteria.andEqualTo("loginId",loginId);
List<User> result=userService.selectByCondition(condition);
if(result.size()>0){
ModelMapper modelMapper = new ModelMapper();
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
UserRespDto userRespDto = modelMapper.map(result.get(0), UserRespDto.class);
if(StringUtils.isNotBlank(userRespDto.getIdmCompanyCode())){
IDMCompany idmCompany = idmCompanyService.getIDMCompanyByCode(userRespDto.getIdmCompanyCode());
userRespDto.setIdmCompanyId(idmCompany.getId());
userRespDto.setIdmCompanyName(idmCompany.getsComName());
userRespDto.setIdmCompanyFullName(idmCompany.getsComFullName());
}
IDMCustomer idmCustomer = idmCustomerService.findBy("loginId",loginId);
if(idmCustomer!=null){
userRespDto.setIdmPositionName(idmCustomer.getPositionName());
}
return RestResponse.succesed(userRespDto);
}else{
return RestResponse.succesed(null);
}
}
/**
* 登录用户的菜单权限
* @param userId
* @return
*/
@ApiOperation(value = "获取登录用户的菜单权限", notes = "登录用户的菜单权限")
@RequestMapping(value = "getPermissionListByUserId", method = RequestMethod.POST)
@ApiImplicitParam(name = "userId", required = true, value = "用户Id", dataType = "Long")
public RestResponse<ModelMap> getPermissionListByUserId(Long userId) {
if(userId==null){
return RestResponse.failed("未能获取用户信息");
}
ModelMap map=new ModelMap();
User user=userService.getUserById(userId);
if(user!=null){
//用户所属角色的权限菜单按钮
Long roleId=user.getRoleId();
Condition condition = new Condition(RolePermission.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("roleId",roleId);
List<RolePermission> rolePermissionslist= rolePermissionService.getRolePermissionByCondition(condition);
//所有菜单
ModelMap permissionMap=permissionService.getUserMenuInfo(user.getCompanyId(),rolePermissionslist);
List<PermissionRespDto> list=(List<PermissionRespDto>) permissionMap.get("list");
JSONArray jsonArray = new JSONArray();
for (PermissionRespDto menu : list) {
JSONObject json = new JSONObject();
json.put("icon", menu.getIcon());
json.put("index", menu.getRoutePath());
json.put("title", menu.getName());
if(menu.getChildren() != null) {
jsonArray.add(addChildren(json,menu.getChildren()));
}else{
jsonArray.add(json);
}
}
map.put("menus", jsonArray);
List<String> buttonList =permissionService.getUserButtonInfo(user.getCompanyId(),rolePermissionslist);
map.put("buttons", buttonList);
return RestResponse.succesed(map);
}
return RestResponse.failed("用户账号不存在");
}
private JSONObject addChildren(JSONObject json, List<PermissionRespDto> list) {
JSONArray jsonArray = new JSONArray();
if (list != null && list.size() > 0) {
for (PermissionRespDto child : list) {
JSONObject json1 = new JSONObject();
json1.put("index", child.getRoutePath());
json1.put("title", child.getName());
jsonArray.add(json1);
}
}else{
jsonArray.add(json);
}
json.put("subs", jsonArray);
return json;
}
/**
* 查询租户的在线客服数据
* @param companyId
* @return
*/
@ApiOperation(value = "查询租户的所有用户信息", notes = "查询租户的所有用户信息")
@RequestMapping(value = "queryUserByCompanyId", method = RequestMethod.POST)
@ApiImplicitParam(name = "companyId", required = true, value = "租户Id", dataType = "Long")
public RestResponse<List<UserRespDto>> queryUserByCompanyId(Long companyId) {
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
if(companyId != null && !"".equals(companyId)){
criteria.andEqualTo("companyId",companyId);
}
// criteria.andEqualTo("userType",0);
List<User> userList=userService.getUserByCondition(condition);
ModelMapper modelMapper = new ModelMapper();
List<UserRespDto> userDtoList = modelMapper.map(userList,new TypeToken<List<UserRespDto>>() {}.getType());
return RestResponse.succesed(userDtoList);
}
/**
* 用户列表查询
*
* @return
*/
@ApiOperation(value = "获取用户列表信息", notes = "查询用户列表")
@RequestMapping(value = "getUserOnLineList", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "companyId", value = "租户Id", dataType = "Integer"),
@ApiImplicitParam(name = "idmCompanyCode", value = "分部编号", dataType = "String"),
@ApiImplicitParam(name = "condition", value = "邮箱地址,姓名", dataType = "String"),
@ApiImplicitParam(name = "page", value = "页数", dataType = "Integer"),
@ApiImplicitParam(name = "rows", value = "每页条数", dataType = "Integer")
})
public RestResponse<PageInfo> getUserOnLineList(Integer companyId,String idmCompanyCode,String condition,Integer page, Integer rows) {
if(page==null){ page=1; }
if(rows==null){rows=10; }
PageHelper.startPage(page,rows);
Condition conditionParam = new Condition(User.class);
Condition.Criteria criteria = conditionParam.createCriteria();
// criteria.andEqualTo("userType",0);
if(companyId != null && !"".equals(companyId)){
criteria.andEqualTo("companyId",companyId);
}
if(idmCompanyCode != null && !"".equals(idmCompanyCode)){
criteria.andEqualTo("idmCompanyCode",idmCompanyCode);
}
if(condition != null && !"".equals(condition)){
criteria.andCondition("(name like '%" + condition + "%' or user_code like '%" + condition + "%') ");
}
criteria.andEqualTo("status",0);
List<User> userList = userService.getUserByCondition(conditionParam);
PageInfo pageInfo = new PageInfo(userList);
ModelMapper modelMapper = new ModelMapper();
List<UserRespDto> userDtoList = modelMapper.map(userList,new TypeToken<List<UserRespDto>>() {}.getType());
if(userList.size()>0){
List<Long> userIdList =new ArrayList<>( );
for (User user:userList) {
userIdList.add(user.getUserId() );
}
Map<Long,OnlineStatusRecord> map= onlineStatusRecordService.getOnlineStatusRecordMap( userIdList );
for (UserRespDto userRespDto:userDtoList) {
if (map.containsKey( userRespDto.getUserId() )){
userRespDto.setWorkStatus( map.get( userRespDto.getUserId() ).getCurrentStatus() );
}else {
userRespDto.setWorkStatus( "D" );
}
}
}
pageInfo.setList(userDtoList);
return RestResponse.succesed(pageInfo);
}
/**
* 密码修改
* @param userId
* @param password1
* @param password2
* @return
*/
@ApiOperation(value = "密码修改", notes = "密码修改")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "运维用户ID", dataType = "Long"),
@ApiImplicitParam(name = "password1", value = "密码1", dataType = "String"),
@ApiImplicitParam(name = "password2", value = "密码2", dataType = "String")
})
@RequestMapping(value = "changePassword", method = RequestMethod.POST)
@IgnoreSecurity
public RestResponse<Void> changePassword(Long userId, String password1,String password2) {
if(!"".equals(password1) && !"".equals(password2)){
User user=userService.getUserById(userId);
if(password1.equals(password2)&&user!=null&&user.getUserId()!=null){
user.setPassword(Md5Util.MD5(password1));
userService.update(user);
return RestResponse.succesed();
}else{
return RestResponse.failed("两次输入的密码不相同");
}
}else{
return RestResponse.failed("输入的密码不能为空");
}
}
/**
* 质检页面添加待检客服
* @param companyId
* @param inputText
* @return
*/
@ApiOperation(value = "质检页面添加待检客服", notes = "条件查询质检页面添加待检客服信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "companyId", value = "租户Id", dataType = "Long"),
@ApiImplicitParam(name = "inputText", value = "输入框内容", dataType = "String"),
})
@RequestMapping(value = "queryUserByCondition", method = RequestMethod.POST)
public RestResponse<List<User>> queryUserByCondition(Long companyId,String inputText) {
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
if(companyId != null && !"".equals(companyId)){
criteria.andEqualTo("companyId",companyId);
}
criteria.andNotEqualTo("status",-1);
if(StringUtils.isNotEmpty(inputText)){
String searchText = "%" + inputText + "%";
Condition condition1 = new Condition(User.class);
Example.Criteria criteria1 = condition1.createCriteria();
criteria1.orLike("name", searchText);
criteria1.orLike("userCode", searchText );
criteria.andCondition("(name like '%"+searchText+"%' or user_code like '%"+searchText+"%')");
}
List<User> userList=userService.getUserByCondition(condition);
return RestResponse.succesed(userList);
}
@ApiOperation(value = "获取受理人下拉", notes = "获取受理人下拉")
@RequestMapping(value = "/getAcceptUserForSet", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "keyword", value = "关键字", dataType = "String", defaultValue = ""),
@ApiImplicitParam(name = "isVip", value = "是否为Vip 0:否 1:是(过滤器不传 触发器传0)", dataType = "Integer", defaultValue = ""),
@ApiImplicitParam(name = "subCompanyCode", value = "分部编码", dataType = "String", defaultValue = ""),
})
public RestResponse getAcceptUserForSet(String keyword,Integer isVip,String subCompanyCode){
List<SelectDto> acceptUserDtoList = userService.getAcceptUserForSet(keyword,isVip,subCompanyCode);
return RestResponse.succesed(acceptUserDtoList);
}
@ApiOperation(value = "获取行政组下拉", notes = "获取行政组下拉")
@RequestMapping(value = "/getAcceptGroupForSet", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "keyword", value = "关键字", dataType = "String", defaultValue = ""),
})
public RestResponse getAcceptGroupForSet(String keyword){
PageHelper.startPage(1,100);
Condition condition = new Condition(IDMCompany.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("status","Y");
if(StringUtils.isNotBlank(keyword)){
criteria.andLike("sComName","%"+keyword+"%");
}
List<IDMCompany> companyList=idmCompanyService.findByCondition(condition);
List<AcceptGroupDto> acceptGroupDtoList = new ArrayList<>();
AcceptGroupDto acceptGroupDto;
for(IDMCompany company:companyList){
acceptGroupDto = new AcceptGroupDto();
acceptGroupDto.setId(company.getId());
acceptGroupDto.setGroupCode(company.getSubCompanyCode());
acceptGroupDto.setGroupName(company.getsComName());
acceptGroupDtoList.add(acceptGroupDto);
}
return RestResponse.succesed(acceptGroupDtoList);
}
}

View File

@@ -0,0 +1 @@
0bd1ebbb-c42d-4c32-927c-d0a5fa73450b

View File

@@ -0,0 +1,34 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModel;
@ApiModel(value = "AcceptGroupDto", description = "受理组下拉Dto")
public class AcceptGroupDto {
private Long id;
private String groupCode;
private String groupName;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getGroupCode() {
return groupCode;
}
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
}

View File

@@ -0,0 +1,25 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModel;
@ApiModel(value = "AcceptUserDto", description = "受理人下拉Dto")
public class AcceptUserDto {
private Long id;
private String name;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -0,0 +1,217 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Id;
public class CompanyRespDto {
@Id
private Long companyId;
@ApiModelProperty("公司编号")
private String companyCode;
@ApiModelProperty("邮箱")
private String email;
@ApiModelProperty("登录密码")
private String password;
@ApiModelProperty("公司名称")
private String name;
@ApiModelProperty("联系方式")
private String telephone;
@ApiModelProperty("可添加在线客服数")
private Long customer;
@ApiModelProperty("可添加工单客服数")
private Long workOrder;
@ApiModelProperty("-1:删除 0:正常 1:禁用")
private Integer status;
@ApiModelProperty("创建者")
private Long createId;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新者")
private Long updateId;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("到期时间")
private Long dueTime;
@ApiModelProperty("已添加的在线客服数")
private Long customerAdded;
@ApiModelProperty("已失效的在线客服数")
private Long customerLapsed;
@ApiModelProperty("已添加的工单客服数")
private Long workOrderAdded;
@ApiModelProperty("已失效的工单客服数")
private Long workOrderLapsed;
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getCompanyCode() {
return companyCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public Long getCustomer() {
return customer;
}
public void setCustomer(Long customer) {
this.customer = customer;
}
public Long getworkOrder() {
return workOrder;
}
public void setworkOrder(Long workOrder) {
this.workOrder = workOrder;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getCreateId() {
return createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateId() {
return updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Long getDueTime() {
return dueTime;
}
public void setDueTime(Long dueTime) {
this.dueTime = dueTime;
}
public Long getCustomerAdded() {
return customerAdded;
}
public void setCustomerAdded(Long customerAdded) {
this.customerAdded = customerAdded;
}
public Long getCustomerLapsed() {
return customerLapsed;
}
public void setCustomerLapsed(Long customerLapsed) {
this.customerLapsed = customerLapsed;
}
public Long getWorkOrderAdded() {
return workOrderAdded;
}
public void setWorkOrderAdded(Long workOrderAdded) {
this.workOrderAdded = workOrderAdded;
}
public Long getWorkOrderLapsed() {
return workOrderLapsed;
}
public void setWorkOrderLapsed(Long workOrderLapsed) {
this.workOrderLapsed = workOrderLapsed;
}
}

View File

@@ -0,0 +1,71 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModelProperty;
public class CompanySaveReqDto {
@ApiModelProperty("邮箱")
private String email;
@ApiModelProperty("登录密码")
private String password;
@ApiModelProperty("公司名称")
private String name;
@ApiModelProperty("联系方式")
private String telephone;
@ApiModelProperty("创建者")
private Long createId;
@ApiModelProperty("验证码")
private String coding;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public Long getCreateId() {
return createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public String getCoding() {
return coding;
}
public void setCoding(String coding) {
this.coding = coding;
}
}

View File

@@ -0,0 +1,183 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "IDMUserReqDto", description = "运维信息DTO")
public class IDMUserReqDto {
@ApiModelProperty("租户ID")
private Long companyId;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("邮箱")
private String email;
@ApiModelProperty(value = "移动电话")
private String mobile;
@ApiModelProperty("办公电话")
private String telephone;
@ApiModelProperty("IDM登录名 唯一性判重字段")
private String loginId;
@ApiModelProperty("登录密码")
private String password;
@ApiModelProperty(value = "是否为Vip 0:否 1:是")
private Integer isVip;
@ApiModelProperty("分部编号")
private String idmCompanyCode;
@ApiModelProperty("部门编号")
private String idmDepartmentCode;
@ApiModelProperty("岗位编号")
private String idmPositionCode;
@ApiModelProperty("ENABLE在职DISABLE离职")
private String empStatus;
@ApiModelProperty("用户状态 ENABLE生效 DISABLE失效")
private String customerStatus;
@ApiModelProperty("用户状态 0:正常 1:禁用")
private Integer status;
@ApiModelProperty("角色ID")
private Long roleId;
@ApiModelProperty("操作人ID")
private Long currentUserId;
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getLoginId() {
return loginId;
}
public void setLoginId(String loginId) {
this.loginId = loginId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Integer getIsVip() {
return isVip;
}
public void setIsVip(Integer isVip) {
this.isVip = isVip;
}
public String getIdmCompanyCode() {
return idmCompanyCode;
}
public void setIdmCompanyCode(String idmCompanyCode) {
this.idmCompanyCode = idmCompanyCode;
}
public String getIdmDepartmentCode() {
return idmDepartmentCode;
}
public void setIdmDepartmentCode(String idmDepartmentCode) {
this.idmDepartmentCode = idmDepartmentCode;
}
public String getIdmPositionCode() {
return idmPositionCode;
}
public void setIdmPositionCode(String idmPositionCode) {
this.idmPositionCode = idmPositionCode;
}
public String getEmpStatus() {
return empStatus;
}
public void setEmpStatus(String empStatus) {
this.empStatus = empStatus;
}
public String getCustomerStatus() {
return customerStatus;
}
public void setCustomerStatus(String customerStatus) {
this.customerStatus = customerStatus;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getCurrentUserId() {
return currentUserId;
}
public void setCurrentUserId(Long currentUserId) {
this.currentUserId = currentUserId;
}
}

View File

@@ -0,0 +1,122 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Id;
import java.util.List;
/**
* @date Tue Feb 12 16:10:18 CST 2019
*/
public class PermissionRespDto {
@Id
private Long permissionId;
@ApiModelProperty("菜单按钮名称")
private String name;
@ApiModelProperty("菜单按钮英文名称")
private String enName;
@ApiModelProperty("图标")
private String icon;
@ApiModelProperty("路径")
private String routePath;
@ApiModelProperty("父级ID")
private Long parentId;
@ApiModelProperty("类型1:menu,2:button)")
private Integer type;
@ApiModelProperty("排序")
private Integer sequence;
@ApiModelProperty("(1正常2删除)")
private Integer delStatus;
@ApiModelProperty("子节点")
private List<PermissionRespDto> children;
public Long getPermissionId() {
return this.permissionId;
}
public void setPermissionId(Long permissionId) {
this.permissionId = permissionId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public Long getParentId() {
return this.parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public Integer getType() {
return this.type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getSequence() {
return this.sequence;
}
public void setSequence(Integer sequence) {
this.sequence = sequence;
}
public Integer getDelStatus() {
return this.delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
public List<PermissionRespDto> getChildren() {
return children;
}
public void setChildren(List<PermissionRespDto> children) {
this.children = children;
}
public String getEnName() {
return enName;
}
public void setEnName(String enName) {
this.enName = enName;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getRoutePath() {
return routePath;
}
public void setRoutePath(String routePath) {
this.routePath = routePath;
}
}

View File

@@ -0,0 +1,69 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Id;
/**
* @date Tue Feb 12 16:10:18 CST 2019
*/
public class RoleReqDto {
@Id
private Long roleId;
@ApiModelProperty("公司ID")
private Long companyId;
@ApiModelProperty("角色名称")
private String roleName;
@ApiModelProperty("当前登录者")
private Long userId;
@ApiModelProperty("选中的权限集合")
private String permissionIds;
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getCompanyId() {
return this.companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getRoleName() {
return this.roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getPermissionIds() {
return permissionIds;
}
public void setPermissionIds(String permissionIds) {
this.permissionIds = permissionIds;
}
}

View File

@@ -0,0 +1,114 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Id;
/**
* @date Tue Feb 12 16:10:18 CST 2019
*/
public class RoleRespDto {
@Id
private Long roleId;
@ApiModelProperty("公司ID")
private Long companyId;
@ApiModelProperty("角色编号")
private String roleCode;
@ApiModelProperty("角色名称")
private String roleName;
@ApiModelProperty("(1正常2删除)")
private Integer delStatus;
@ApiModelProperty("创建者")
private Long createId;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新者")
private Long updateId;
@ApiModelProperty("更新时间")
private Long updateTime;
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getCompanyId() {
return this.companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getRoleName() {
return this.roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public Integer getDelStatus() {
return this.delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
public Long getCreateId() {
return this.createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Long getCreateTime() {
return this.createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateId() {
return this.updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public Long getUpdateTime() {
return this.updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getRoleCode() {
return roleCode;
}
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
}

View File

@@ -0,0 +1,140 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Id;
public class SetUserReqDto {
@Id
private Long setUserId;
@ApiModelProperty("公司编号")
private Long companyId;
@ApiModelProperty("客服Id")
private Long userId;
@ApiModelProperty("昵称")
private String nickname;
@ApiModelProperty("头像")
private String avatar;
@ApiModelProperty("欢迎语")
private String welcomeMessage;
@ApiModelProperty("新会话提示音(1开启2关闭)")
private Integer promptVoice;
@ApiModelProperty("新消息提示音(1开启2关闭)")
private Integer messageVoice;
@ApiModelProperty("输入时自动联想快捷回复(1开启2关闭)")
private Integer recommendAnswer;
@ApiModelProperty("会话列表顺序(1:按会话转入人工客服的时间顺序2:按会话等待回复时长)")
private Long sessionSort;
@ApiModelProperty("(1正常2删除)")
private Integer delStatus;
@ApiModelProperty("(1正常2删除)")
private Long updateId;
public Long getSetUserId() {
return this.setUserId;
}
public void setSetUserId(Long setUserId) {
this.setUserId = setUserId;
}
public Long getCompanyId() {
return this.companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Long getUserId() {
return this.userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getNickname() {
return this.nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getAvatar() {
return this.avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getWelcomeMessage() {
return this.welcomeMessage;
}
public void setWelcomeMessage(String welcomeMessage) {
this.welcomeMessage = welcomeMessage;
}
public Integer getPromptVoice() {
return this.promptVoice;
}
public void setPromptVoice(Integer promptVoice) {
this.promptVoice = promptVoice;
}
public Integer getMessageVoice() {
return messageVoice;
}
public void setMessageVoice(Integer messageVoice) {
this.messageVoice = messageVoice;
}
public Integer getRecommendAnswer() {
return this.recommendAnswer;
}
public void setRecommendAnswer(Integer recommendAnswer) {
this.recommendAnswer = recommendAnswer;
}
public Long getSessionSort() {
return this.sessionSort;
}
public void setSessionSort(Long sessionSort) {
this.sessionSort = sessionSort;
}
public Integer getDelStatus() {
return this.delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
public Long getUpdateId() {
return updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
}

View File

@@ -0,0 +1,179 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
public class SetUserRespDto {
@Id
private Long setUserId;
@ApiModelProperty("公司编号")
private Long companyId;
@ApiModelProperty("客服编号")
private Long userId;
@ApiModelProperty("昵称")
private String nickname;
@ApiModelProperty("头像")
private String avatar;
@ApiModelProperty("欢迎语")
private String welcomeMessage;
@ApiModelProperty("新会话提示音(1开启2关闭)")
private Integer promptVoice;
@ApiModelProperty("新消息提示音(1开启2关闭)")
private Integer messageVoice;
@ApiModelProperty("输入时自动联想快捷回复(1开启2关闭)")
private Integer recommendAnswer;
@ApiModelProperty("会话列表顺序(1:按会话转入人工客服的时间顺序2:按会话等待回复时长)")
private Long sessionSort;
@ApiModelProperty("(1正常2删除)")
private Integer delStatus;
@ApiModelProperty("创建者")
private Long createId;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新者")
private Long updateId;
@ApiModelProperty("更新时间")
private Long updateTime;
public Long getSetUserId() {
return this.setUserId;
}
public void setSetUserId(Long setUserId) {
this.setUserId = setUserId;
}
public Long getCompanyId() {
return this.companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Long getUserId() {
return this.userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getNickname() {
return this.nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getAvatar() {
return this.avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getWelcomeMessage() {
return this.welcomeMessage;
}
public void setWelcomeMessage(String welcomeMessage) {
this.welcomeMessage = welcomeMessage;
}
public Integer getPromptVoice() {
return this.promptVoice;
}
public void setPromptVoice(Integer promptVoice) {
this.promptVoice = promptVoice;
}
public Integer getMessageVoice() {
return messageVoice;
}
public void setMessageVoice(Integer messageVoice) {
this.messageVoice = messageVoice;
}
public Integer getRecommendAnswer() {
return this.recommendAnswer;
}
public void setRecommendAnswer(Integer recommendAnswer) {
this.recommendAnswer = recommendAnswer;
}
public Long getSessionSort() {
return this.sessionSort;
}
public void setSessionSort(Long sessionSort) {
this.sessionSort = sessionSort;
}
public Integer getDelStatus() {
return this.delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
public Long getCreateId() {
return this.createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Long getCreateTime() {
return this.createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateId() {
return this.updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public Long getUpdateTime() {
return this.updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -0,0 +1,73 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "UserEditReqDto", description = "运维编辑信息DTO")
public class UserEditReqDto {
@ApiModelProperty("租户Id")
private Long companyId;
@ApiModelProperty("用户Id")
private Long userId;
@ApiModelProperty(value = "是否为Vip 0:否 1:是")
private Integer isVip;
@ApiModelProperty("角色ID")
private Long roleId;
@ApiModelProperty("-1:删除 0:正常 1:禁用")
private Integer status;
@ApiModelProperty("操作人ID")
private Long currentUserId;
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Integer getIsVip() {
return isVip;
}
public void setIsVip(Integer isVip) {
this.isVip = isVip;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getCurrentUserId() {
return currentUserId;
}
public void setCurrentUserId(Long currentUserId) {
this.currentUserId = currentUserId;
}
}

View File

@@ -0,0 +1,205 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Id;
public class UserReqDto {
@ApiModelProperty("用户Id")
private Long userId;
@ApiModelProperty("公司Id")
private Long companyId;
@ApiModelProperty("用户编号")
private String userCode;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("联系方式")
private String telephone;
@ApiModelProperty("邮箱")
private String email;
@ApiModelProperty("登录密码")
private String password;
@ApiModelProperty("最大服务数")
private Integer maxService;
@ApiModelProperty("用户类型")
private Integer userType;
@ApiModelProperty("角色ID")
private Long roleId;
@ApiModelProperty("是否是管理员")
private Integer adminFlag;
@ApiModelProperty("-1:删除 0:正常 1:禁用")
private Integer status;
@ApiModelProperty("当前登录者")
private Long loginUserId;
@ApiModelProperty("备用字段1")
private String field1;
@ApiModelProperty("备用字段2")
private String field2;
@ApiModelProperty("备用字段3")
@Column(name="field3")
private String field3;
@ApiModelProperty("备用字段4")
private String field4;
@ApiModelProperty("备用字段5")
private String field5;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Integer getMaxService() {
return maxService;
}
public void setMaxService(Integer maxService) {
this.maxService = maxService;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getField1() {
return field1;
}
public void setField1(String field1) {
this.field1 = field1;
}
public String getField2() {
return field2;
}
public void setField2(String field2) {
this.field2 = field2;
}
public String getField3() {
return field3;
}
public void setField3(String field3) {
this.field3 = field3;
}
public String getField4() {
return field4;
}
public void setField4(String field4) {
this.field4 = field4;
}
public String getField5() {
return field5;
}
public void setField5(String field5) {
this.field5 = field5;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Long getLoginUserId() {
return loginUserId;
}
public void setLoginUserId(Long loginUserId) {
this.loginUserId = loginUserId;
}
public Integer getUserType() {
return userType;
}
public void setUserType(Integer userType) {
this.userType = userType;
}
public Integer getAdminFlag() {
return adminFlag;
}
public void setAdminFlag(Integer adminFlag) {
this.adminFlag = adminFlag;
}
}

View File

@@ -0,0 +1,324 @@
package com.qizhi.business.com.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Id;
public class UserRespDto {
@Id
private Long userId;
@ApiModelProperty("公司Id")
private Long companyId;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("邮箱")
private String email;
@ApiModelProperty(value = "移动电话")
private String mobile;
@ApiModelProperty("联系方式")
private String telephone;
@ApiModelProperty("IDM登录名 唯一性判重字段")
private String loginId;
@ApiModelProperty(value = "是否为Vip 0:否 1:是")
private Integer isVip;
// @ApiModelProperty("登录密码")
// private String password;
// @ApiModelProperty("最大服务数")
// private Integer maxService;
// @ApiModelProperty("用户类型")
// private Integer userType;
@ApiModelProperty("分部id")
private Long idmCompanyId;
@ApiModelProperty("分部编号")
private String idmCompanyCode;
@ApiModelProperty("部门编号")
private String idmDepartmentCode;
@ApiModelProperty("岗位编号")
private String idmPositionCode;
@ApiModelProperty("分部名称")
private String idmCompanyName;
@ApiModelProperty("分部全称")
private String idmCompanyFullName;
@ApiModelProperty("部门名称")
private String idmDepartmentName;
@ApiModelProperty("岗位名称")
private String idmPositionName;
@ApiModelProperty("用户状态")
@Column(name="emp_status")
private String empStatus;
@ApiModelProperty("角色ID")
private Long roleId;
@ApiModelProperty("-1:删除 0:正常 1:禁用")
private Integer status;
@ApiModelProperty("创建者")
private Long createId;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新者")
private Long updateId;
@ApiModelProperty("更新时间")
private Long updateTime;
// @ApiModelProperty("备用字段1")
// private String field1;
//
// @ApiModelProperty("备用字段2")
// private String field2;
//
// @ApiModelProperty("备用字段3")
// private String field3;
//
// @ApiModelProperty("备用字段4")
// private String field4;
//
// @ApiModelProperty("备用字段5")
// private String field5;
@ApiModelProperty("角色名字")
private String roleName;
// @ApiModelProperty("是否是管理员")
// private Integer adminFlag;
@ApiModelProperty("个人信息设置")
private SetUserRespDto userSetInfo;
//
@ApiModelProperty("工作状态")
private String workStatus;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getLoginId() {
return loginId;
}
public void setLoginId(String loginId) {
this.loginId = loginId;
}
public Integer getIsVip() {
return isVip;
}
public void setIsVip(Integer isVip) {
this.isVip = isVip;
}
public Long getIdmCompanyId() {
return idmCompanyId;
}
public void setIdmCompanyId(Long idmCompanyId) {
this.idmCompanyId = idmCompanyId;
}
public String getIdmCompanyCode() {
return idmCompanyCode;
}
public void setIdmCompanyCode(String idmCompanyCode) {
this.idmCompanyCode = idmCompanyCode;
}
public String getIdmDepartmentCode() {
return idmDepartmentCode;
}
public void setIdmDepartmentCode(String idmDepartmentCode) {
this.idmDepartmentCode = idmDepartmentCode;
}
public String getIdmPositionCode() {
return idmPositionCode;
}
public void setIdmPositionCode(String idmPositionCode) {
this.idmPositionCode = idmPositionCode;
}
public String getIdmCompanyName() {
return idmCompanyName;
}
public void setIdmCompanyName(String idmCompanyName) {
this.idmCompanyName = idmCompanyName;
}
public String getIdmCompanyFullName() {
return idmCompanyFullName;
}
public void setIdmCompanyFullName(String idmCompanyFullName) {
this.idmCompanyFullName = idmCompanyFullName;
}
public String getIdmDepartmentName() {
return idmDepartmentName;
}
public void setIdmDepartmentName(String idmDepartmentName) {
this.idmDepartmentName = idmDepartmentName;
}
public String getIdmPositionName() {
return idmPositionName;
}
public void setIdmPositionName(String idmPositionName) {
this.idmPositionName = idmPositionName;
}
public String getEmpStatus() {
return empStatus;
}
public void setEmpStatus(String empStatus) {
this.empStatus = empStatus;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getCreateId() {
return createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateId() {
return updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public String getWorkStatus() {
return workStatus;
}
public void setWorkStatus(String workStatus) {
this.workStatus = workStatus;
}
public SetUserRespDto getUserSetInfo() {
return userSetInfo;
}
public void setUserSetInfo(SetUserRespDto userSetInfo) {
this.userSetInfo = userSetInfo;
}
}

View File

@@ -0,0 +1 @@
e6cf4160-17f8-4ca8-aa40-c7cd2f8a2658

View File

@@ -0,0 +1,208 @@
package com.qizhi.business.com.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
@ApiModel("公司表")
@Table(name = "company")
public class Company implements Serializable {
@Id
@ApiModelProperty("公司Id")
@Column(name="company_id")
private Long companyId;
@ApiModelProperty("公司编号")
@Column(name="company_code")
private String companyCode;
@ApiModelProperty("邮箱")
@Column(name="email")
private String email;
@ApiModelProperty("登录密码")
@Column(name="password")
private String password;
@ApiModelProperty("公司名称")
@Column(name="name")
private String name;
@ApiModelProperty("联系方式")
@Column(name="telephone")
private String telephone;
@ApiModelProperty("可添加在线客服数")
@Column(name="customer")
private Long customer;
@ApiModelProperty("可添加工单客服数")
@Column(name="work_order")
private Long workOrder;
@ApiModelProperty("-1:删除 0:正常 1:禁用")
@Column(name="status")
private Integer status;
@ApiModelProperty("创建者")
@Column(name="create_id")
private Long createId;
@ApiModelProperty("创建时间")
@Column(name="create_time")
private Long createTime;
@ApiModelProperty("更新者")
@Column(name="update_id")
private Long updateId;
@ApiModelProperty("更新时间")
@Column(name="update_time")
private Long updateTime;
@ApiModelProperty("备注")
@Column(name="remark")
private String remark;
@ApiModelProperty("到期时间")
@Column(name="due_time")
private Long dueTime;
@ApiModelProperty("是否登录过(0:未登录 1:已登录)")
@Column(name="is_login")
private Integer isLogin;
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getCompanyCode() {
return companyCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public Long getCustomer() {
return customer;
}
public void setCustomer(Long customer) {
this.customer = customer;
}
public Long getworkOrder() {
return workOrder;
}
public void setworkOrder(Long workOrder) {
this.workOrder = workOrder;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getCreateId() {
return createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateId() {
return updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Long getDueTime() {
return dueTime;
}
public void setDueTime(Long dueTime) {
this.dueTime = dueTime;
}
public Integer getIsLogin() {
return isLogin;
}
public void setIsLogin(Integer isLogin) {
this.isLogin = isLogin;
}
}

View File

@@ -0,0 +1,141 @@
package com.qizhi.business.com.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @date Tue Feb 12 16:10:18 CST 2019
*/
@Table(name = "com_permission")
@ApiModel("权限表")
public class Permission implements Serializable {
@Id
@Column(name="permission_id")
private Long permissionId;
@ApiModelProperty("菜单按钮名称")
@Column(name="name")
private String name;
@ApiModelProperty("菜单按钮英文名称")
@Column(name="en_name")
private String enName;
@ApiModelProperty("图标")
@Column(name="icon")
private String icon;
@ApiModelProperty("对应路由path")
@Column(name="routePath")
private String routePath;
@ApiModelProperty("对应路由组件component")
@Column(name="component")
private String component;
@ApiModelProperty("父级ID")
@Column(name="parent_id")
private Long parentId;
@ApiModelProperty("类型1:menu,2:button)")
@Column(name="type")
private Integer type;
@ApiModelProperty("排序")
@Column(name="sequence")
private Integer sequence;
@ApiModelProperty("(1正常2删除)")
@Column(name="del_status")
private Integer delStatus;
public Long getPermissionId() {
return this.permissionId;
}
public void setPermissionId(Long permissionId) {
this.permissionId = permissionId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public Long getParentId() {
return this.parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public Integer getType() {
return this.type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getSequence() {
return this.sequence;
}
public void setSequence(Integer sequence) {
this.sequence = sequence;
}
public Integer getDelStatus() {
return this.delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
public String getEnName() {
return enName;
}
public void setEnName(String enName) {
this.enName = enName;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getRoutePath() {
return routePath;
}
public void setRoutePath(String routePath) {
this.routePath = routePath;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
}

View File

@@ -0,0 +1,127 @@
package com.qizhi.business.com.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @date Tue Feb 12 16:10:18 CST 2019
*/
@Table(name = "com_role")
@ApiModel("角色表")
public class Role implements Serializable {
@Id
@Column(name="role_id")
private Long roleId;
@ApiModelProperty("公司ID")
@Column(name="company_id")
private Long companyId;
@ApiModelProperty("角色编号")
@Column(name="role_code")
private String roleCode;
@ApiModelProperty("角色名称")
@Column(name="role_name")
private String roleName;
@ApiModelProperty("(1正常2删除)")
@Column(name="del_status")
private Integer delStatus;
@ApiModelProperty("创建者")
@Column(name="create_id")
private Long createId;
@ApiModelProperty("创建时间")
@Column(name="create_time")
private Long createTime;
@ApiModelProperty("更新者")
@Column(name="update_id")
private Long updateId;
@ApiModelProperty("更新时间")
@Column(name="update_time")
private Long updateTime;
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getCompanyId() {
return this.companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getRoleName() {
return this.roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public Integer getDelStatus() {
return this.delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
public Long getCreateId() {
return this.createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Long getCreateTime() {
return this.createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateId() {
return this.updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public Long getUpdateTime() {
return this.updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getRoleCode() {
return roleCode;
}
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
}

View File

@@ -0,0 +1,44 @@
package com.qizhi.business.com.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @date Tue Feb 12 16:10:18 CST 2019
*/
@Table(name = "com_role_permission")
@ApiModel("角色权限关系表")
public class RolePermission implements Serializable {
@Id
@ApiModelProperty("角色id")
@Column(name="role_id")
private Long roleId;
@ApiModelProperty("权限id")
@Column(name="permission_id")
private Long permissionId;
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getPermissionId() {
return this.permissionId;
}
public void setPermissionId(Long permissionId) {
this.permissionId = permissionId;
}
}

View File

@@ -0,0 +1,198 @@
package com.qizhi.business.com.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.*;
import java.io.Serializable;
/**
* @date Tue Feb 12 16:10:18 CST 2019
*/
@Table(name = "com_set_user")
@ApiModel("个人设置")
public class SetUser implements Serializable {
@Id
@Column(name="set_user_id")
@GeneratedValue(generator = "JDBC")
private Long setUserId;
@ApiModelProperty("公司编号")
@Column(name="company_id")
private Long companyId;
@ApiModelProperty("客服编号")
@Column(name="user_id")
private Long userId;
@ApiModelProperty("昵称")
@Column(name="nickname")
private String nickname;
@ApiModelProperty("头像")
@Column(name="avatar")
private String avatar;
@ApiModelProperty("欢迎语")
@Column(name="welcome_message")
private String welcomeMessage;
@ApiModelProperty("新会话提示音(1开启2关闭)")
@Column(name="prompt_voice")
private Integer promptVoice;
@ApiModelProperty("新消息提示音(1开启2关闭)")
@Column(name="message_voice")
private Integer messageVoice;
@ApiModelProperty("输入时自动联想快捷回复(1开启2关闭)")
@Column(name="recommend_answer")
private Integer recommendAnswer;
@ApiModelProperty("会话列表顺序(1:按会话转入人工客服的时间顺序2:按会话等待回复时长)")
@Column(name="session_sort")
private Long sessionSort;
@ApiModelProperty("(1正常2删除)")
@Column(name="del_status")
private Integer delStatus;
@ApiModelProperty("创建者")
@Column(name="create_id")
private Long createId;
@ApiModelProperty("创建时间")
@Column(name="create_time")
private Long createTime;
@ApiModelProperty("更新者")
@Column(name="update_id")
private Long updateId;
@ApiModelProperty("更新时间")
@Column(name="update_time")
private Long updateTime;
public Long getSetUserId() {
return this.setUserId;
}
public void setSetUserId(Long setUserId) {
this.setUserId = setUserId;
}
public Long getCompanyId() {
return this.companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Long getUserId() {
return this.userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getNickname() {
return this.nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getAvatar() {
return this.avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getWelcomeMessage() {
return this.welcomeMessage;
}
public void setWelcomeMessage(String welcomeMessage) {
this.welcomeMessage = welcomeMessage;
}
public Integer getPromptVoice() {
return this.promptVoice;
}
public void setPromptVoice(Integer promptVoice) {
this.promptVoice = promptVoice;
}
public Integer getMessageVoice() {
return messageVoice;
}
public void setMessageVoice(Integer messageVoice) {
this.messageVoice = messageVoice;
}
public Integer getRecommendAnswer() {
return this.recommendAnswer;
}
public void setRecommendAnswer(Integer recommendAnswer) {
this.recommendAnswer = recommendAnswer;
}
public Long getSessionSort() {
return this.sessionSort;
}
public void setSessionSort(Long sessionSort) {
this.sessionSort = sessionSort;
}
public Integer getDelStatus() {
return this.delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
public Long getCreateId() {
return this.createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Long getCreateTime() {
return this.createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateId() {
return this.updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public Long getUpdateTime() {
return this.updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -0,0 +1,257 @@
package com.qizhi.business.com.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @date Tue Feb 12 16:10:18 CST 2019
*/
@ApiModel("用户表")
@Table(name = "com_user")
public class User implements Serializable {
@Id
@Column(name="user_id")
private Long userId;
@ApiModelProperty("租户ID")
@Column(name="company_id")
private Long companyId;
@ApiModelProperty("姓名")
@Column(name="name")
private String name;
@ApiModelProperty("邮箱")
@Column(name="email")
private String email;
@ApiModelProperty(value = "移动电话")
@Column(name="mobile")
private String mobile;
@ApiModelProperty("办公电话")
@Column(name="telephone")
private String telephone;
@ApiModelProperty("IDM登录名 唯一性判重字段")
@Column(name="login_id")
private String loginId;
@ApiModelProperty("登录密码")
@Column(name="password")
private String password;
@ApiModelProperty(value = "是否为Vip 0:否 1:是")
@Column(name="is_vip")
private Integer isVip;
@ApiModelProperty("分部编号")
@Column(name="idm_company_code")
private String idmCompanyCode;
@ApiModelProperty("部门编号")
@Column(name="idm_department_code")
private String idmDepartmentCode;
@ApiModelProperty("岗位编号")
@Column(name="idm_position_code")
private String idmPositionCode;
@ApiModelProperty("在职/离职")
@Column(name="emp_status")
private String empStatus;
@ApiModelProperty("用户状态 ENABLE生效 DISABLE失效")
@Column(name="customer_status")
private String customerStatus;
@ApiModelProperty("角色ID")
@Column(name="role_id")
private Long roleId;
@ApiModelProperty("-1:删除 0:正常 1:禁用")
@Column(name="status")
private Integer status;
@ApiModelProperty("创建者")
@Column(name="create_id")
private Long createId;
@ApiModelProperty("创建时间")
@Column(name="create_time")
private Long createTime;
@ApiModelProperty("更新者")
@Column(name="update_id")
private Long updateId;
@ApiModelProperty("更新时间")
@Column(name="update_time")
private Long updateTime;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getLoginId() {
return loginId;
}
public void setLoginId(String loginId) {
this.loginId = loginId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Integer getIsVip() {
return isVip;
}
public void setIsVip(Integer isVip) {
this.isVip = isVip;
}
public String getIdmCompanyCode() {
return idmCompanyCode;
}
public void setIdmCompanyCode(String idmCompanyCode) {
this.idmCompanyCode = idmCompanyCode;
}
public String getIdmDepartmentCode() {
return idmDepartmentCode;
}
public void setIdmDepartmentCode(String idmDepartmentCode) {
this.idmDepartmentCode = idmDepartmentCode;
}
public String getIdmPositionCode() {
return idmPositionCode;
}
public void setIdmPositionCode(String idmPositionCode) {
this.idmPositionCode = idmPositionCode;
}
public String getEmpStatus() {
return empStatus;
}
public void setEmpStatus(String empStatus) {
this.empStatus = empStatus;
}
public String getCustomerStatus() {
return customerStatus;
}
public void setCustomerStatus(String customerStatus) {
this.customerStatus = customerStatus;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getCreateId() {
return createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateId() {
return updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -0,0 +1 @@
c186d9a6-ff2e-48e2-83be-e8ba4cf086b2

View File

@@ -0,0 +1,29 @@
package com.qizhi.business.com.entity.router;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
/**
* Vue路由 Meta
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RouterMeta implements Serializable {
private static final long serialVersionUID = 5499925008927195914L;
private String title;
public RouterMeta(String title){
this.title = title;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}

View File

@@ -0,0 +1,163 @@
package com.qizhi.business.com.entity.router;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 构建 Vue路由
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VuePermission<T> implements Serializable {
private static final long serialVersionUID = -3327478146308500708L;
private Long id;
private Long parentId;
private String path;
private String name;
private String enName;
private Integer type;
private String component;
private Integer sequence;
private String icon;
private String redirect;
private RouterMeta meta;
private List<VuePermission<T>> children;
@JsonIgnore
private boolean hasParent = false;
@JsonIgnore
private boolean hasChildren = false;
public void initChildren(){
this.children = new ArrayList<>();
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getRedirect() {
return redirect;
}
public void setRedirect(String redirect) {
this.redirect = redirect;
}
public RouterMeta getMeta() {
return meta;
}
public void setMeta(RouterMeta meta) {
this.meta = meta;
}
public List<VuePermission<T>> getChildren() {
return children;
}
public void setChildren(List<VuePermission<T>> children) {
this.children = children;
}
public boolean isHasParent() {
return hasParent;
}
public void setHasParent(boolean hasParent) {
this.hasParent = hasParent;
}
public boolean isHasChildren() {
return hasChildren;
}
public void setHasChildren(boolean hasChildren) {
this.hasChildren = hasChildren;
}
public String getEnName() {
return enName;
}
public void setEnName(String enName) {
this.enName = enName;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getSequence() {
return sequence;
}
public void setSequence(Integer sequence) {
this.sequence = sequence;
}
}

View File

@@ -0,0 +1,139 @@
package com.qizhi.business.com.entity.router;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 构建 Vue路由
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VueRouter<T> implements Serializable {
private static final long serialVersionUID = -3327478146308500708L;
@JsonIgnore
private Long id;
@JsonIgnore
private Long parentId;
private String path;
private String name;
private String component;
private String icon;
private String redirect;
private RouterMeta meta;
private List<VueRouter<T>> children;
@JsonIgnore
private boolean hasParent = false;
@JsonIgnore
private boolean hasChildren = false;
public void initChildren(){
this.children = new ArrayList<>();
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getRedirect() {
return redirect;
}
public void setRedirect(String redirect) {
this.redirect = redirect;
}
public RouterMeta getMeta() {
return meta;
}
public void setMeta(RouterMeta meta) {
this.meta = meta;
}
public List<VueRouter<T>> getChildren() {
return children;
}
public void setChildren(List<VueRouter<T>> children) {
this.children = children;
}
public boolean isHasParent() {
return hasParent;
}
public void setHasParent(boolean hasParent) {
this.hasParent = hasParent;
}
public boolean isHasChildren() {
return hasChildren;
}
public void setHasChildren(boolean hasChildren) {
this.hasChildren = hasChildren;
}
}

View File

@@ -0,0 +1 @@
ce964abc-d940-4418-a023-29f700b19eca

View File

@@ -0,0 +1,23 @@
package com.qizhi.business.com.mapper;
import com.qizhi.business.com.entity.Company;
import com.qizhi.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface CompanyMapper extends SuperMapper<Company> {
@Select("select * from company where status = 0")
List<Company> getCompanyList();
@Select("select * from company where telephone = #{tel} and status = 0")
Company findByTel(@Param("tel") String tel);
@Select("select * from company where company_code = #{companyCode} and status = 0 ")
Company findByCode(@Param("companyCode") String companyCode);
}

View File

@@ -0,0 +1,93 @@
package com.qizhi.business.com.mapper;
import com.qizhi.business.com.entity.Permission;
import com.qizhi.business.com.entity.User;
import com.qizhi.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Mapper
public interface PermissionMapper extends SuperMapper<Permission> {
/**
* 根据客服ids查询启用的客服列表
* @param roleId
* @return
*/
@MapKey( "roleId" )
@Select(" <script>" +
"select p.*" +
" from com_permission p" +
" where p.type = 1" +
" and p.permission_id in" +
" (select distinct rp.permission_id" +
" from com_role_permission rp" +
" where rp.role_id = #{roleId})" +
" order by p.sequence" +
" </script>" )
List<Permission> findRoleMenus(@Param( "roleId" ) Long roleId);
/**
* 根据用户id查询权限按钮
* @param companyId
* @param userId
* @return
*/
@Select(" <script>" +
"SELECT " +
" p.en_name " +
"FROM " +
" com_permission p " +
" INNER JOIN com_role_permission rp ON p.permission_id = rp.permission_id " +
" INNER JOIN com_user u ON u.role_id = rp.role_id " +
"WHERE " +
" u.company_id = #{companyId} " +
" AND u.user_id = #{userId} " +
" AND p.del_status = 1 " +
" AND p.type =2 " +
"</script>" )
List<String> queryButtonDataByUserId(@Param( "companyId" )Long companyId,@Param( "userId" )Long userId);
/**
* 获得所有的权限数据
* @return
*/
@Select(" <script>" +
"select p.*" +
" from com_permission p" +
" where p.del_status = 1" +
" order by p.sequence" +
" </script>" )
List<Permission> findAllPermission();
/**
* 根据用户id查询权限菜单数据
* @param companyId
* @param userId
* @return
*/
@Select(" <script>" +
"SELECT " +
" p.routePath " +
"FROM " +
" com_permission p " +
" INNER JOIN com_role_permission rp ON p.permission_id = rp.permission_id " +
" INNER JOIN com_user u ON u.role_id = rp.role_id " +
"WHERE " +
" u.company_id = #{companyId} " +
" AND u.user_id = #{userId} " +
" AND p.del_status = 1 " +
" AND p.type =1 " +
"</script>" )
List<String> queryMenuDataByUserId(@Param( "companyId" )Long companyId,@Param( "userId" )Long userId);
}

View File

@@ -0,0 +1,10 @@
package com.qizhi.business.com.mapper;
import com.qizhi.business.com.entity.SetUser;
import com.qizhi.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PersonalSetMapper extends SuperMapper<SetUser> {
}

View File

@@ -0,0 +1,11 @@
package com.qizhi.business.com.mapper;
import com.qizhi.business.com.entity.Role;
import com.qizhi.business.com.entity.RolePermission;
import com.qizhi.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface RoleMapper extends SuperMapper<Role> {
}

View File

@@ -0,0 +1,19 @@
package com.qizhi.business.com.mapper;
import com.qizhi.business.com.entity.RolePermission;
import com.qizhi.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface RolePermissionMapper extends SuperMapper<RolePermission> {
@Delete("delete from com_role_permission where role_id=#{roleId}")
Integer deletePermissionByRoleId(Long roleId);
@Select("select * from com_role_permission where role_id=#{roleId}")
List<RolePermission> getPermissionByRoleId(Long roleId);
}

View File

@@ -0,0 +1,218 @@
package com.qizhi.business.com.mapper;
import com.qizhi.business.com.dto.AcceptUserDto;
import com.qizhi.business.com.dto.UserEditReqDto;
import com.qizhi.business.com.entity.User;
import com.qizhi.business.customer.dto.SelectDto;
import com.qizhi.business.customer.entity.IDMCustomer;
import com.qizhi.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Mapper
public interface UserMapper extends SuperMapper<User> {
@Select("select * from com_user where email = #{email} and company_id = #{companyId} and status != -1")
User getUserByEmailAndCompanyCode(@Param("email")String email, @Param("companyId")Long companyId);
/**
* 用户姓名,工号模糊列表查询
* @param ctsNameOrCtsNo
* @param companyId
* @return
*/
@Select("select * from com_user where " +
"((name like concat(concat('%',#{ctsNameOrCtsNo}),'%')) or " +
"(user_code like concat(concat('%',#{ctsNameOrCtsNo}),'%'))) " +
"and company_id = #{companyId} and status != -1 ")
List<User> getUserByRoleNameOrNo(@Param("ctsNameOrCtsNo") String ctsNameOrCtsNo,@Param("companyId") Long companyId);
/**
* 用户姓名,工号模糊列表查询在线客服
* @param ctsNameOrCtsNo
* @param companyId
* @return
*/
@Select("select * from com_user where " +
"((name like concat(concat('%',#{ctsNameOrCtsNo}),'%')) or " +
"(user_code like concat(concat('%',#{ctsNameOrCtsNo}),'%'))) " +
"and company_id = #{companyId} and status = 0 ")
List<User> getKefuByUserNameOrNo(@Param("ctsNameOrCtsNo") String ctsNameOrCtsNo,@Param("companyId") Long companyId);
/**
* 根据客服ids查询启用的客服列表
* @param userIdList
* @return
*/
@MapKey( "userId" )
@Select(" <script>" +
" select * from com_user where 1=1" +
" AND status = 0 " +
" AND user_id in " +
" <foreach collection='userIdList' item='userId' open='(' separator=',' close=')'>" +
" #{userId} " +
" </foreach>" +
" </script>" )
@ResultType( LinkedHashMap.class )
Map<Long,User> getAbleUserMapByIds(@Param( "userIdList" ) List<Long> userIdList);
@MapKey( "userId" )
@Select(" <script>" +
" select * from com_user where 1=1" +
" AND user_id in " +
" <foreach collection='userIdList' item='userId' open='(' separator=',' close=')'>" +
" #{userId} " +
" </foreach>" +
" </script>" )
@ResultType( LinkedHashMap.class )
Map<Long,User> getUserMapByIds(@Param( "userIdList" ) List<Long> userIdList);
@MapKey( "userId" )
@Select(" <script>" +
" select * from com_user where 1=1" +
" AND status = 0 " +
" AND login_id in " +
" <foreach collection='loginIdList' item='loginId' open='(' separator=',' close=')'>" +
" #{loginId} " +
" </foreach>" +
" </script>" )
@ResultType( LinkedHashMap.class )
Map<Long, User> getAbleUserMapByLoginIds(@Param("loginIdList")List<String> loginIdList);
@Select(" <script>" +
" select user_id from com_user where 1=1" +
" AND status = 0 " +
" AND user_id in " +
" <foreach collection='userIdList' item='userId' open='(' separator=',' close=')'>" +
" #{userId} " +
" </foreach>" +
" </script>" )
List<Long> getAbleUserIdListByIds(@Param( "userIdList" ) List<Long> userIdList);
/**
* 根据客服ids查询启用的客服列表
* @param ids
* @return
*/
@MapKey( "userId" )
@Select(" <script>" +
" select * from com_user where 1=1" +
" AND user_id in " +
" <foreach collection='ids' item='userId' open='(' separator=',' close=')'>" +
" #{userId} " +
" </foreach>" +
" </script>" )
Map<Long,User> getUserByIds(@Param( "ids" )List<Long> ids);
@Select(" select * from com_user where 1=1 " +
" and company_id = #{companyId}")
List<User> getUserByCompanyId(Long companyId);
@Select(" select * from com_user where 1=1 " +
" and telephone = #{tel}")
User getUserByTel(String tel);
/**
* 列表数据查询
* @param companyId
* @param searchData
* @param currentStatus
* @return
*/
@Select("<script>" +
"SELECT " +
" * " +
"FROM " +
" com_user cu " +
"WHERE " +
" company_id = #{companyId} and status = 0 " +
" <if test=\"searchData!=null and searchData!=''\">AND (user_code like concat(concat('%',#{searchData}),'%') or name like concat(concat('%',#{searchData}),'%')) </if>" +
" <if test=\"currentStatus!=null and currentStatus!=''\">" +
"<if test='currentStatus!=\"D\"'>" +
"AND EXISTS(SELECT 1 from route_online_status_record r WHERE company_id= #{companyId} and cu.user_id=r.user_id and r.current_status=#{currentStatus} ) " +
"</if>" +
"<if test='currentStatus==\"D\"'>" +
"AND ( EXISTS(SELECT 1 from route_online_status_record r WHERE company_id= #{companyId} and cu.user_id=r.user_id and r.current_status=#{currentStatus} ) or NOT EXISTS(SELECT 1 from route_online_status_record r WHERE company_id= #{companyId} and cu.user_id=r.user_id) )" +
"</if>" +
"</if>" +
"</script>")
List<User> queryUserInfoFromMonitor(@Param( "companyId" )Long companyId,@Param( "searchData" ) String searchData,@Param( "currentStatus" ) String currentStatus);
/**
* 获取所有User
* @return
*/
@Select("select * from com_user where 1 = 1 ")
List<User> getAllUser();
/**
* 根据多个userId查询列表
* @param ids
* @return
*/
@Select(" <script>" +
" select * from com_user where 1=1" +
" AND user_id in " +
" <foreach collection='ids' item='userId' open='(' separator=',' close=')'>" +
" #{userId} " +
" </foreach>" +
" </script>" )
List<User> findByUserIds(@Param( "ids" ) List<Long> ids);
/**
* 根据租户id查询主账号信息
* @param companyIds
* @return
*/
@Select(" <script>" +
" select user_id from com_user where 1=1 and admin_flag=1 and status=0" +
" AND company_id in " +
" <foreach collection='companyIds' item='companyId' open='(' separator=',' close=')'>" +
" #{companyId} " +
" </foreach>" +
" </script>" )
List<Long> findMainUserId(@Param( "companyIds" ) List<Long> companyIds);
@Update({
" <script>",
" update com_user ",
" set name = #{userName}, ",
" email = #{email}, ",
" mobile = #{mobile}, ",
" telephone = #{telephone}, ",
" idm_company_code = #{subCompanyCode}, ",
" idm_department_code = #{departmentCode}, ",
" idm_position_code = #{positionCode}, ",
" emp_status = #{empStatus}, ",
" customer_status = #{status} ",
"<if test=\"status=='DISABLE'\">,status=1</if>",
"<if test=\"status=='ENABLE'\">,status=0</if>",
" where login_id = #{loginId} ",
" </script>"
})
void updateByIDMCustomer(IDMCustomer idmCustomer);
@Update({
" update com_user ",
" set is_vip = #{isVip}, ",
" role_id = #{roleId}, ",
" status = #{status}, ",
" update_id = #{currentUserId}, ",
" update_time = REPLACE(unix_timestamp(current_timestamp(3)),'.','') ",
" where user_id = #{userId} and company_id = #{companyId} "
})
int editUserInfo(UserEditReqDto userEditReqDto);
@Select({
" <script>",
" select * from com_user where status=0 ",
"<if test=\" keyword!=null and keyword!='' \"> and name like concat(concat('%',#{keyword}),'%') </if>",
"<if test=\" isVip!=null \"> and is_vip = #{isVip} </if>",
"<if test=\" subCompanyCode!=null and subCompanyCode!='' \"> and idm_company_code = #{subCompanyCode} </if>",
" </script>"
})
List<User> getAcceptUserForSet(@Param("keyword")String keyword, @Param("isVip")Integer isVip,@Param("subCompanyCode")String subCompanyCode);
}

View File

@@ -0,0 +1 @@
602146c3-5d38-4700-8f54-d85ad585f3a5

View File

@@ -0,0 +1,112 @@
package com.qizhi.business.com.service;
import com.github.pagehelper.PageInfo;
import com.qizhi.business.com.dto.CompanyRespDto;
import com.qizhi.business.com.entity.Company;
import com.qizhi.common.core.service.SuperService;
import tk.mybatis.mapper.entity.Condition;
import java.util.List;
public interface CompanyService extends SuperService<Company> {
/**
*账户信息
* @param companyId
* @return
*/
CompanyRespDto getCompanyById(Long companyId);
/**
* 客户管理的查询
* @param pageInfo
* @return
*/
PageInfo getAllCustomer(PageInfo pageInfo);
/**
* 查找已注册公司
* @return
*/
List<Company> getCompanyList();
/**
* 根据邮箱查找已注册公司数
* @param email
* @return
*/
Integer getCompanyCountByEmail(String email);
/**
* 根据手机查找已注册公司数
* @param tel
* @return
*/
Integer getCompanyCountByTel(String tel);
/**
* 根据手机号查询公司
* @param tel
* @return
*/
Company findByTel(String tel);
/**
* 根据公司Code查询公司
* @param companyCode
* @return
*/
Company findByCompanyCode(String companyCode);
/**
* 处理公司定时任务
* 当因为到期或人工更改的原因,
* 导致已添加的在线或工单客服的数量大于可添加的数量上限时,
* 系统自动将超出数量的在线或工单客服子账号失效,
* 账号失效的顺序按照账号创建的时间降序依次进行,
* 直到已添加的正常生效的账号数=可添加上限数
*/
void dispostCompanyJob();
/**
* 手动调整客服上限
* 若后续管理员又更改提高了可添加的在线或工单客服的数量上限,
* 则此时系统自动将之前失效的账号按顺序重新生效,
* 生效的顺序按照当前失效账号的创建时间的升序依次进行,
* 直到已添加的生效的账号数=可添加上限数。
*/
void updateCompanyUsers(Long companyId);
/**
* 保存租户信息
* @param company
* @return
*/
Long saveCompanyData(Company company);
/**
* 当前公司是否已到限制
* @param companyId
* @return
*/
Integer isCompanyUserMax(Long companyId,Integer userType);
/**
* 根据公司id查询公司详情
* @param companyId
* @return
*/
Company findByCompanyId(Long companyId);
/**
* 根据条件模糊查询公司
* @param condition
* @return
*/
List<Company> getByCondition(Condition condition);
/**
* 判断租户用户信息是否满足设置数
*/
void judgeCompanyUsersInfo();
}

View File

@@ -0,0 +1,69 @@
package com.qizhi.business.com.service;
import com.qizhi.business.com.entity.Permission;
import com.qizhi.business.com.entity.RolePermission;
import com.qizhi.business.com.entity.router.VuePermission;
import com.qizhi.business.com.entity.router.VueRouter;
import com.qizhi.common.core.service.SuperService;
import org.springframework.ui.ModelMap;
import java.util.ArrayList;
import java.util.List;
public interface PermissionService extends SuperService<Permission> {
/**
* 获得用户的菜单
* @param companyId
* @param rolePermissionslist
* @return
*/
ModelMap getUserMenuInfo(Long companyId,List<RolePermission> rolePermissionslist);
/**
* 通过用户id构建 Vue路由
*
* @param roleId 角色id
* @return 路由集合
*/
ArrayList<VueRouter<Permission>> getRoleRouters(Long roleId);
/**
* 获得用户按钮
* @param companyId
* @param rolePermissionslist
* @return
*/
List<String> getUserButtonInfo(Long companyId,List<RolePermission> rolePermissionslist);
/**
* 根据用户id查询权限按钮
* @param companyId
* @param userId
* @return
*/
List<String> queryButtonDataByUserId(Long companyId,Long userId);
/**
* 获得所有的权限数据
*
* @return 路由集合
*/
ArrayList<VuePermission<Permission>> getAllPermission();
/**
* 根据用户id查询权限按钮
* @param companyId
* @param userId
* @return
*/
List<String> queryMenuDataByUserId(Long companyId,Long userId);
}

View File

@@ -0,0 +1,18 @@
package com.qizhi.business.com.service;
import com.qizhi.business.com.dto.SetUserReqDto;
import com.qizhi.business.com.dto.SetUserRespDto;
import com.qizhi.business.com.entity.SetUser;
import com.qizhi.common.core.service.SuperService;
public interface PersonalSetService extends SuperService<SetUser> {
SetUserRespDto saveSetUserInfo(SetUserReqDto setUserReqDto);
/**
* 个人设置信息
*/
SetUser selectSetUserByUserId(Long userId);
}

View File

@@ -0,0 +1,18 @@
package com.qizhi.business.com.service;
import com.qizhi.business.com.entity.RolePermission;
import com.qizhi.common.core.service.SuperService;
import tk.mybatis.mapper.entity.Condition;
import java.util.List;
public interface RolePermissionService extends SuperService<RolePermission> {
/**
* 根据条件查权限数据
* @param condition
* @return
*/
List<RolePermission> getRolePermissionByCondition(Condition condition);
}

View File

@@ -0,0 +1,44 @@
package com.qizhi.business.com.service;
import com.qizhi.business.com.dto.RoleReqDto;
import com.qizhi.business.com.entity.Role;
import com.qizhi.common.core.service.SuperService;
import java.util.List;
import tk.mybatis.mapper.entity.Condition;
public interface RoleService extends SuperService<Role> {
Role getDefaultRoleByCompanyId(Long companyId);
Role getRoleByRoleName(String roleName);
/**
* 根据条件查询角色信息
* @param condition
* @return
*/
List<Role> getRoleByCondition(Condition condition);
/**
* 根据id查询角色信息
* @param roleId
* @return
*/
Role getRoleById(Long roleId);
/**
* 保存角色信息
* @param roleReqDto
* @return
*/
Long saveRoleInfo(RoleReqDto roleReqDto);
/**
* 创建租户的默认权限数据
* @param companyId
*/
Role createDefaultRole(Long companyId);
}

View File

@@ -0,0 +1,213 @@
package com.qizhi.business.com.service;
import com.qizhi.business.com.dto.IDMUserReqDto;
import com.qizhi.business.com.dto.UserEditReqDto;
import com.qizhi.business.com.dto.UserRespDto;
import com.qizhi.business.com.entity.User;
import com.qizhi.business.customer.dto.SelectDto;
import com.qizhi.common.core.service.SuperService;
import tk.mybatis.mapper.entity.Condition;
import java.util.List;
import java.util.Map;
public interface UserService extends SuperService<User> {
User findUserByEmail(String email, Long companyId);
/**
* 根据条件查询用户信息
* @param condition
* @return
*/
List<User> getUserByCondition(Condition condition);
// /**
// * 保存用户信息
// * @param userReqDto
// * @return
// */
// String saveUserInfo(UserReqDto userReqDto);
/**
* 用户姓名,工号模糊列表查询
* @param ctsNameOrCtsNo
* @param companyId
* @return
*/
List<User> getUserByRoleNameOrNo(String ctsNameOrCtsNo,Long companyId);
/**
* 用户姓名,工号模糊列表查询用户类型为客服的
* @param ctsNameOrCtsNo
* @param companyId
* @return
*/
List<User> getKefuByUserNameOrNo(String ctsNameOrCtsNo,Long companyId);
/**
* 根据客服ids查询启用的客服列表
* @param userIdList
* @return
*/
Map<Long,User> getAbleUserMapByIds(List<Long> userIdList);
Map<Long,User> getUserMapByIds(List<Long> userIdList);
/**
* 根据用户登录名查询客服列表
* @param loginIdList
* @return
*/
Map<Long,User> getAbleUserMapByLoginIds(List<String> loginIdList);
/**
* 根据客服ids查询启用的客服列表
* @param userIdList
* @return
*/
List<Long> getAbleUserIdListByIds(List<Long> userIdList);
/**
* 根据ID集查询用户信息不分状态
* @param ids
* @return
*/
Map<Long,User> getAllUserByIds(List<Long> ids);
/**
* 根据id获得用户信息
* @param id
* @return
*/
User getUserById(Long id);
/**
* 获取用户详情(包括部门岗位信息)
* @return
*/
UserRespDto getUserRespDtoById(Long id);
/**
* 根据账号id集合获取账号信息List
* @param ids
* @return
*/
List<UserRespDto> getUserRespListByUserIds(List<Long> ids);
/**
* 更新用户状态
* @param user
* @param loginUserId
*/
String updateUserStatus(User user,Integer status,Long loginUserId);
/**
* 更改用户密码
* @param user
*/
void changeUserPassword(User user);
/**
* 根据公司id查询所有信息
* @param companyId
* @return
*/
List<User> getUserByCompanyId(Long companyId);
/**
* 根据手机号码查询对象
* @param tel
* @return
*/
User findByTel(String tel);
/**
* 实时监控-列表用户查询
* @param companyId
* @param searchData
* @param status
* @return
*/
List<User> queryUserInfoFromMonitor(Long companyId, String searchData, String status);
/**
* 获取所有User
* @return
*/
List<User> getUserList();
/**
* 根据多个userId查询列表
* @param userIds
* @return
*/
List<User> findByUserIds(List<Long> userIds);
/**
* 根据租户id查询主账号信息
* @param companyIds
* @return
*/
List<Long> findMainUserId(List<Long> companyIds);
/**
* 新增运维
* @param idmUserReqDto
* @return
*/
String addUserInfo(IDMUserReqDto idmUserReqDto);
/**
* 修改运维
* @param userEditReqDto
* @return
*/
String editUserInfo(UserEditReqDto userEditReqDto);
/**
* 根据分部编码获取该分部的运维人员的List<loginId>
* @param subCompanyCode
* @return
*/
List<String> getLoginIdsBySubCompanyCode(String subCompanyCode);
/**
* 根据分部编码获取该分部的运维人员的List<userId>
* @param subCompanyCode
* @return
*/
List<Long> getUserIdsBySubCompanyCode(String subCompanyCode);
/**
* 获取受理人下拉
* @param keyword
* @param isVip
* @return
*/
List<SelectDto> getAcceptUserForSet(String keyword, Integer isVip,String subCompanyCode);
/**
* 根据邮箱list获取运维List
* @param emails
* @param companyId
* @return
*/
List<UserRespDto> getUserRespListByEmails(List<String> emails, Long companyId);
/**
* 根据loginId集合获取运维List
* @param loginIds
* @param companyId
* @return
*/
List<UserRespDto> getUserRespListByLoginIds(List<String> loginIds, Long companyId);
/**
* 根据loginId获取运维详情
* @param loginId
* @param companyId
* @return
*/
UserRespDto getUserRespByLoginId(String loginId, Long companyId);
}

View File

@@ -0,0 +1 @@
9690b10f-4e9a-47b5-96da-d602ebd2d3e8

View File

@@ -0,0 +1,352 @@
package com.qizhi.business.com.service.impl;
import com.github.pagehelper.PageInfo;
import com.qizhi.business.com.dto.CompanyRespDto;
import com.qizhi.business.com.entity.Company;
import com.qizhi.business.com.entity.User;
import com.qizhi.business.com.mapper.CompanyMapper;
import com.qizhi.business.com.service.CompanyService;
import com.qizhi.business.com.service.UserService;
import com.qizhi.common.core.service.AbstractService;
import org.modelmapper.ModelMapper;
import org.modelmapper.TypeToken;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Condition;
import java.util.ArrayList;
import java.util.List;
@Service
public class CompanyServiceImpl extends AbstractService<Company> implements CompanyService {
@Autowired
private UserService userService;
@Autowired
private CompanyMapper companyMapper;
@Override
public CompanyRespDto getCompanyById(Long companyId) {
Company company=this.findById(companyId);
CompanyRespDto companyRespDto=new CompanyRespDto();
BeanUtils.copyProperties(company,companyRespDto);
return companyRespDto;
}
@Override
public PageInfo getAllCustomer(PageInfo pageInfo) {
List<Company> companyList=pageInfo.getList();
List<CompanyRespDto> crDto=new ArrayList<>();
for (Company company:companyList) {
CompanyRespDto companyRespDto=new CompanyRespDto();
BeanUtils.copyProperties(company,companyRespDto);
crDto.add(companyRespDto);
}
ModelMapper modelMapper = new ModelMapper();
List<CompanyRespDto> companyRespDtoLists = modelMapper.map(crDto,new TypeToken<List<CompanyRespDto>>() {}.getType());
pageInfo.setList(companyRespDtoLists);
return pageInfo;
}
@Override
public List<Company> getCompanyList() {
return companyMapper.getCompanyList();
}
@Override
public Company findByTel(String tel) {
return companyMapper.findByTel(tel);
}
@Override
public Company findByCompanyCode(String companyCode) {
return companyMapper.findByCode(companyCode);
}
/**
* 处理公司定时任务
* 到期时间指当超过该时间到期当天的23:59:59
* 该客户可添加的在线客服数量和工单客服数量都自动更改为1个
*
* 当因为到期或人工更改的原因,
* 导致已添加的在线或工单客服的数量大于可添加的数量上限时,
* 系统自动将超出数量的在线或工单客服子账号失效,
* 账号失效的顺序按照账号创建的时间降序依次进行,
* 直到已添加的正常生效的账号数=可添加上限数
*/
@Override
public void dispostCompanyJob(){
List<Company> companyList = this.findAll();
if(companyList!=null&&companyList.size()>0){
for (Company company:companyList) {
updateCompanyUsers(company);
}
}
}
/**
* 手动调整客服上限
* 若后续管理员又更改提高了可添加的在线或工单客服的数量上限,
* 则此时系统自动将之前失效的账号按顺序重新生效,
* 生效的顺序按照当前失效账号的创建时间的升序依次进行,
* 直到已添加的生效的账号数=可添加上限数。
*/
@Override
public void updateCompanyUsers(Long companyId){
Company company = this.findById(companyId);
if(company!=null){
updateCompanyUsers(company);
}
}
/**
*客服的数量上限判断
* @param company
*/
private void updateCompanyUsers(Company company){
//是否到期
if(System.currentTimeMillis()-company.getDueTime()>0){
//上限重置
company.setCustomer(1l);
company.setworkOrder(1l);
company.setUpdateTime(System.currentTimeMillis());
this.update(company);
}
//在线客服的数量上限判断
int customerCount = this.getCustomerCount(company.getCompanyId());
if(customerCount!=company.getCustomer()){
//是否有效在线客服数量大于在线客服的数量上限
if(customerCount>company.getCustomer()){
//在线客服失效调整
this.updateCompanyUsersByUserType(company.getCompanyId(),company.getCustomer(),0,0);
}else {
//在线客服生效调整
this.updateCompanyUsersByUserType(company.getCompanyId(),company.getCustomer(),0,1);
}
}
//工单客服的数量上限判断
int wkCount = this.getWkCount(company.getCompanyId());
if(wkCount!=company.getworkOrder()){
//是否有效工单客服数量大于工单客服的数量上限
if(wkCount>company.getworkOrder()){
//工单客服失效调整
this.updateCompanyUsersByUserType(company.getCompanyId(),company.getworkOrder(),1,0);
}else {
//工单客服生效调整
this.updateCompanyUsersByUserType(company.getCompanyId(),company.getworkOrder(),1,1);
}
}
}
/**
* 调整客服状态
* 失效:账号失效的顺序按照账号创建的时间降序依次进行,
* 生效:生效的顺序按照当前失效账号的创建时间的升序依次进行
* 直到已添加的正常生效的账号数=可添加上限数
* @param companyId
* @param upperCount
*/
private void updateCompanyUsersByUserType(Long companyId,Long upperCount,Integer userType,Integer type){
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("companyId",companyId);
// criteria.andEqualTo("userType",userType);
criteria.andNotEqualTo("status",-1);
if(type==0){
//账号失效的顺序按照账号创建的时间降序依次进行
criteria.andNotEqualTo("status",2);
criteria.andNotEqualTo("adminFlag",1);
condition.orderBy("createTime").desc();
}else {
//生效的顺序按照当前失效账号的创建时间的升序依次进行
criteria.andEqualTo("status",2);
condition.orderBy("createTime").asc();
}
//根据在线,工单类型查询所有的客服
List<User> serList = userService.findByCondition(condition);
if(serList!=null&&serList.size()>0){
for (User user:serList) {
//重新获取正常的客服数量
Condition condition1 = new Condition(User.class);
Condition.Criteria criteria1 = condition1.createCriteria();
criteria1.andEqualTo("companyId",companyId);
// criteria1.andEqualTo("userType",userType);
criteria1.andCondition("(status=0 or status=1)");
int count = userService.selectCountByCondition(condition1);
//直到正常生效的账号数=可添加上限数
if(count!=upperCount){
//实时查询有效客服数量大于上限
if(count>upperCount){
//失效
user.setStatus(2);
}else {
//生效
user.setStatus(0);
}
user.setUpdateTime(System.currentTimeMillis());
userService.update(user);
}
}
}
}
/**
* 获取有效客服总数(排除删除和失效的)
* @param companyId
* @return
*/
private int getCustomerCount(Long companyId){
Condition conditionCustomer = new Condition(User.class);
Condition.Criteria criteria = conditionCustomer.createCriteria();
criteria.andEqualTo("companyId",companyId);
// criteria.andEqualTo("userType",0);
criteria.andNotEqualTo("status",-1);
criteria.andNotEqualTo("status",2);
int customerCount = userService.selectCountByCondition(conditionCustomer);
return customerCount;
}
/**
* 获取有效工单总数(排除删除和失效的)
* @param companyId
* @return
*/
private int getWkCount(Long companyId){
Condition conditionWK = new Condition(User.class);
Condition.Criteria criteriaWK = conditionWK.createCriteria();
criteriaWK.andEqualTo("companyId",companyId);
// criteriaWK.andEqualTo("userType",1);
criteriaWK.andNotEqualTo("status",-1);
criteriaWK.andNotEqualTo("status",2);
int wkCount = userService.selectCountByCondition(conditionWK);
return wkCount;
}
/**
* 公司使用过期,所有客服账号直接失效
* @param companyId
*/
// private void updateAllCompanyUsers(Long companyId){
// List<User> customerUserList = userService.getUserByCompanyId(companyId);
// if(customerUserList!=null&&customerUserList.size()>0){
// for (User user:customerUserList) {
// user.setStatus(1);
// user.setUpdateTime(System.currentTimeMillis());
// userService.update(user);
// }
// }
// }
/**
* 当前公司是否已到限制
* @param companyId
* @return
*/
@Override
public Integer isCompanyUserMax(Long companyId,Integer userType){
Company company = this.findById(companyId);
if(company!=null){
if(userType==0){
Integer count=getCustomerCount(companyId);
if(Long.valueOf(count)<company.getCustomer()){//如果小于可添加的在线客服数
return 0;
}else if(Long.valueOf(count)==company.getCustomer()){
return 1;
}
}else {
Integer count=getWkCount(companyId);
if(Long.valueOf(count)<company.getworkOrder()){
return 0;
}else if(Long.valueOf(count)==company.getworkOrder()){
return 1;
}
}
}
return 2;
}
/**
* 根据公司id查询公司详情
* @param companyId
* @return
*/
@Override
public Company findByCompanyId(Long companyId) {
return this.findById(companyId);
}
/**
* 根据输入框模糊匹配公司列表
* @param condition
* @return
*/
@Override
public List<Company> getByCondition(Condition condition) {
return this.findByCondition(condition);
}
/**
* 根据邮箱查找已注册公司数
* @param email
* @return
*/
@Override
public Integer getCompanyCountByEmail(String email){
Condition condition = new Condition(Company.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("email",email);
criteria.andNotEqualTo("status",-1);
return this.selectCountByCondition(condition);
}
/**
* 根据手机查找已注册公司数
* @param tel
* @return
*/
@Override
public Integer getCompanyCountByTel(String tel){
Condition condition = new Condition(Company.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("telephone",tel);
criteria.andNotEqualTo("status",-1);
return this.selectCountByCondition(condition);
}
/**
* 保存租户信息
* @param company
* @return
*/
@Override
public Long saveCompanyData(Company company){
this.save(company);
return company.getCompanyId();
}
/**
* 判断租户用户信息是否满足设置数
*/
@Override
public void judgeCompanyUsersInfo(){
Condition condition = new Condition(Company.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andNotEqualTo("status",-1);
List<Company> companyList=this.findByCondition(condition);
if(companyList!=null&&companyList.size()>0){
for (Company company:companyList) {
this.updateCompanyUsers(company);
}
}
}
}

View File

@@ -0,0 +1,251 @@
package com.qizhi.business.com.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.qizhi.business.com.dto.PermissionRespDto;
import com.qizhi.business.com.entity.Permission;
import com.qizhi.business.com.entity.RolePermission;
import com.qizhi.business.com.entity.User;
import com.qizhi.business.com.entity.router.RouterMeta;
import com.qizhi.business.com.entity.router.VuePermission;
import com.qizhi.business.com.entity.router.VueRouter;
import com.qizhi.business.com.mapper.PermissionMapper;
import com.qizhi.business.com.mapper.UserMapper;
import com.qizhi.business.com.service.PermissionService;
import com.qizhi.common.core.service.AbstractService;
import com.qizhi.common.utils.TreeUtil;
import org.modelmapper.ModelMapper;
import org.modelmapper.TypeToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;
import tk.mybatis.mapper.entity.Condition;
import java.util.ArrayList;
import java.util.List;
@Service
public class PermissionServiceImpl extends AbstractService<Permission> implements PermissionService {
@Autowired
private PermissionMapper permissionMapper;
@Autowired
private UserMapper userMapper;
/**
* 子节点数据获得
* @param list
* @return
*/
public List<PermissionRespDto> getChildPermissionInfo(List<PermissionRespDto> list){
for (PermissionRespDto permissionRespDto:list) {
Condition condition = new Condition(Permission.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andNotEqualTo("delStatus",2);
criteria.andEqualTo("parentId",permissionRespDto.getPermissionId());
List<Permission> list1 = this.findByCondition(condition);
if(list1.size()>0){
ModelMapper modelMapper = new ModelMapper();
List<PermissionRespDto> dtolist = modelMapper.map(list1,new TypeToken<List<PermissionRespDto>>() {}.getType());
permissionRespDto.setChildren(dtolist);
this.getChildPermissionInfo(dtolist);
}
}
return list;
}
/**
* Json子节点数据封装
* @param json
* @param list
* @return
*/
public JSONObject addChildren(JSONObject json, List<PermissionRespDto> list) {
JSONArray jsonArray = new JSONArray();
if (list != null && list.size() > 0) {
for (PermissionRespDto child : list) {
JSONObject json1 = new JSONObject();
json1.put("id", child.getPermissionId());
json1.put("name", child.getName());
json1.put("sequence", child.getSequence());
json1.put("type", child.getType());
JSONObject object=addChildren(json1, child.getChildren());
jsonArray.add(object);
}
}
json.put("children", jsonArray);
return json;
}
/**
* 登录用户的菜单权限
* @param companyId
* @param rolePermissionslist
* @return
*/
@Override
public ModelMap getUserMenuInfo(Long companyId,List<RolePermission> rolePermissionslist){
ModelMap map=new ModelMap();
List<Long> userPermissionList=new ArrayList<>();
for (RolePermission rolePermission:rolePermissionslist) {
userPermissionList.add(rolePermission.getPermissionId());
}
Condition condition = new Condition(Permission.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andNotEqualTo("delStatus",2);
criteria.andEqualTo("type",1);
criteria.andIsNull("parentId");
List<Permission> parentList = this.findByCondition(condition);
List<Permission> userParentList=new ArrayList<>();
for (Permission permission:parentList) {
if(userPermissionList.indexOf(permission.getPermissionId())>-1){
userParentList.add(permission);
}
}
ModelMapper modelMapper = new ModelMapper();
List<PermissionRespDto> list = modelMapper.map(userParentList,new TypeToken<List<PermissionRespDto>>() {}.getType());
list=this.getUserChildPermissionInfo(list,userPermissionList);
map.put("list",list);
return map;
}
@Override
public ArrayList<VueRouter<Permission>> getRoleRouters(Long userId) {
User user = userMapper.selectByPrimaryKey(userId);
List<VueRouter<Permission>> routes = new ArrayList<>();
List<Permission> menus = permissionMapper.findRoleMenus(user.getRoleId());
menus.forEach(menu -> {
VueRouter<Permission> route = new VueRouter<>();
route.setId(menu.getPermissionId());
route.setParentId(menu.getParentId());
route.setIcon(menu.getIcon());
route.setPath(menu.getRoutePath());
route.setComponent(menu.getComponent());
route.setName(menu.getName());
route.setMeta(new RouterMeta(menu.getName()));
routes.add(route);
});
return TreeUtil.buildVueRouter(routes);
}
/**
* 获得所有的权限数据
*
* @return 路由集合
*/
@Override
public ArrayList<VuePermission<Permission>> getAllPermission(){
List<VuePermission<Permission>> routes = new ArrayList<>();
List<Permission> permissionsList = permissionMapper.findAllPermission();
permissionsList.forEach(permission -> {
VuePermission<Permission> route = new VuePermission<>();
route.setId(permission.getPermissionId());
route.setParentId(permission.getParentId());
route.setName(permission.getName());
route.setType(permission.getType());
route.setSequence(permission.getSequence());
routes.add(route);
});
return TreeUtil.buildVuePermission(routes);
}
/**
* 用户子节点数据获得
* @param list
* @param
* @return
*/
public List<PermissionRespDto> getUserChildPermissionInfo(List<PermissionRespDto> list,List<Long> userPermissionList){
for (PermissionRespDto permissionRespDto:list) {
Condition condition = new Condition(Permission.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andNotEqualTo("delStatus",2);
criteria.andEqualTo("parentId",permissionRespDto.getPermissionId());
criteria.andEqualTo("type",1);
List<Permission> list1 = this.findByCondition(condition);
if(list1.size()>0){
List<Permission> childList=new ArrayList<>();
for (Permission permission: list1) {
if(userPermissionList.indexOf(permission.getPermissionId())>-1){
childList.add(permission);
}
}
if(childList.size()>0){
ModelMapper modelMapper = new ModelMapper();
List<PermissionRespDto> dtolist = modelMapper.map(childList,new TypeToken<List<PermissionRespDto>>() {}.getType());
permissionRespDto.setChildren(dtolist);
this.getUserChildPermissionInfo(dtolist,userPermissionList);
}
}
}
return list;
}
/**
* 获得用户的权限按钮
* @param companyId
* @param rolePermissionslist
* @return
*/
@Override
public List<String> getUserButtonInfo(Long companyId,List<RolePermission> rolePermissionslist){
Condition condition = new Condition(Permission.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andNotEqualTo("delStatus",2);
criteria.andEqualTo("type",2);
List<Permission> list = this.findByCondition(condition);
List<String> returnList=new ArrayList<>();
if(list.size()>0){
List<Long> userPermissionList=new ArrayList<>();
for (RolePermission rolePermission:rolePermissionslist) {
userPermissionList.add(rolePermission.getPermissionId());
}
for (Permission permission:list) {
if (userPermissionList.indexOf(permission.getPermissionId())>-1){
returnList.add(permission.getEnName());
}
}
}
return returnList;
}
/**
* 根据用户id查询权限按钮
* @param companyId
* @param userId
* @return
*/
@Override
public List<String> queryButtonDataByUserId(Long companyId,Long userId){
return permissionMapper.queryButtonDataByUserId(companyId,userId);
}
/**
* 根据用户id查询权限按钮
* @param companyId
* @param userId
* @return
*/
@Override
public List<String> queryMenuDataByUserId(Long companyId,Long userId){
return permissionMapper.queryMenuDataByUserId(companyId,userId);
}
}

View File

@@ -0,0 +1,68 @@
package com.qizhi.business.com.service.impl;
import com.qizhi.business.com.dto.SetUserReqDto;
import com.qizhi.business.com.dto.SetUserRespDto;
import com.qizhi.business.com.entity.SetUser;
import com.qizhi.business.com.mapper.PersonalSetMapper;
import com.qizhi.business.com.service.PersonalSetService;
import com.qizhi.common.core.service.AbstractService;
import org.modelmapper.ModelMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Condition;
import java.util.List;
@Service
public class PersonalSetServiceImpl extends AbstractService<SetUser> implements PersonalSetService {
@Autowired
private PersonalSetMapper setUserMapper;
@Override
public SetUserRespDto saveSetUserInfo(SetUserReqDto setUserReqDto){
SetUser setUser=this.findBy("userId",setUserReqDto.getUserId());
if(setUser==null){//创建
setUser=new SetUser();
BeanUtils.copyProperties(setUserReqDto,setUser );
setUser.setCreateId(setUserReqDto.getUpdateId());
setUser.setCreateTime(System.currentTimeMillis());
setUser.setUpdateId(setUserReqDto.getUpdateId());
setUser.setUpdateTime( System.currentTimeMillis() );
setUser.setDelStatus(1);
setUserMapper.insert(setUser);
}else {
setUser.setNickname(setUserReqDto.getNickname());
setUser.setAvatar(setUserReqDto.getAvatar());
setUser.setPromptVoice(setUserReqDto.getPromptVoice());
setUser.setMessageVoice(setUserReqDto.getMessageVoice());
setUser.setRecommendAnswer(setUserReqDto.getRecommendAnswer());
setUser.setSessionSort(setUserReqDto.getSessionSort());
setUser.setUpdateId( setUserReqDto.getUpdateId() );
setUser.setUpdateTime( System.currentTimeMillis() );
setUserMapper.updateByPrimaryKey(setUser);
}
ModelMapper modelMapper = new ModelMapper();
SetUserRespDto returnValue= modelMapper.map(setUser, SetUserRespDto.class);
return returnValue;
}
/**
* 个人设置信息
*/
@Override
public SetUser selectSetUserByUserId(Long userId) {
Condition conditionSet = new Condition(SetUser.class);
Condition.Criteria criteriaSet = conditionSet.createCriteria();
criteriaSet.andEqualTo("userId",userId);
criteriaSet.andEqualTo("delStatus",1);
List<SetUser> list=setUserMapper.selectByCondition(conditionSet);
if (list.size()==0){
return null;
}
return list.get( 0 );
}
}

View File

@@ -0,0 +1,25 @@
package com.qizhi.business.com.service.impl;
import com.qizhi.business.com.entity.RolePermission;
import com.qizhi.business.com.service.RolePermissionService;
import com.qizhi.common.core.service.AbstractService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Condition;
import java.util.List;
@Service
public class RolePermissionServiceImpl extends AbstractService<RolePermission> implements RolePermissionService {
/**
* 根据条件查权限数据
* @param condition
* @return
*/
public List<RolePermission> getRolePermissionByCondition(Condition condition){
return this.findByCondition(condition);
}
}

View File

@@ -0,0 +1,150 @@
package com.qizhi.business.com.service.impl;
import com.qizhi.business.com.dto.RoleReqDto;
import com.qizhi.business.com.entity.Permission;
import com.qizhi.business.com.entity.Role;
import com.qizhi.business.com.entity.RolePermission;
import com.qizhi.business.com.mapper.PermissionMapper;
import com.qizhi.business.com.mapper.RolePermissionMapper;
import com.qizhi.business.com.service.RoleService;
import com.qizhi.common.core.service.AbstractService;
import com.qizhi.common.utils.CommonUtil;
import com.qizhi.common.utils.TableUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Condition;
import java.util.Date;
import java.util.List;
@Service
public class RoleServiceImpl extends AbstractService<Role> implements RoleService {
@Autowired
private RolePermissionMapper rolePermissionMapper;
@Autowired
private PermissionMapper permissionMapper;
@Override
public Role getDefaultRoleByCompanyId(Long companyId) {
Condition condition = new Condition(Role.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("companyId", companyId);
criteria.andEqualTo("delStatus", 1);
List<Role> roleList = getRoleByCondition(condition);
if(roleList == null || roleList.size() == 0){
return null;
}
return roleList.get(0);
}
@Override
public Role getRoleByRoleName(String roleName) {
Condition condition = new Condition(Role.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("roleName", roleName);
criteria.andEqualTo("delStatus", 1);
List<Role> roleList = getRoleByCondition(condition);
if(roleList == null || roleList.size() == 0){
return null;
}
return roleList.get(0);
}
/**
* 根据条件查询角色信息
*
* @param condition
* @return
*/
@Override
public List<Role> getRoleByCondition(Condition condition) {
return this.findByCondition(condition);
}
/**
* 根据id查询角色信息
*
* @param roleId
* @return
*/
@Override
public Role getRoleById(Long roleId) {
return this.findById(roleId);
}
/**
* 保存角色信息
*
* @param roleReqDto
* @return
*/
@Override
public Long saveRoleInfo(RoleReqDto roleReqDto) {
Role role = new Role();
Long time = new Date().getTime();
if (roleReqDto.getRoleId() != null) {
role = this.findById(roleReqDto.getRoleId());
} else {
role.setCompanyId(roleReqDto.getCompanyId());
role.setRoleCode(TableUtil.getPK("R"));
role.setCreateTime(time);
role.setCreateId(roleReqDto.getUserId());
role.setDelStatus(1);
}
role.setRoleName(roleReqDto.getRoleName());
role.setUpdateId(roleReqDto.getUserId());
role.setUpdateTime(time);
if (role.getRoleId() != null) {
this.update(role);
} else {
this.save(role);
}
rolePermissionMapper.deletePermissionByRoleId(role.getRoleId());
String permissionIds = roleReqDto.getPermissionIds();
if (permissionIds != null && !"".equals(permissionIds)) {
String[] permissionArr = permissionIds.split(",");
for (String permissionId : permissionArr) {
RolePermission rolePermission = new RolePermission();
rolePermission.setPermissionId(Long.valueOf(permissionId));
rolePermission.setRoleId(role.getRoleId());
rolePermissionMapper.insert(rolePermission);
}
}
return role.getRoleId();
}
/**
* 创建租户的默认权限数据
*
* @param companyId
*/
@Override
public Role createDefaultRole(Long companyId) {
Role role = new Role();
role.setDelStatus(1);
role.setRoleCode(TableUtil.getPK("R"));
role.setRoleName("租户管理员");
role.setCompanyId(companyId);
role.setCreateId(CommonUtil.SYSTEM_USER_ID);
role.setUpdateId(CommonUtil.SYSTEM_USER_ID);
role.setCreateTime(new Date().getTime());
this.save(role);
//获得权限数据
Condition condition = new Condition(Permission.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("delStatus", 1);
List<Permission> list = permissionMapper.selectByCondition(condition);
//遍历权限数据并插入数据
for (Permission permission : list) {
RolePermission rolePermission = new RolePermission();
rolePermission.setPermissionId(permission.getPermissionId());
rolePermission.setRoleId(role.getRoleId());
rolePermissionMapper.insert(rolePermission);
}
return role;
}
}

View File

@@ -0,0 +1,561 @@
package com.qizhi.business.com.service.impl;
import com.qizhi.business.com.dto.IDMUserReqDto;
import com.qizhi.business.com.dto.UserEditReqDto;
import com.qizhi.business.com.dto.UserRespDto;
import com.qizhi.business.com.entity.User;
import com.qizhi.business.com.mapper.UserMapper;
import com.qizhi.business.com.service.CompanyService;
import com.qizhi.business.com.service.UserService;
import com.qizhi.business.customer.dto.SelectDto;
import com.qizhi.business.customer.entity.IDMCompany;
import com.qizhi.business.customer.entity.IDMPosition;
import com.qizhi.business.customer.mapper.IDMCompanyMapper;
import com.qizhi.business.customer.mapper.IDMPositionMapper;
import com.qizhi.common.core.service.AbstractService;
import com.qizhi.common.utils.CubeBeanUtils;
import com.qizhi.common.utils.Md5Util;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Condition;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class UserServiceImpl extends AbstractService<User> implements UserService {
@Autowired
private UserMapper userMapper;
@Autowired
private CompanyService companyService;
@Autowired
private IDMCompanyMapper idmCompanyMapper;
@Autowired
private IDMPositionMapper idmPositionMapper;
@Override
public User findUserByEmail(String email, Long companyId) {
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("email", email);
criteria.andEqualTo("companyId", companyId);
criteria.andNotEqualTo("status", -1);
List<User> userList = getUserByCondition(condition);
if(userList == null || userList.size() == 0){
return null;
}
return userList.get(0);
}
/**
* 根据条件查询用户信息
*
* @param condition
* @return
*/
@Override
public List<User> getUserByCondition(Condition condition) {
return this.findByCondition(condition);
}
// /**
// * 用户信息保存
// *
// * @param userReqDto
// * @return
// */
// @Override
// public String saveUserInfo(UserReqDto userReqDto) {
// User user = new User();
// Long time = new Date().getTime();
// if (userReqDto.getUserId() != null) {
//
// } else {
// //新增 判断当前公司客服是否已到达上限
// String result = isUserMax(userReqDto.getCompanyId(), userReqDto.getUserType());
// if ("equ".equals(result)) {
// if (userReqDto.getUserType() == 0) {
// return "当前公司在线客服数量已到达上限";
// } else {
// return "当前公司工单客服数量已到达上限";
// }
// } else if (!"".equals(result)) {
// return result;
// }
//
// user.setCompanyId(userReqDto.getCompanyId());
// user.setCreateTime(time);
// user.setCreateId(userReqDto.getLoginUserId());
// user.setPassword(Md5Util.MD5(userReqDto.getPassword()));
// }
// user.setName(userReqDto.getName());
// user.setTelephone(userReqDto.getTelephone());
// user.setEmail(userReqDto.getEmail());
// user.setRoleId(userReqDto.getRoleId());
// user.setUpdateId(userReqDto.getLoginUserId());
// user.setUpdateTime(time);
// if (user.getUserId() == null) {
// this.save(user);
// } else {
// this.update(user);
// }
// ModelMapper modelMapper = new ModelMapper();
// UserRespDto returnValue = modelMapper.map(user, UserRespDto.class);
// return "";
//
// }
/**
* 用户姓名,工号模糊列表查询
*
* @param ctsNameOrCtsNo
* @param companyId
* @return
*/
@Override
public List<User> getUserByRoleNameOrNo(String ctsNameOrCtsNo, Long companyId) {
return userMapper.getUserByRoleNameOrNo(ctsNameOrCtsNo, companyId);
}
/**
* 用户姓名,工号模糊列表查询用户类型为客服的
*
* @param ctsNameOrCtsNo
* @param companyId
* @return
*/
@Override
public List<User> getKefuByUserNameOrNo(String ctsNameOrCtsNo, Long companyId) {
return userMapper.getKefuByUserNameOrNo(ctsNameOrCtsNo, companyId);
}
/**
* 根据客服ids查询启用的客服列表
*
* @param userIdList
* @return
*/
@Override
public Map<Long, User> getAbleUserMapByIds(List<Long> userIdList) {
return userMapper.getAbleUserMapByIds(userIdList);
}
@Override
public Map<Long, User> getUserMapByIds(List<Long> userIdList) {
return userMapper.getUserMapByIds(userIdList);
}
@Override
public Map<Long, User> getAbleUserMapByLoginIds(List<String> loginIdList) {
return userMapper.getAbleUserMapByLoginIds(loginIdList);
}
/**
* 根据客服ids查询启用的客服列表
*
* @param userIdList
* @return
*/
@Override
public List<Long> getAbleUserIdListByIds(List<Long> userIdList) {
if (userIdList.size() == 0) {
return new ArrayList<>();
}
return userMapper.getAbleUserIdListByIds(userIdList);
}
/**
* 根据ID集查询用户信息
*
* @param ids
* @return
*/
@Override
public Map<Long, User> getAllUserByIds(List<Long> ids) {
Map<Long, User> map = new HashMap<>();
if (ids.size() > 0) {
map = userMapper.getUserByIds(ids);
}
return map;
}
/**
* 根据id获得用户信息
*
* @param id
* @return
*/
@Override
public User getUserById(Long id) {
return this.findById(id);
}
@Override
public UserRespDto getUserRespDtoById(Long id) {
UserRespDto userRespDto = null;
User user = this.findById(id);
if(user!=null){
userRespDto = new UserRespDto();
BeanUtils.copyProperties(user,userRespDto);
if(StringUtils.isNotEmpty(userRespDto.getIdmCompanyCode())){
Condition condition = new Condition(IDMCompany.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("subCompanyCode",userRespDto.getIdmCompanyCode());
List<IDMCompany> idmCompanies = idmCompanyMapper.selectByCondition(condition);
if(idmCompanies.size()>0){
userRespDto.setIdmCompanyId(idmCompanies.get(0).getId());
userRespDto.setIdmCompanyName(idmCompanies.get(0).getsComName());
}
}
if(StringUtils.isNotEmpty(userRespDto.getIdmPositionCode())){
Condition condition = new Condition(IDMPosition.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("positionCode",userRespDto.getIdmPositionCode());
List<IDMPosition> idmPositions = idmPositionMapper.selectByCondition(condition);
if(idmPositions.size()>0){
userRespDto.setIdmPositionName(idmPositions.get(0).getPositionShortName());
}
}
}
return userRespDto;
}
public List<UserRespDto> getUserRespListByUserIds(List<Long> ids){
List<User> list = userMapper.findByUserIds(ids);
List<UserRespDto> respDtoList = new ArrayList<>();
if(list.size()>0){
respDtoList = CubeBeanUtils.copyList(list,UserRespDto.class);
List<String> idmCompanyCodes = respDtoList.stream().map(UserRespDto::getIdmCompanyCode).collect(Collectors.toList());
Condition condition = new Condition(IDMCompany.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andIn("subCompanyCode",idmCompanyCodes);
List<IDMCompany> idmCompanies = idmCompanyMapper.selectByCondition(condition);
for(UserRespDto userRespDto:respDtoList){
for(IDMCompany company:idmCompanies){
if(company.getSubCompanyCode().equals(userRespDto.getIdmCompanyCode())){
userRespDto.setIdmCompanyId(company.getId());
userRespDto.setIdmCompanyName(company.getsComName());
break;
}
}
}
//TODO 部门、岗位暂时未加,需求有需要在此查询添加
}
return respDtoList;
}
/**
* 更新用户状态
*
* @param user
* @param loginUserId
*/
@Override
public String updateUserStatus(User user, Integer status, Long loginUserId) {
//-1:删除 0:正常 1:禁用2:失效
//把正常的账号禁用
user.setStatus(status);
user.setUpdateId(loginUserId);
user.setUpdateTime(new Date().getTime());
this.update(user);
return "";
}
/**
* 更改用户密码
*
* @param user
*/
@Override
public void changeUserPassword(User user) {
this.update(user);
}
/**
* 根据companyId查询客服信息
*
* @param companyId
* @return
*/
@Override
public List<User> getUserByCompanyId(Long companyId) {
return userMapper.getUserByCompanyId(companyId);
}
/**
* 根据手机号查询user对象
*
* @param tel
* @return
*/
@Override
public User findByTel(String tel) {
return userMapper.getUserByTel(tel);
}
/**
* 实时监控-列表用户查询
*
* @param companyId
* @param searchData
* @param status
* @return
*/
@Override
public List<User> queryUserInfoFromMonitor(Long companyId, String searchData, String status) {
List<User> list = new ArrayList<User>();
list = userMapper.queryUserInfoFromMonitor(companyId, searchData, status);
return list;
}
@Override
public List<User> getUserList() {
return userMapper.getAllUser();
}
/**
* 根据多个userId查询列表
*
* @param userIds
* @return
*/
@Override
public List<User> findByUserIds(List<Long> userIds) {
return userMapper.findByUserIds(userIds);
}
/**
* 判断当前公司客服是否已到达上限
*
* @param companyId
* @param userType
* @return
*/
private String isUserMax(Long companyId, Integer userType) {//用户类型1工单客服0在线客服
Integer isMax = companyService.isCompanyUserMax(companyId, userType);//0小于1等于2:大于
if (isMax == 2) {
if (userType == 0) {
return "当前公司在线客服数量已到达上限";
} else {
return "当前公司工单客服数量已到达上限";
}
} else if (isMax == 1) {
return "equ";
}
return "";
}
/**
* 根据租户id查询主账号信息
*
* @param companyIds
* @return
*/
@Override
public List<Long> findMainUserId(List<Long> companyIds) {
return userMapper.findMainUserId(companyIds);
}
@Override
public String addUserInfo(IDMUserReqDto idmUserReqDto) {
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("loginId",idmUserReqDto.getLoginId());
criteria.andEqualTo("companyId",idmUserReqDto.getCompanyId());
criteria.andNotEqualTo("status",-1);
List<User> userList=userMapper.selectByCondition(condition);
if(userList.size()>0){//存在
return "用户已存在,请刷新列表确认";
}
User user = new User();
BeanUtils.copyProperties(idmUserReqDto,user);
user.setPassword(Md5Util.MD5(idmUserReqDto.getPassword()));
// user.setStatus(0);// -1:删除 0:正常 1:禁用
user.setCreateId(idmUserReqDto.getCurrentUserId());//创建人id
user.setCreateTime(System.currentTimeMillis());
userMapper.insertUseGeneratedKeys(user);
return "";
}
@Override
public String editUserInfo(UserEditReqDto userEditReqDto) {
int i = userMapper.editUserInfo(userEditReqDto);
if(i==0){
return "未找到修改的用户";
}
return "";
}
@Override
public List<String> getLoginIdsBySubCompanyCode(String subCompanyCode) {
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("idmCompanyCode", subCompanyCode);
criteria.andEqualTo("status", 0);
criteria.andEqualTo("customerStatus", "ENABLE");
criteria.andEqualTo("empStatus", "ENABLE");
List<User> userList = userMapper.selectByCondition(condition);
return userList.stream().map(User::getLoginId).collect(Collectors.toList());
}
@Override
public List<Long> getUserIdsBySubCompanyCode(String subCompanyCode) {
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("idmCompanyCode", subCompanyCode);
criteria.andEqualTo("status", 0);
criteria.andEqualTo("customerStatus", "ENABLE");
criteria.andEqualTo("empStatus", "ENABLE");
List<User> userList = userMapper.selectByCondition(condition);
return userList.stream().map(User::getUserId).collect(Collectors.toList());
}
@Override
public List<SelectDto> getAcceptUserForSet(String keyword, Integer isVip,String subCompanyCode) {
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("status",0);
if(StringUtils.isNotBlank(keyword)) {
criteria.andLike("name", "%" + keyword + "%");
}
if(isVip!=null) {
criteria.andEqualTo("isVip", isVip);
}
if(StringUtils.isNotBlank(subCompanyCode)){
criteria.andEqualTo("idmCompanyCode",subCompanyCode);
}
List<User> userList = userMapper.selectByCondition(condition);
List<SelectDto> resultList = new ArrayList<>();
if(userList.size()>0){
List<String> idmCompanyCodes = userList.stream().map(User::getIdmCompanyCode).collect(Collectors.toList());
List<IDMCompany> companies = new ArrayList<>();
if(idmCompanyCodes.size()>0){
Condition condition1 = new Condition(IDMCompany.class);
Condition.Criteria criteria1 = condition1.createCriteria();
criteria1.andIn("subCompanyCode",idmCompanyCodes);
companies = idmCompanyMapper.selectByCondition(condition1);
}
SelectDto selectDto;
for(User user:userList){
selectDto = new SelectDto();
selectDto.setId(user.getUserId());
selectDto.setName(user.getName());
for(IDMCompany idmCompany:companies){
if(idmCompany.getSubCompanyCode().equals(user.getIdmCompanyCode())){
selectDto.setName(user.getName()+"_"+idmCompany.getsComName());
break;
}
}
resultList.add(selectDto);
}
}
return resultList;
}
@Override
public List<UserRespDto> getUserRespListByEmails(List<String> emails, Long companyId){
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andIn("email", emails);
criteria.andEqualTo("companyId", companyId);
criteria.andNotEqualTo("status", -1);
List<User> userList = getUserByCondition(condition);
List<UserRespDto> respDtoList = new ArrayList<>();
if(userList.size()>0){
respDtoList = CubeBeanUtils.copyList(userList,UserRespDto.class);
List<String> idmCompanyCodes = respDtoList.stream().map(UserRespDto::getIdmCompanyCode).collect(Collectors.toList());
Condition idmCondition = new Condition(IDMCompany.class);
Condition.Criteria idmCriteria = idmCondition.createCriteria();
idmCriteria.andIn("subCompanyCode",idmCompanyCodes);
List<IDMCompany> idmCompanies = idmCompanyMapper.selectByCondition(idmCondition);
for(UserRespDto userRespDto:respDtoList){
for(IDMCompany company:idmCompanies){
if(company.getSubCompanyCode().equals(userRespDto.getIdmCompanyCode())){
userRespDto.setIdmCompanyId(company.getId());
userRespDto.setIdmCompanyName(company.getsComName());
break;
}
}
}
//TODO 部门、岗位暂时未加,需求有需要在此查询添加
}
return respDtoList;
}
@Override
public List<UserRespDto> getUserRespListByLoginIds(List<String> loginIds, Long companyId){
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andIn("loginId", loginIds);
criteria.andEqualTo("companyId", companyId);
criteria.andNotEqualTo("status", -1);
List<User> userList = getUserByCondition(condition);
List<UserRespDto> respDtoList = new ArrayList<>();
if(userList.size()>0){
respDtoList = CubeBeanUtils.copyList(userList,UserRespDto.class);
List<String> idmCompanyCodes = respDtoList.stream().map(UserRespDto::getIdmCompanyCode).collect(Collectors.toList());
Condition idmCondition = new Condition(IDMCompany.class);
Condition.Criteria idmCriteria = idmCondition.createCriteria();
idmCriteria.andIn("subCompanyCode",idmCompanyCodes);
List<IDMCompany> idmCompanies = idmCompanyMapper.selectByCondition(idmCondition);
for(UserRespDto userRespDto:respDtoList){
for(IDMCompany company:idmCompanies){
if(company.getSubCompanyCode().equals(userRespDto.getIdmCompanyCode())){
userRespDto.setIdmCompanyId(company.getId());
userRespDto.setIdmCompanyName(company.getsComName());
break;
}
}
}
//TODO 部门、岗位暂时未加,需求有需要在此查询添加
}
return respDtoList;
}
@Override
public UserRespDto getUserRespByLoginId(String loginId, Long companyId) {
UserRespDto userRespDto = null;
Condition condition = new Condition(User.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("loginId", loginId);
criteria.andEqualTo("companyId", companyId);
criteria.andNotEqualTo("status", -1);
List<User> userList = getUserByCondition(condition);
User user = null;
if(userList.size()>0){
user = userList.get(0);
}
if(user!=null){
userRespDto = new UserRespDto();
BeanUtils.copyProperties(user,userRespDto);
if(StringUtils.isNotEmpty(userRespDto.getIdmCompanyCode())){
Condition idmCondition = new Condition(IDMCompany.class);
Condition.Criteria idmCriteria = idmCondition.createCriteria();
idmCriteria.andEqualTo("subCompanyCode",userRespDto.getIdmCompanyCode());
List<IDMCompany> idmCompanies = idmCompanyMapper.selectByCondition(idmCondition);
if(idmCompanies.size()>0){
userRespDto.setIdmCompanyId(idmCompanies.get(0).getId());
userRespDto.setIdmCompanyName(idmCompanies.get(0).getsComName());
}
}
//有需要再放开
// if(StringUtils.isNotEmpty(userRespDto.getIdmPositionCode())){
// Condition idmCondition = new Condition(IDMPosition.class);
// Condition.Criteria idmCriteria = idmCondition.createCriteria();
// criteria.andEqualTo("positionCode",userRespDto.getIdmPositionCode());
// List<IDMPosition> idmPositions = idmPositionMapper.selectByCondition(idmCondition);
// if(idmPositions.size()>0){
// userRespDto.setIdmPositionName(idmPositions.get(0).getPositionShortName());
// }
// }
}
return userRespDto;
}
}

View File

@@ -0,0 +1 @@
45cc53a2-1d64-4a37-be54-52a09b3dce39

View File

@@ -0,0 +1 @@
3973baac-8123-4d70-961d-35ed00ce7547

View File

@@ -0,0 +1,97 @@
package com.qizhi.business.company.controller;
import com.qizhi.business.company.entity.CompanyManager;
import com.qizhi.business.company.service.CompanyManagerService;
import com.qizhi.common.authentication.IgnoreSecurity;
import com.qizhi.common.authentication.TokenUtils;
import com.qizhi.common.cache.CachePrefix;
import com.qizhi.extension.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Condition;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Api("租户登录相关接口")
@RestController
@RequestMapping(value = "/companyLogin")
public class CompanyTokenController {
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Autowired
private CompanyManagerService companyManagerService;
/**
* 租户登陆
* @param account
* @param password
* @return
*/
@ApiOperation(value = "租户登陆", notes = "租户登陆接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "account", value = "登录账号", dataType = "String"),
@ApiImplicitParam(name = "password", value = "登录密码", dataType = "String")
})
@RequestMapping(value = "login", method = RequestMethod.POST)
@IgnoreSecurity
public RestResponse<Map<String,Object>> login(String account, String password) {
if(account == null || "".equals(account)){
return RestResponse.failed("请输入登录账号");
}
if(password == null || "".equals(password)){
return RestResponse.failed("请输入登录密码");
}
String errorTimeStr= String.valueOf(redisTemplate.opsForValue().get(CachePrefix.company_identity.login_error_time+"_"+account));
if(errorTimeStr!=null&&!"null".equals(errorTimeStr)&&Integer.valueOf(errorTimeStr)>=10){
return RestResponse.failed("密码输入错误次数过多该帐号已被锁定请12个小时后再试");
}
Integer errorTime=errorTimeStr==null||"null".equals(errorTimeStr)?0:Integer.valueOf(errorTimeStr);
Condition condition = new Condition(CompanyManager.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("email",account);
criteria.andNotEqualTo("status",-1);
List<CompanyManager> list=companyManagerService.getByCondition(condition);
if(list.size()==0){
return RestResponse.failed("管理账号不存在,请确认后重新输入");
}else if(list.size()>1) {
return RestResponse.failed("有多个重复账号存在,请确认后重新输入");
}else {
CompanyManager companyManager=list.get(0);
if(companyManager.getUserId()!=null&&companyManager.getStatus()==0) {
if (!companyManager.getPassword().equals(password)) {//密码不能匹配
System.out.println("租户的密码为"+companyManager.getPassword());
System.out.println("输入的密码为:"+password);
redisTemplate.opsForValue().set(CachePrefix.company_identity.login_error_time+"_"+account, errorTime+1, 12, TimeUnit.HOURS);
return RestResponse.failed("密码输入错误请重试");
}
Map<String, Object> map = new HashMap<>();
map.put("companyManager", companyManager);
String token = TokenUtils.getToken(companyManager.getUserId());
map.put("token", token);
//向redis保持登陆token
redisTemplate.opsForValue().set(CachePrefix.CompanyCenter.jwt_token_company+"_"+ companyManager.getUserId(),token);
redisTemplate.opsForValue().set(CachePrefix.company_identity.login_error_time+"_"+account, 0);
return RestResponse.succesed(map);
}else if(companyManager.getStatus()==-1){
return RestResponse.failed("管理账号不存在,请确认后重新输入");
}else if(companyManager.getStatus()==1){
return RestResponse.failed("管理账号已被禁用");
}
}
return RestResponse.failed("管理账号不存在,请确认后重新输入");
}
}

View File

@@ -0,0 +1 @@
0c778015-e028-47a9-bd75-c770ebb24046

View File

@@ -0,0 +1,90 @@
package com.qizhi.business.company.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @date Tue Feb 12 16:10:18 CST 2019
*/
@ApiModel("租户表")
@Table(name = "company_manager")
public class CompanyManager implements Serializable {
@Id
@Column(name="user_id")
private Long userId;
@ApiModelProperty("姓名")
@Column(name="name")
private String name;
@ApiModelProperty("联系方式")
@Column(name="telephone")
private String telephone;
@ApiModelProperty("邮箱")
@Column(name="email")
private String email;
@ApiModelProperty("登录密码")
@Column(name="password")
private String password;
@ApiModelProperty("-1:删除 0:正常 1:禁用")
@Column(name="status")
private Integer status;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}

View File

@@ -0,0 +1 @@
657501cf-4377-4b3e-9379-0c248c0d7364

View File

@@ -0,0 +1,12 @@
package com.qizhi.business.company.mapper;
import com.qizhi.business.company.entity.CompanyManager;
import com.qizhi.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CompanyManagerMapper extends SuperMapper<CompanyManager> {
}

View File

@@ -0,0 +1 @@
bed927e4-dbf8-4bda-b958-d2ac57de6bbd

View File

@@ -0,0 +1,11 @@
package com.qizhi.business.company.service;
import com.qizhi.business.company.entity.CompanyManager;
import com.qizhi.common.core.service.SuperService;
import tk.mybatis.mapper.entity.Condition;
import java.util.List;
public interface CompanyManagerService extends SuperService<CompanyManager> {
List<CompanyManager> getByCondition(Condition condition);
}

View File

@@ -0,0 +1 @@
08af295f-aff7-4749-8b61-4369b16a57c2

View File

@@ -0,0 +1,19 @@
package com.qizhi.business.company.service.impl;
import com.qizhi.business.company.entity.CompanyManager;
import com.qizhi.business.company.service.CompanyManagerService;
import com.qizhi.common.core.service.AbstractService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Condition;
import java.util.List;
@Service
public class CompanyManagerServiceImpl extends AbstractService<CompanyManager> implements CompanyManagerService {
@Override
public List<CompanyManager> getByCondition(Condition condition){
return this.findByCondition(condition);
}
}

View File

@@ -0,0 +1 @@
4d8ba0a8-a5cf-4d6d-a8ff-00cf301679d9

View File

@@ -0,0 +1 @@
7dfbdcda-1620-4fff-bdf6-05f5185df2af

View File

@@ -0,0 +1,139 @@
package com.qizhi.business.customer.controller;
import com.qizhi.business.customer.dto.*;
import com.qizhi.business.customer.entity.CustomerChannel;
import com.qizhi.business.customer.service.*;
import com.qizhi.common.authentication.IgnoreSecurity;
import com.qizhi.extension.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
@Api("用户信息相关接口")
@RestController
@RequestMapping(value = "/customer")
public class CustomerController {
private static final Logger logger = LoggerFactory.getLogger(CustomerController.class);
@Autowired
private CustomerService customerService;
@Autowired
private CustomerChannelService customerChannelService;
@Autowired
private IDMCustomerService idmCustomerService;
/**
* 根据用户code和租户id查询用户对象
* @param customerCode
* @param companyId
* @return
*/
@ApiOperation(value = "查询用户对象", notes = "根据customerCode和companyId查询用户对象")
@ApiImplicitParams({
@ApiImplicitParam(name = "customerCode", value = "用户Code", dataType = "String"),
@ApiImplicitParam(name = "companyId", value = "公司id", dataType = "Long"),
@ApiImplicitParam(name = "channelId", value = "渠道ID", dataType = "Long")
})
@RequestMapping(value = "getCustomerByCode", method = RequestMethod.POST)
@IgnoreSecurity
public RestResponse<CustomerResponseDto> getCustomerByCode( String customerCode,Long companyId,Long channelId) {
if(StringUtils.isBlank(customerCode)){
return RestResponse.failed("缺失:客户编号");
}
if(companyId==null){
return RestResponse.failed("缺失公司ID");
}
if(channelId==null){
return RestResponse.failed("缺失渠道ID");
}
CustomerIDMResponseDto idmCustomer=idmCustomerService.getCustomerByLoginId(customerCode,channelId);
if (idmCustomer==null){
return RestResponse.failed("IDM用户("+customerCode+")未同步到客服系统");
}
CustomerResponseDto customerDto=new CustomerResponseDto();
customerDto.setCustomerId(idmCustomer.getId());
customerDto.setCustomerCode(idmCustomer.getLoginId());
customerDto.setCustomerChannelId(idmCustomer.getCustomerChannelId());
customerDto.setCompanyId(companyId);
customerDto.setName(idmCustomer.getUserName());
customerDto.setNickName(idmCustomer.getUserName());
customerDto.setTel(idmCustomer.getMobile());
customerDto.setEmail(idmCustomer.getEmail());
customerDto.setLevel(idmCustomer.getIsVip());
customerDto.setSubCompanyCode(idmCustomer.getSubCompanyCode());
customerDto.setAvatar(null);
return RestResponse.succesed(customerDto);
}
/**
* 根据ID查询用户
*
* @param customerId
* @return
*/
@ApiOperation(value = "获取用户详细信息", notes = "根据url的id来获取用户详细信息")
@RequestMapping(value = "getCustomerById",method = RequestMethod.POST)
@ApiImplicitParam(name = "customerId", required = true, value = "顾客ID", dataType = "Long")
@IgnoreSecurity
public RestResponse<CustomerRespDto> getCustomerById(Long customerId) {
if(customerId==null){
return RestResponse.failed("缺失顾客ID");
}
CustomerRespDto customerDto=customerService.findByCustomerId(customerId,null);
if (customerDto==null){
return RestResponse.failed("未查询到顾客");
}
List<CustomerLabelRespDto> customerLabelList = customerService.getCustomerLabelByCustomerId(customerId);
customerDto.setCustomerLabelList(customerLabelList);
return RestResponse.succesed(customerDto);
}
/**
* 根据ID查询用户
*
* @param customerId
* @return
*/
@ApiOperation(value = "获取用户详细信息", notes = "根据url的id来获取用户详细信息")
@RequestMapping(value = "getBaseCustomerById",method = RequestMethod.POST)
@ApiImplicitParam(name = "customerId", required = true, value = "顾客ID", dataType = "Long")
@IgnoreSecurity
public RestResponse<CustomerRespDto> getBaseCustomerById(Long customerId,Long companyId) {
CustomerRespDto customerDto = customerService.findByCustomerId(customerId,companyId);
if (customerDto==null){
return RestResponse.failed("不存在此用户");
}
return RestResponse.succesed(customerDto);
}
/**
* 根据customerChannelId获取客服ID
* @param customerChannelId
* @return
*/
@ApiOperation(value = "根据customerChannelId获取客服ID", notes = "根据customerChannelId获取客服ID")
@RequestMapping(value = "getCustomerIdByCustomerChannelId", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "customerChannelId", value = "顾客渠道id", dataType = "Long")
})
@IgnoreSecurity
public RestResponse<CustomerChannel> getCustomerIdByCustomerChannelId( Long customerChannelId) {
CustomerChannel customerChannel = customerChannelService.findByCustomerChannelId(customerChannelId);
return RestResponse.succesed(customerChannel);
}
}

View File

@@ -0,0 +1,255 @@
package com.qizhi.business.customer.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qizhi.business.customer.dto.*;
import com.qizhi.business.customer.entity.CustomerLabel;
import com.qizhi.business.customer.service.*;
import com.qizhi.extension.RestResponse;
import io.shardingsphere.transaction.annotation.ShardingTransactionType;
import io.shardingsphere.transaction.api.TransactionType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.modelmapper.ModelMapper;
import org.modelmapper.TypeToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Condition;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
import java.util.Map;
@Api("用户标签信息相关接口")
@RestController
@RequestMapping(value = "/customerLabel")
public class CustomerLabelController {
private static final Logger logger = LoggerFactory.getLogger(CustomerLabelController.class);
@Autowired
private CustomerService customerService;
@Autowired
private CustomerLabelService customerLabelService;
@Autowired
private CustomerLabelRelatedService customerLabelRelatedService;
/**
* 用户标签列表
* @param customerLabelReqDto
* @return
*/
@ApiOperation(value = "用户标签列表", notes = "用户标签列表")
@RequestMapping(value = "getCustomerLabelList", method = RequestMethod.POST)
@ShardingTransactionType(TransactionType.LOCAL)
@Transactional(propagation = Propagation.REQUIRED)
public RestResponse<PageInfo> getCustomerLabelList(CustomerLabelReqDto customerLabelReqDto) {
Integer page=customerLabelReqDto.getPage();
Integer rows=customerLabelReqDto.getPage();
if(page==null){
page=1;
}
if(rows==null){
rows=10;
}
PageHelper.startPage(page,rows);
Condition condition = new Condition(CustomerLabel.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("delStatus",1);
criteria.andEqualTo("companyId", customerLabelReqDto.getCompanyId());
condition.orderBy("updateTime" ).desc();
List<CustomerLabel> customerLabelList = customerLabelService.getByConditions(condition);
PageInfo pageInfo = new PageInfo(customerLabelList);
ModelMapper modelMapper = new ModelMapper();
List<CustomerLabelRespDto> labelDtoList = modelMapper.map(customerLabelList,new TypeToken<List<CustomerLabelRespDto>>() {}.getType());
pageInfo.setList(labelDtoList);
return RestResponse.succesed(pageInfo);
}
/**
* 用户标签列表 不分页
* @param companyId
* @return
*/
@ApiOperation(value = "用户标签列表", notes = "用户标签列表")
@ApiImplicitParam(name = "companyId", value = "租户Id", dataType = "Long")
@RequestMapping(value = "getAllCustomerLabelList", method = RequestMethod.POST)
public RestResponse<List<CustomerLabelRespDto>> getAllCustomerLabelList(Long companyId) {
Condition condition = new Condition(CustomerLabel.class);
Condition.Criteria criteria = condition.createCriteria();
criteria.andEqualTo("delStatus",1);
criteria.andEqualTo("companyId", companyId);
condition.orderBy("createTime").desc();
List<CustomerLabel> customerLabelList = customerLabelService.getByConditions(condition);
ModelMapper modelMapper = new ModelMapper();
List<CustomerLabelRespDto> labelDtoList = modelMapper.map(customerLabelList,new TypeToken<List<CustomerLabelRespDto>>() {}.getType());
return RestResponse.succesed(labelDtoList);
}
/**
* 客户管理页面用户标签列表
* @param companyId
* @return
*/
@ApiOperation(value = "用户标签列表", notes = "用户标签列表")
@ApiImplicitParam(name = "companyId", value = "公司Id", dataType = "Long")
@RequestMapping(value = "getCustomerAllLabelList", method = RequestMethod.POST)
public RestResponse<List<CustomerLabelRespDto>> getCustomerAllLabelList(Long companyId) {
List<CustomerLabel> customerLabelList = customerLabelService.findAllLabel(companyId);
ModelMapper modelMapper = new ModelMapper();
List<CustomerLabelRespDto> labelDtoList = modelMapper.map(customerLabelList,new TypeToken<List<CustomerLabelRespDto>>() {}.getType());
return RestResponse.succesed(labelDtoList);
}
/**
* 根据customerId查询LabelList
* @param customerId
* @return
*/
@ApiOperation(value = "用户标签", notes = "根据customerId查询用户标签")
@ApiImplicitParam(name = "customerId", value = "用户Id", dataType = "Long")
@RequestMapping(value = "getCustomerLabelByCustomerId", method = RequestMethod.POST)
public RestResponse<List<Map<Long,Object>>> getCustomerLabelByCustomerId(Long customerId) {
List<Map<Long,Object>> customerLabelList = customerLabelService.findCusByCustomerId(customerId);
return RestResponse.succesed(customerLabelList);
}
/**
* 根据labelId查询LabelList
* @param labelId
* @return
*/
@ApiOperation(value = "用户标签详情", notes = "用户标签详情")
@ApiImplicitParam(name = "labelId", value = "标签Id", dataType = "Long")
@RequestMapping(value = "getCustomerLabelById", method = RequestMethod.POST)
public RestResponse<CustomerLabelRespDto> getCustomerLabelById(Long labelId) {
CustomerLabel customerLabel= customerLabelService.findByLabelId(labelId);
if (customerLabel==null){
return RestResponse.failed("不存在此标签");
}
ModelMapper modelMapper = new ModelMapper();
CustomerLabelRespDto customerLabelRespDto = modelMapper.map(customerLabel, CustomerLabelRespDto.class);
return RestResponse.succesed(customerLabelRespDto);
}
/**
* 用户标签添加
* @param customerLabelSaveReqDto
* @return
*/
@ApiOperation(value = "用户标签添加", notes = "用户标签添加")
@RequestMapping(value = "addCustomerLabel", method = RequestMethod.POST)
public RestResponse<Long> addCustomerLabel(@RequestBody CustomerLabelSaveReqDto customerLabelSaveReqDto) {
if(customerLabelSaveReqDto.getName()==null || "".equals(customerLabelSaveReqDto.getName()) || customerLabelSaveReqDto.getColor()==null || "".equals(customerLabelSaveReqDto.getColor())){
return RestResponse.failed("标签设置错误,请重新输入");
}else{
List<CustomerLabel> cLabel=customerLabelService.getAllLabel(customerLabelSaveReqDto.getCompanyId());
for (CustomerLabel cl:cLabel) {
if(cl.getName().equals(customerLabelSaveReqDto.getName()) && cl.getDelStatus()==1){
return RestResponse.failed("已有重复标签,请重新输入");
}
}
Condition condition = new Condition(CustomerLabel.class);
Example.Criteria criteria = condition.createCriteria();
Long id=customerLabelService.saveLabelInfo(customerLabelSaveReqDto);
return RestResponse.succesed(id);
}
}
/**
* 用户标签编辑
* @param customerLabelSaveReqDto
* @return
*/
@ApiOperation(value = "用户标签编辑", notes = "用户标签编辑")
@RequestMapping(value = "editCustomerLabel", method = RequestMethod.POST)
public RestResponse<Long> editCustomerLabel(@RequestBody CustomerLabelSaveReqDto customerLabelSaveReqDto) {
if(customerLabelSaveReqDto.getName()==null || "".equals(customerLabelSaveReqDto.getName()) || customerLabelSaveReqDto.getColor()==null || "".equals(customerLabelSaveReqDto.getColor())){
return RestResponse.failed("标签设置错误,请重新输入");
}else{
CustomerLabel customerLabel=customerLabelService.findByLabelId(customerLabelSaveReqDto.getLabelId());
if(customerLabelSaveReqDto.getName().equals(customerLabel.getName()) && customerLabelSaveReqDto.getColor().equals(customerLabel.getColor())){
return RestResponse.failed("未作任何修改,请重新输入");
}
if(customerLabelSaveReqDto.getName().equals(customerLabel.getName())){
//只修改了颜色
customerLabel.setColor(customerLabelSaveReqDto.getColor());
customerLabel.setUpdateTime(System.currentTimeMillis());
customerLabel.setUpdateId(customerLabelSaveReqDto.getLoginUserId());
customerLabelService.submitCustomerLabel(customerLabel);
}else{//标签颜色和名称都修改了
List<CustomerLabel> cLabel=customerLabelService.getAllLabel(customerLabelSaveReqDto.getCompanyId());
for (CustomerLabel cl:cLabel) {
if(cl.getName().equals(customerLabelSaveReqDto.getName()) && cl.getDelStatus()==1){
return RestResponse.failed("已有重复标签,请重新输入");
}
}
customerLabel.setColor(customerLabelSaveReqDto.getColor());
customerLabel.setName(customerLabelSaveReqDto.getName());
customerLabel.setUpdateTime(System.currentTimeMillis());
customerLabel.setUpdateId(customerLabelSaveReqDto.getLoginUserId());
customerLabelService.submitCustomerLabel(customerLabel);
}
return RestResponse.succesed();
}
}
/**
* 用户标签删除
* @param labelId
* @return
*/
@ApiOperation(value = "用户标签删除", notes = "用户标签删除")
@RequestMapping(value = "delCustomerLabel", method = RequestMethod.POST)
public RestResponse delCustomerLabel(Long labelId,Long userId) {
CustomerLabel customerLabel= customerLabelService.findByLabelId(labelId);
if(customerLabel==null||customerLabel.getDelStatus()==2){//存在
return RestResponse.failed("标签不存在,请确认后重试");
}
customerLabelService.delCustLabel(customerLabel,userId);
return RestResponse.succesed();
}
/**
* 用户相关标签列表
* @param customerId
* @return
*/
@ApiOperation(value = "用户相关标签列表", notes = "查询用户相关标签列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "customerId", required = true, value = "顾客ID", dataType = "Long")
})
@RequestMapping(value = "getCustomerLabelRelatedList", method = RequestMethod.POST)
public RestResponse<List<Map<Long,Object>>> getCustomerLabelRelatedList(Long customerId) {
List<Map<Long,Object>> customerLabelRelatedList = customerLabelRelatedService.getCustomerLabelRelatedListByCustomerId(customerId);
return RestResponse.succesed(customerLabelRelatedList);
}
/**
* 用户标签查询
* @param customerId
* @return
*/
@ApiOperation(value = "用户标签查询", notes = "用户标签查询")
@RequestMapping(value = "getLabelByCustomerId", method = RequestMethod.POST)
public RestResponse<List<CustomerLabelRespDto>> getLabelByCustomerId(Long customerId) {
List<CustomerLabelRespDto> customerLabelList = customerService.getCustomerLabelByCustomerId(customerId);
return RestResponse.succesed(customerLabelList);
}
}

View File

@@ -0,0 +1,95 @@
package com.qizhi.business.customer.controller;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.reflect.TypeToken;
import com.qizhi.business.customer.dto.EsbInfoDto;
import com.qizhi.business.customer.dto.IDMResponses;
import com.qizhi.business.customer.dto.SubCompanyInfoReqDto;
import com.qizhi.business.customer.service.IDMCompanyService;
import com.qizhi.common.authentication.IgnoreSecurity;
import com.qizhi.im.utils.GsonUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@Api(tags = "IDM分部信息相关接口")
@RestController
@RequestMapping(value = "/idmCompany")
public class IDMCompanyController {
private static final Logger logger = LoggerFactory.getLogger(IDMCustomerController.class);
@Autowired
private IDMCompanyService idmCompanyService;
@ApiOperation(value = "新增分部(IDM调用)", notes = "新增分部(IDM调用)")
@RequestMapping(value = "/createCompany", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@IgnoreSecurity
@ResponseBody
public IDMResponses createCompany(@RequestBody String dataStr) {
Date requestTime = new Date();
IDMResponses idmResponses = new IDMResponses();
EsbInfoDto esbInfo = new EsbInfoDto();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String instId = UUID.randomUUID().toString();
StringBuilder subCompanyCodes = new StringBuilder();
logger.info("[instId='"+instId+"']createCompany[param] = "+ dataStr);
try{
JSONObject jsonObj = JSONObject.parseObject(dataStr);
esbInfo = GsonUtils.parse(jsonObj.get("esbInfo").toString(), EsbInfoDto.class);
esbInfo.setRequestTime(df.format(requestTime));
// logger.info("[instId='"+esbInfo.getInstId()+"']createCompany[param] = "+ dataStr);
List<SubCompanyInfoReqDto> requestInfo = GsonUtils.getInstance().fromJson(jsonObj.get("requestInfo").toString(), new TypeToken<List<SubCompanyInfoReqDto>>(){}.getType());
String errorStr = "";
for(SubCompanyInfoReqDto subCompanyInfo: requestInfo){
if(subCompanyInfo.getSubCompanyCode()==null || "".equals(subCompanyInfo.getSubCompanyCode())){
errorStr+="存在信息缺少必填字段【分部编号】";
break;
}else{
subCompanyCodes.append(subCompanyInfo.getSubCompanyCode()).append(",");
}
if(subCompanyInfo.getStatus()==null || "".equals(subCompanyInfo.getStatus())){
errorStr+="存在信息缺少必填字段【是否生效】";
break;
}
if(subCompanyInfo.getLastUpdateDate()==null || "".equals(subCompanyInfo.getLastUpdateDate())){
errorStr+="存在信息缺少必填字段【上次更新时间】";
break;
}
}
if(!"".equals(errorStr)){
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("E");
esbInfo.setReturnCode("E0002");
esbInfo.setReturnMsg("分部编码["+subCompanyCodes+"]接收失败,"+errorStr);
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
idmCompanyService.createCompany(requestInfo);
}catch (Exception e){
e.printStackTrace();
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("E");
esbInfo.setReturnCode("E0002");
esbInfo.setReturnMsg("系统异常");
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("S");
esbInfo.setReturnCode("A0001");
esbInfo.setReturnMsg("分部编码["+subCompanyCodes+"]接收成功");
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
}

View File

@@ -0,0 +1,219 @@
package com.qizhi.business.customer.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qizhi.business.customer.dto.*;
import com.qizhi.business.customer.entity.IDMCompany;
import com.qizhi.business.customer.entity.IDMCustomer;
import com.qizhi.business.customer.service.IDMCompanyService;
import com.qizhi.business.customer.service.IDMCustomerService;
import com.qizhi.common.authentication.IgnoreSecurity;
import com.qizhi.extension.RestResponse;
import com.qizhi.im.utils.GsonUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.modelmapper.ModelMapper;
import org.modelmapper.TypeToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Condition;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
@Api(tags = "IDM用户信息相关接口")
@RestController
@RequestMapping(value = "/idmCustomer")
public class IDMCustomerController {
private static final Logger logger = LoggerFactory.getLogger(IDMCustomerController.class);
@Autowired
private IDMCustomerService idmCustomerService;
@Autowired
private IDMCompanyService idmCompanyService;
@ApiOperation(value = "新增用户(IDM调用)", notes = "新增用户(IDM调用)")
@RequestMapping(value = "/createCustomer", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@IgnoreSecurity
@ResponseBody
public IDMResponses createCustomer(@RequestBody String dataStr) {
Date requestTime = new Date();
IDMResponses idmResponses = new IDMResponses();
EsbInfoDto esbInfo = new EsbInfoDto();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String loginId = "";
String instId = UUID.randomUUID().toString();
logger.info("[instId='"+instId+"']createCustomerForIDM[param] = "+ dataStr);
try{
JSONObject jsonObj = JSONObject.parseObject(dataStr);
esbInfo = GsonUtils.parse(jsonObj.get("esbInfo").toString(), EsbInfoDto.class);
esbInfo.setRequestTime(df.format(requestTime));
// logger.info("[instId='"+esbInfo.getInstId()+"']createCustomerForIDM[param] = "+ dataStr);
IDMCustomerReqDto requestInfo = GsonUtils.parse(jsonObj.get("requestInfo").toString(), IDMCustomerReqDto.class);
String errorStr = "";
//用户信息
UserInfoReqDto userInfoReqDto = requestInfo.getUserInfo();
if(userInfoReqDto.getUserType()==null || "".equals(userInfoReqDto.getUserType())){
errorStr+="缺少用户类型,";
}
if(userInfoReqDto.getUserName()==null || "".equals(userInfoReqDto.getUserName())){
errorStr+="缺少姓名,";
}
if(userInfoReqDto.getMobile()==null || "".equals(userInfoReqDto.getMobile())){
errorStr+="缺少移动电话,";
}
if(userInfoReqDto.getEmail()==null || "".equals(userInfoReqDto.getEmail())){
errorStr+="缺少电子邮件,";
}
//账号信息
AccountInfoReqDto accountInfoReqDto = requestInfo.getAccountInfo();
if(accountInfoReqDto.getLoginId()==null || "".equals(accountInfoReqDto.getLoginId())){
errorStr+="缺少登录名,";
}else{
loginId = accountInfoReqDto.getLoginId();
}
if(accountInfoReqDto.getStatus()==null || "".equals(accountInfoReqDto.getStatus())){
errorStr+="缺少身份状态,";
}
//组织信息
OrgInfoReqDto orgInfoReqDto = requestInfo.getOrgInfo();
if(orgInfoReqDto.getSubCompanyCode()==null || "".equals(orgInfoReqDto.getSubCompanyCode())){
errorStr+="缺少分部编号,";
}
if(orgInfoReqDto.getDepartmentCode()==null || "".equals(orgInfoReqDto.getDepartmentCode())){
errorStr+="缺少部门编号,";
}
if(orgInfoReqDto.getPositionCode()==null || "".equals(orgInfoReqDto.getPositionCode())){
errorStr+="缺少所属岗位编号,";
}
//基础信息
UserBasesInfoDto userBasesInfoDto = requestInfo.getBaseInfo();
if(!"".equals(errorStr)){
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("E");
esbInfo.setReturnCode("E0002");
esbInfo.setReturnMsg("用户名 "+loginId+" 接收失败,"+errorStr);
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
idmCustomerService.createCustomer(userInfoReqDto,accountInfoReqDto,orgInfoReqDto,userBasesInfoDto);
}catch (Exception e){
e.printStackTrace();
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("E");
esbInfo.setReturnCode("E0002");
esbInfo.setReturnMsg("用户名 "+loginId+" 接收失败,系统异常");
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("S");
esbInfo.setReturnCode("A0001");
esbInfo.setReturnMsg("用户名 "+loginId+" 接收成功");
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
@ApiOperation(value = "获取IDM用户列表", notes = "获取IDM用户列表")
@RequestMapping(value = "/getCustomerList", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "userName", value = "姓名", dataType = "String"),
@ApiImplicitParam(name = "positionCode", value = "所属岗位编号", dataType = "String"),
@ApiImplicitParam(name = "subCompanyCode", value = "部门编号", dataType = "String"),
@ApiImplicitParam(name = "isVip", value = "是否为Vip 0:否 1:是", dataType = "Integer"),
@ApiImplicitParam(name = "status", value = "身份状态 ENABLE生效 DISABLE失效", dataType = "String"),
@ApiImplicitParam(name = "page", required = true, value = "当前页", dataType = "Integer"),
@ApiImplicitParam(name = "rows", required = true, value = "页数", dataType = "Integer")
})
private RestResponse<PageInfo> getCustomerList(String userName,String positionCode,String subCompanyCode,Integer isVip, String status, Integer page, Integer rows){
PageHelper.startPage(null == page?1:page,null == rows?10:rows);
Condition condition = new Condition(IDMCustomer.class);
Condition.Criteria criteria = condition.createCriteria();
if(StringUtils.isNotBlank(userName)){
criteria.andLike("userName","%"+userName+"%");
}
if(StringUtils.isNotBlank(positionCode)){
criteria.andEqualTo("positionCode",positionCode);
}
if(StringUtils.isNotBlank(subCompanyCode)){
criteria.andEqualTo("subCompanyCode",subCompanyCode);
}
if(isVip!=null){
criteria.andEqualTo("isVip",isVip);
}
if(StringUtils.isNotBlank(status)){
criteria.andEqualTo("status",status);
}
List<IDMCustomer> resultList = idmCustomerService.findByCondition(condition);
PageInfo pageInfo = new PageInfo<>(resultList);
ModelMapper modelMapper = new ModelMapper();
List<CustomerIDMRespDto> resultRespList = modelMapper.map(resultList,new TypeToken<List<CustomerIDMRespDto>>() {}.getType());
if(resultRespList.size()>0){
List<String> companyCodes = resultRespList.stream().map(CustomerIDMRespDto::getSubCompanyCode).collect(Collectors.toList());
Condition companyCondition = new Condition(IDMCompany.class);
Condition.Criteria deptCriteria = companyCondition.createCriteria();
deptCriteria.andIn("subCompanyCode",companyCodes);
List<IDMCompany> idmCompanies = idmCompanyService.findByCondition(companyCondition);
for(CustomerIDMRespDto customerResp:resultRespList){
for(IDMCompany idmCompany:idmCompanies){
if(customerResp.getSubCompanyCode().equals(idmCompany.getSubCompanyCode())){
customerResp.setsComName(idmCompany.getsComName());
break;
}
}
}
}
pageInfo.setList(resultRespList);
return RestResponse.succesed(pageInfo);
}
@ApiOperation(value = "获取IDM用户详情", notes = "获取IDM用户列表")
@RequestMapping(value = "/getCustomerDetail", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "用户id", dataType = "Long")
})
public RestResponse getCustomerDetail(Long id){
CustomerIDMRespDto customerRespDto = idmCustomerService.getCustomerDetail(id);
return RestResponse.succesed(customerRespDto);
}
@ApiOperation(value = "修改IDM用户vip状态", notes = "修改IDM用户vip状态")
@RequestMapping(value = "/changeCustomerVipStatus", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "用户id", dataType = "Long"),
@ApiImplicitParam(name = "isVip", value = "是否为Vip 0:否 1:是", dataType = "Integer")
})
public RestResponse changeCustomerVipStatus(Long id,Integer isVip){
idmCustomerService.updateVipStatusById(id,isVip);
return RestResponse.succesed();
}
@ApiOperation(value = "获取可创建的用户列表", notes = "获取可创建的用户列表")
@RequestMapping(value = "/getCanBeCreateUserList", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "subCompanyId", value = "分部id", dataType = "Long"),
@ApiImplicitParam(name = "keyword", value = "关键字(模糊查询姓名)", dataType = "String")
})
public RestResponse getCanBeCreateUserList(String subCompanyCode,String keyword){
List<SelectDto> list = idmCustomerService.getCanBeCreateUserList(subCompanyCode,keyword);
return RestResponse.succesed(list);
}
}

View File

@@ -0,0 +1,117 @@
package com.qizhi.business.customer.controller;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.reflect.TypeToken;
import com.qizhi.business.customer.dto.DeptInfoReqDto;
import com.qizhi.business.customer.dto.DeptTreeNode;
import com.qizhi.business.customer.dto.EsbInfoDto;
import com.qizhi.business.customer.dto.IDMResponses;
import com.qizhi.business.customer.service.IDMDepartmentService;
import com.qizhi.common.authentication.IgnoreSecurity;
import com.qizhi.extension.RestResponse;
import com.qizhi.im.utils.GsonUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@Api(tags = "IDM部门信息相关接口")
@RestController
@RequestMapping(value = "/idmDepartment")
public class IDMDepartmentController {
private static final Logger logger = LoggerFactory.getLogger(IDMDepartmentController.class);
@Autowired
private IDMDepartmentService idmDepartmentService;
@ApiOperation(value = "新增部门(IDM调用)", notes = "新增部门(IDM调用)")
@RequestMapping(value = "/createDepartment", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@IgnoreSecurity
@ResponseBody
public IDMResponses createDepartment(@RequestBody String dataStr) {
Date requestTime = new Date();
IDMResponses idmResponses = new IDMResponses();
EsbInfoDto esbInfo = new EsbInfoDto();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
StringBuilder deptCodes = new StringBuilder();
String instId = UUID.randomUUID().toString();
logger.info("[instId='"+instId+"']createDepartment[param] = "+ dataStr);
try{
JSONObject jsonObj = JSONObject.parseObject(dataStr);
esbInfo = GsonUtils.parse(jsonObj.get("esbInfo").toString(), EsbInfoDto.class);
esbInfo.setRequestTime(df.format(requestTime));
// logger.info("[instId='"+esbInfo.getInstId()+"']createDepartment[param] = "+ dataStr);
List<DeptInfoReqDto> requestInfo = GsonUtils.getInstance().fromJson(jsonObj.get("requestInfo").toString(), new TypeToken<List<DeptInfoReqDto>>(){}.getType());
String errorStr = "";
for(DeptInfoReqDto deptInfo:requestInfo){
if(deptInfo.getDeptCode()==null || "".equals(deptInfo.getDeptCode())){
errorStr+="存在信息缺少必填字段【部门编码】";
break;
}else{
deptCodes.append(deptInfo.getDeptCode()).append(",");
}
if(deptInfo.getStatus()==null || "".equals(deptInfo.getStatus())){
errorStr+="存在信息缺少必填字段【是否生效】";
break;
}
if(deptInfo.getLastUpdateDate()==null || "".equals(deptInfo.getLastUpdateDate())){
errorStr+="存在信息缺少必填字段【上次更新时间】";
break;
}
}
if(!"".equals(errorStr)){
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("E");
esbInfo.setReturnCode("E0002");
esbInfo.setReturnMsg("部门编码["+deptCodes+"]接收失败,"+errorStr);
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
idmDepartmentService.createDepartment(requestInfo);
}catch (Exception e){
e.printStackTrace();
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("E");
esbInfo.setReturnCode("E0002");
esbInfo.setReturnMsg("部门编码["+deptCodes+"]接收失败,系统异常");
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("S");
esbInfo.setReturnCode("A0001");
esbInfo.setReturnMsg("部门编码["+deptCodes+"]接收成功");
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
@ApiOperation(value = "获取IDM部门菜单树", notes = "获取IDM部门菜单树")
@RequestMapping(value = "/getDeptTree", method = RequestMethod.POST)
@ApiImplicitParams({
@ApiImplicitParam(name = "status", value = "状态Y 生效默认传Y不传则显示所有", dataType = "String", defaultValue = "Y")
})
public RestResponse getDeptTree(String status){
List<DeptTreeNode> list = idmDepartmentService.getDeptTree(status);
return RestResponse.succesed(list);
}
@ApiOperation(value = "获取运维部门菜单树", notes = "获取运维部门菜单树")
@RequestMapping(value = "/getUserDeptTree", method = RequestMethod.POST)
public RestResponse getUserDeptTree(){
List<DeptTreeNode> list = idmDepartmentService.getUserDeptTree();
return RestResponse.succesed(list);
}
}

View File

@@ -0,0 +1,109 @@
package com.qizhi.business.customer.controller;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.reflect.TypeToken;
import com.qizhi.business.customer.dto.EsbInfoDto;
import com.qizhi.business.customer.dto.IDMResponses;
import com.qizhi.business.customer.dto.PositionInfoReqDto;
import com.qizhi.business.customer.dto.PositionLabelRespDto;
import com.qizhi.business.customer.entity.IDMPosition;
import com.qizhi.business.customer.service.IDMPositionService;
import com.qizhi.common.authentication.IgnoreSecurity;
import com.qizhi.common.utils.CubeBeanUtils;
import com.qizhi.extension.RestResponse;
import com.qizhi.im.utils.GsonUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@Api(tags = "IDM岗位信息相关接口")
@RestController
@RequestMapping(value = "/idmPosition")
public class IDMPositionController {
private static final Logger logger = LoggerFactory.getLogger(IDMPositionController.class);
@Autowired
private IDMPositionService idmPositionService;
@ApiOperation(value = "新增岗位(IDM调用)", notes = "新增岗位(IDM调用)")
@RequestMapping(value = "/createPosition", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
@IgnoreSecurity
@ResponseBody
public IDMResponses createPosition(@RequestBody String dataStr) {
Date requestTime = new Date();
IDMResponses idmResponses = new IDMResponses();
EsbInfoDto esbInfo = new EsbInfoDto();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
StringBuilder positionCodes = new StringBuilder();
String instId = UUID.randomUUID().toString();
logger.info("[instId='"+instId+"']createPosition[param] = "+ dataStr);
try{
JSONObject jsonObj = JSONObject.parseObject(dataStr);
esbInfo = GsonUtils.parse(jsonObj.get("esbInfo").toString(), EsbInfoDto.class);
esbInfo.setRequestTime(df.format(requestTime));
// logger.info("[instId='"+esbInfo.getInstId()+"']createPosition[param] = "+ dataStr);
List<PositionInfoReqDto> requestInfo = GsonUtils.getInstance().fromJson(jsonObj.get("requestInfo").toString(), new TypeToken<List<PositionInfoReqDto>>(){}.getType());
String errorStr = "";
for(PositionInfoReqDto positionInfo: requestInfo){
if(positionInfo.getPositionCode()==null || "".equals(positionInfo.getPositionCode())){
errorStr+="存在信息缺少必填字段【岗位编码】";
break;
}else{
positionCodes.append(positionInfo.getPositionCode()).append(",");
}
if(positionInfo.getStatus()==null || "".equals(positionInfo.getStatus())){
errorStr+="存在信息缺少必填字段【是否生效】";
break;
}
if(positionInfo.getLastUpdateDate()==null || "".equals(positionInfo.getLastUpdateDate())){
errorStr+="存在信息缺少必填字段【最后更新日期】";
break;
}
}
if(!"".equals(errorStr)){
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("E");
esbInfo.setReturnCode("E0002");
esbInfo.setReturnMsg("岗位编码["+positionCodes+"]接收失败,"+errorStr);
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
idmPositionService.createPosition(requestInfo);
}catch (Exception e){
e.printStackTrace();
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("E");
esbInfo.setReturnCode("E0002");
esbInfo.setReturnMsg("岗位编码["+positionCodes+"]接收失败,系统异常");
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
esbInfo.setInstId(instId);
esbInfo.setReturnStatus("S");
esbInfo.setReturnCode("A0001");
esbInfo.setReturnMsg("岗位编码["+positionCodes+"]接收成功");
esbInfo.setResponseTime(df.format(new Date()));
idmResponses.setEsbInfo(esbInfo);
return idmResponses;
}
@ApiOperation(value = "获取岗位下拉列表(包括失效的)", notes = "新增岗位(IDM调用)")
@RequestMapping(value = "/getPositionLabelList", method = RequestMethod.POST)
public RestResponse getPositionLabelList(){
List<IDMPosition> list = idmPositionService.findAll();
List<PositionLabelRespDto> respList = new ArrayList<>();
CubeBeanUtils.copyCollection(respList,list,PositionLabelRespDto.class);
return RestResponse.succesed(respList);
}
}

View File

@@ -0,0 +1 @@
7b57e47f-15f6-462e-acb0-8b2ccfca30a1

View File

@@ -0,0 +1,98 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "AccountInfoReqDto", description = "IDM账户信息")
public class AccountInfoReqDto {
@ApiModelProperty(value = "登录名")
private String loginId;
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "身份状态")
private String status;
@ApiModelProperty(value = "弹性字段6")
private String empTypeA;
@ApiModelProperty(value = "弹性字段1")
private String attr1;
@ApiModelProperty(value = "弹性字段2")
private String attr2;
@ApiModelProperty(value = "弹性字段3")
private String attr3;
@ApiModelProperty(value = "弹性字段4")
private String attr4;
@ApiModelProperty(value = "弹性字段5")
private String attr5;
public String getLoginId() {
return loginId;
}
public void setLoginId(String loginId) {
this.loginId = loginId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getEmpTypeA() {
return empTypeA;
}
public void setEmpTypeA(String empTypeA) {
this.empTypeA = empTypeA;
}
public String getAttr1() {
return attr1;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr2() {
return attr2;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr3() {
return attr3;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr4() {
return attr4;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr5() {
return attr5;
}
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
}

View File

@@ -0,0 +1,359 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
/**
* @date Tue Feb 12 16:38:32 CST 2019
*/
public class CustomerDto {
@ApiModelProperty(value = "顾客ID", required = true)
private Long customerId;
@ApiModelProperty(value = "顾客分渠道ID", required = true)
private Long customerChannelId;
@ApiModelProperty(value = "用户编号", required = true)
private String customerCode;
@ApiModelProperty(value = "公司ID", required = true)
private Long companyId;
@ApiModelProperty(value = "用户姓名")
private String name;
@ApiModelProperty(value = "联系方式")
private String tel;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "顾客等级")
private Integer level;
@ApiModelProperty(value = "头像")
private String avatar;
@ApiModelProperty(value = "省份")
private String provinceCode;
@ApiModelProperty(value = "城市")
private String cityCode;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "微信号")
private String wxNumber;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "备用字段1")
private String field1;
@ApiModelProperty(value = "备用字段2")
private String field2;
@ApiModelProperty(value = "备用字段3")
private String field3;
@ApiModelProperty(value = "备用字段4")
private String field4;
@ApiModelProperty(value = "备用字段1")
private String field5;
@ApiModelProperty(value = "来源终端 枚举: APP WEB WX", required = true)
private String terminal;
@ApiModelProperty(value = "来源终端信息")
private String terminalInfo;
@ApiModelProperty(value = "咨询问题类型ID")
private Long consultId;
@ApiModelProperty(value = "来源渠道ID", required = true)
private Long sourceChannelId;
@ApiModelProperty(value = "网站id", required = true)
private String thirdId;
@ApiModelProperty("来源IP地址")
private String sourceIp;
@ApiModelProperty("IM服务")
private String serverName;
@ApiModelProperty(value ="是否自动转人工,1自动2主动", required = true)
private Integer type;
@ApiModelProperty(value = "分部编号")
private String subCompanyCode;
@ApiModelProperty(value = "部门编号")
private String departmentCode;
// @ApiModelProperty(value = "所属岗位编号")
// private String positionCode;
// @ApiModelProperty(value = "岗位名称")
// private String positionName;
public Long getCustomerId() {
return this.customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Long getCustomerChannelId() {
return customerChannelId;
}
public void setCustomerChannelId(Long customerChannelId) {
this.customerChannelId = customerChannelId;
}
public String getCustomerCode() {
return this.customerCode;
}
public void setCustomerCode(String customerCode) {
this.customerCode = customerCode;
}
public Long getCompanyId() {
return this.companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getTel() {
return this.tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getLevel() {
return this.level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getAvatar() {
return this.avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getProvinceCode() {
return this.provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
public String getCityCode() {
return this.cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
public String getNickName() {
return this.nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getWxNumber() {
return this.wxNumber;
}
public void setWxNumber(String wxNumber) {
this.wxNumber = wxNumber;
}
public String getRemark() {
return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getField1() {
return this.field1;
}
public void setField1(String field1) {
this.field1 = field1;
}
public String getField2() {
return this.field2;
}
public void setField2(String field2) {
this.field2 = field2;
}
public String getField3() {
return this.field3;
}
public void setField3(String field3) {
this.field3 = field3;
}
public String getField4() {
return this.field4;
}
public void setField4(String field4) {
this.field4 = field4;
}
public String getField5() {
return this.field5;
}
public void setField5(String field5) {
this.field5 = field5;
}
public String getTerminal() {
return terminal;
}
public void setTerminal(String terminal) {
this.terminal = terminal;
}
public String getTerminalInfo() {
return terminalInfo;
}
public void setTerminalInfo(String terminalInfo) {
this.terminalInfo = terminalInfo;
}
public Long getConsultId() {
return consultId;
}
public void setConsultId(Long consultId) {
this.consultId = consultId;
}
public Long getSourceChannelId() {
return sourceChannelId;
}
public void setSourceChannelId(Long sourceChannelId) {
this.sourceChannelId = sourceChannelId;
}
public String getThirdId() {
return thirdId;
}
public void setThirdId(String thirdId) {
this.thirdId = thirdId;
}
public String getSourceIp() {
return sourceIp;
}
public void setSourceIp(String sourceIp) {
this.sourceIp = sourceIp;
}
public String getServerName() {
return serverName;
}
public void setServerName(String serverName) {
this.serverName = serverName;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getSubCompanyCode() {
return subCompanyCode;
}
public void setSubCompanyCode(String subCompanyCode) {
this.subCompanyCode = subCompanyCode;
}
public String getDepartmentCode() {
return departmentCode;
}
public void setDepartmentCode(String departmentCode) {
this.departmentCode = departmentCode;
}
// public String getPositionCode() {
// return positionCode;
// }
//
// public void setPositionCode(String positionCode) {
// this.positionCode = positionCode;
// }
//
// public String getPositionName() {
// return positionName;
// }
//
// public void setPositionName(String positionName) {
// this.positionName = positionName;
// }
}

View File

@@ -0,0 +1,177 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
public class CustomerIDMRespDto {
@ApiModelProperty(value = "用户ID")
private Long id;
@ApiModelProperty(value = "登录名 唯一性判重字段")
private String loginId;
@ApiModelProperty(value = "姓名")
private String userName;
@ApiModelProperty(value = "所属单位(公司名称)")
private String company;
@ApiModelProperty(value = "用户状态 ENABLE在职DISABLE离职")
private String empStatus;
@ApiModelProperty(value = "分部名称")
private String sComName;
@ApiModelProperty(value = "分部全称")
private String sComFullName;
@ApiModelProperty(value = "分部id")
private Long subCompanyId;
@ApiModelProperty(value = "分部编号")
private String subCompanyCode;
@ApiModelProperty(value = "部门编号(暂时没地方回显)")
private String departmentCode;
@ApiModelProperty(value = "岗位名称")
private String positionName;
@ApiModelProperty(value = "所属岗位编号")
private String positionCode;
@ApiModelProperty(value = "电子邮件")
private String email;
@ApiModelProperty(value = "移动电话")
private String mobile;
@ApiModelProperty(value = "办公电话")
private String telephone;
@ApiModelProperty(value = "是否为Vip 0:否 1:是")
private Integer isVip;
@ApiModelProperty(value = "身份状态 ENABLE生效 DISABLE失效")
private String status;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLoginId() {
return loginId;
}
public void setLoginId(String loginId) {
this.loginId = loginId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getEmpStatus() {
return empStatus;
}
public void setEmpStatus(String empStatus) {
this.empStatus = empStatus;
}
public String getsComName() {
return sComName;
}
public void setsComName(String sComName) {
this.sComName = sComName;
}
public String getsComFullName() {
return sComFullName;
}
public void setsComFullName(String sComFullName) {
this.sComFullName = sComFullName;
}
public Long getSubCompanyId() {
return subCompanyId;
}
public void setSubCompanyId(Long subCompanyId) {
this.subCompanyId = subCompanyId;
}
public String getSubCompanyCode() {
return subCompanyCode;
}
public void setSubCompanyCode(String subCompanyCode) {
this.subCompanyCode = subCompanyCode;
}
public String getDepartmentCode() {
return departmentCode;
}
public void setDepartmentCode(String departmentCode) {
this.departmentCode = departmentCode;
}
public String getPositionName() {
return positionName;
}
public void setPositionName(String positionName) {
this.positionName = positionName;
}
public String getPositionCode() {
return positionCode;
}
public void setPositionCode(String positionCode) {
this.positionCode = positionCode;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public Integer getIsVip() {
return isVip;
}
public void setIsVip(Integer isVip) {
this.isVip = isVip;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

View File

@@ -0,0 +1,159 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
public class CustomerIDMResponseDto {
@ApiModelProperty(value = "用户ID")
private Long id;
@ApiModelProperty(value = "工号")
private String userCode;
@ApiModelProperty(value = "用户类型")
private String userType;
@ApiModelProperty(value = "姓名")
private String userName;
@ApiModelProperty(value = "性别 M男 F")
private String sex;
@ApiModelProperty(value = "移动电话")
private String mobile;
@ApiModelProperty(value = "办公电话")
private String telephone;
@ApiModelProperty(value = "电子邮件")
private String email;
@ApiModelProperty(value = "登录名")
private String loginId;
@ApiModelProperty(value = "分部编号")
private String subCompanyCode;
@ApiModelProperty(value = "部门编号")
private String departmentCode;
@ApiModelProperty(value = "所属岗位编号")
private String positionCode;
@ApiModelProperty(value = "岗位名称")
private String positionName;
@ApiModelProperty("用户分渠道主键")
private Long customerChannelId;
@ApiModelProperty(value = "是否为Vip 0:否 1:是")
private Integer isVip;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserType() {
return userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getLoginId() {
return loginId;
}
public void setLoginId(String loginId) {
this.loginId = loginId;
}
public String getSubCompanyCode() {
return subCompanyCode;
}
public void setSubCompanyCode(String subCompanyCode) {
this.subCompanyCode = subCompanyCode;
}
public String getDepartmentCode() {
return departmentCode;
}
public void setDepartmentCode(String departmentCode) {
this.departmentCode = departmentCode;
}
public String getPositionCode() {
return positionCode;
}
public void setPositionCode(String positionCode) {
this.positionCode = positionCode;
}
public String getPositionName() {
return positionName;
}
public void setPositionName(String positionName) {
this.positionName = positionName;
}
public Long getCustomerChannelId() {
return customerChannelId;
}
public void setCustomerChannelId(Long customerChannelId) {
this.customerChannelId = customerChannelId;
}
public Integer getIsVip() {
return isVip;
}
public void setIsVip(Integer isVip) {
this.isVip = isVip;
}
}

View File

@@ -0,0 +1,63 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Id;
public class CustomerLabelRelatedReqDto {
@Id
private Long customerid;
@ApiModelProperty("标签ID")
private Long labelId;
@ApiModelProperty("公司ID")
private Long companyId;
@ApiModelProperty("标签名称")
private String name;
@ApiModelProperty("标签颜色")
private String color;
public Long getCustomerid() {
return customerid;
}
public void setCustomerid(Long customerid) {
this.customerid = customerid;
}
public Long getLabelId() {
return labelId;
}
public void setLabelId(Long labelId) {
this.labelId = labelId;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}

View File

@@ -0,0 +1,102 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Id;
public class CustomerLabelReqDto {
@Id
private Long labelId;
@ApiModelProperty("公司ID")
private Long companyId;
@ApiModelProperty("标签名称")
private String name;
@ApiModelProperty("标签颜色")
private String color;
@ApiModelProperty("(1正常2删除)")
private Integer delStatus;
@ApiModelProperty("当前登录者")
private Long loginUserId;
@ApiModelProperty(value = "当前页", required = true)
private Integer page;
@ApiModelProperty(value = "页数", required = true)
private Integer rows;
public Long getLabelId() {
return labelId;
}
public void setLabelId(Long labelId) {
this.labelId = labelId;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getDelStatus() {
return delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
public Long getLoginUserId() {
return loginUserId;
}
public void setLoginUserId(Long loginUserId) {
this.loginUserId = loginUserId;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getRows() {
return rows;
}
public void setRows(Integer rows) {
this.rows = rows;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}

View File

@@ -0,0 +1,107 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Id;
public class CustomerLabelRespDto{
@Id
private Long labelId;
@ApiModelProperty("公司ID")
private Long companyId;
@ApiModelProperty("标签名称")
private String name;
@ApiModelProperty("标签颜色")
private String color;
@ApiModelProperty("(1正常2删除)")
private Integer delStatus;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("创建者")
private Long createId;
@ApiModelProperty("更新者")
private Long updateId;
public Long getLabelId() {
return labelId;
}
public void setLabelId(Long labelId) {
this.labelId = labelId;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getDelStatus() {
return delStatus;
}
public void setDelStatus(Integer delStatus) {
this.delStatus = delStatus;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public Long getCreateId() {
return createId;
}
public void setCreateId(Long createId) {
this.createId = createId;
}
public Long getUpdateId() {
return updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}

View File

@@ -0,0 +1,70 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Id;
public class CustomerLabelSaveReqDto {
@Id
private Long labelId;
@ApiModelProperty("公司ID")
private Long companyId;
@ApiModelProperty("标签名称")
private String name;
@ApiModelProperty("标签颜色")
private String color;
@ApiModelProperty("当前登录者")
private Long loginUserId;
public Long getLabelId() {
return labelId;
}
public void setLabelId(Long labelId) {
this.labelId = labelId;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getLoginUserId() {
return loginUserId;
}
public void setLoginUserId(Long loginUserId) {
this.loginUserId = loginUserId;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}

View File

@@ -0,0 +1,144 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Id;
/**
* @date Tue Feb 12 16:38:32 CST 2019
*/
public class CustomerReqDto {
@Id
private Long customerId;
@ApiModelProperty(value = "用户编号")
private String customerCode;
@ApiModelProperty(value = "用户姓名")
private String name;
@ApiModelProperty(value = "租户ID", required = true)
private Long companyId;
@ApiModelProperty(value = "联系方式")
private String tel;
@ApiModelProperty(value = "客户昵称")
private String nickName;
@ApiModelProperty(value = "搜索框")
private String searchText;
@ApiModelProperty(value = "当前页", required = true)
private Integer page;
@ApiModelProperty(value = "页数", required = true)
private Integer rows;
@ApiModelProperty(value = "相关标签",required = true)
private Long[] labelIdChoose;
@ApiModelProperty(value = "更新者",required = true)
private Long updateId;
@ApiModelProperty(value = "用户邮箱",required = true)
private String email;
public Long getUpdateId() {
return updateId;
}
public void setUpdateId(Long updateId) {
this.updateId = updateId;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Long[] getLabelIdChoose() {
return labelIdChoose;
}
public void setLabelIdChoose(Long[] labelIdChoose) {
this.labelIdChoose = labelIdChoose;
}
public String getCustomerCode() {
return customerCode;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public void setCustomerCode(String customerCode) {
this.customerCode = customerCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getSearchText() {
return searchText;
}
public void setSearchText(String searchText) {
this.searchText = searchText;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getRows() {
return rows;
}
public void setRows(Integer rows) {
this.rows = rows;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
}

View File

@@ -0,0 +1,107 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
public class CustomerRequestDto {
@ApiModelProperty(value = "公司id")
private Long companyId;
@ApiModelProperty(value = "用户id")
private Long customerId;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "用户姓名")
private String name;
@ApiModelProperty(value = "联系方式")
private String tel;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "标签id")
private Long[] labelId;
@ApiModelProperty(value = "总页数")
private Integer page;
@ApiModelProperty(value = "每页条数")
private Integer rows;
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Long[] getLabelId() {
return labelId;
}
public void setLabelId(Long[] labelId) {
this.labelId = labelId;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getRows() {
return rows;
}
public void setRows(Integer rows) {
this.rows = rows;
}
}

View File

@@ -0,0 +1,254 @@
package com.qizhi.business.customer.dto;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
/**
* @date Tue Feb 12 16:38:32 CST 2019
*/
public class CustomerRespDto {
@ApiModelProperty(value = "顾客ID")
private Long customerId;
@ApiModelProperty(value = "用户编号")
private String customerCode;
@ApiModelProperty(value = "公司ID")
private Long companyId;
@ApiModelProperty(value = "用户姓名")
private String name;
@ApiModelProperty(value = "联系方式")
private String tel;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "顾客等级")
private Integer level;
@ApiModelProperty(value = "头像")
private String avatar;
@ApiModelProperty(value = "省份")
private String provinceCode;
@ApiModelProperty(value = "城市")
private String cityCode;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "微信号")
private String wxNumber;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "备用字段1")
private String field1;
@ApiModelProperty(value = "备用字段2")
private String field2;
@ApiModelProperty(value = "备用字段3")
private String field3;
@ApiModelProperty(value = "备用字段4")
private String field4;
@ApiModelProperty(value = "备用字段1")
private String field5;
@ApiModelProperty(value = "标签信息")
private List<CustomerLabelRespDto> customerLabelList=new ArrayList<>();
@ApiModelProperty(value="最近会话时间")
private Long recentSessionTime;
@ApiModelProperty(value = "分部编号")
private String subCompanyCode;
public Long getCustomerId() {
return this.customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getCustomerCode() {
return this.customerCode;
}
public void setCustomerCode(String customerCode) {
this.customerCode = customerCode;
}
public Long getCompanyId() {
return this.companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getTel() {
return this.tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getLevel() {
return this.level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getAvatar() {
return this.avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getProvinceCode() {
return this.provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
public String getCityCode() {
return this.cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
public String getNickName() {
return this.nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getWxNumber() {
return this.wxNumber;
}
public void setWxNumber(String wxNumber) {
this.wxNumber = wxNumber;
}
public String getRemark() {
return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getField1() {
return this.field1;
}
public void setField1(String field1) {
this.field1 = field1;
}
public String getField2() {
return this.field2;
}
public void setField2(String field2) {
this.field2 = field2;
}
public String getField3() {
return this.field3;
}
public void setField3(String field3) {
this.field3 = field3;
}
public String getField4() {
return this.field4;
}
public void setField4(String field4) {
this.field4 = field4;
}
public String getField5() {
return this.field5;
}
public void setField5(String field5) {
this.field5 = field5;
}
public List<CustomerLabelRespDto> getCustomerLabelList() {
return customerLabelList;
}
public void setCustomerLabelList(List<CustomerLabelRespDto> customerLabelList) {
this.customerLabelList = customerLabelList;
}
public Long getRecentSessionTime() {
return recentSessionTime;
}
public void setRecentSessionTime(Long recentSessionTime) {
this.recentSessionTime = recentSessionTime;
}
public String getSubCompanyCode() {
return subCompanyCode;
}
public void setSubCompanyCode(String subCompanyCode) {
this.subCompanyCode = subCompanyCode;
}
}

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