zy_Java 5 years ago
parent
commit
7fd916d5a2
  1. 2
      game/src/main/java/com/ccsens/game/service/ClientService.java
  2. 33
      pims/.gitignore
  3. 310
      pims/mvnw
  4. 182
      pims/mvnw.cmd
  5. 49
      pims/pom.xml
  6. 16
      pims/src/main/java/com/ccsens/pims/PimsApplication.java
  7. 25
      pims/src/main/java/com/ccsens/pims/api/DebugController.java
  8. 1
      pims/src/main/resources/application.properties
  9. 13
      pims/src/test/java/com/ccsens/pims/PimsApplicationTests.java
  10. 2
      tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java
  11. 30
      tall/src/main/java/com/ccsens/tall/bean/dto/UserDto.java
  12. 11
      tall/src/main/java/com/ccsens/tall/bean/dto/WpsDto.java
  13. 150
      tall/src/main/java/com/ccsens/tall/bean/po/SysUserInfo.java
  14. 991
      tall/src/main/java/com/ccsens/tall/bean/po/SysUserInfoExample.java
  15. 46
      tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java
  16. 10
      tall/src/main/java/com/ccsens/tall/bean/vo/UserVo.java
  17. 1
      tall/src/main/java/com/ccsens/tall/config/SpringConfig.java
  18. 8
      tall/src/main/java/com/ccsens/tall/persist/dao/SysUserInfoDao.java
  19. 3
      tall/src/main/java/com/ccsens/tall/persist/dao/TaskSubTimeDao.java
  20. 30
      tall/src/main/java/com/ccsens/tall/persist/mapper/SysUserInfoMapper.java
  21. 22
      tall/src/main/java/com/ccsens/tall/service/AsyncService.java
  22. 9
      tall/src/main/java/com/ccsens/tall/service/IAsyncService.java
  23. 11
      tall/src/main/java/com/ccsens/tall/service/ITaskPluginService.java
  24. 8
      tall/src/main/java/com/ccsens/tall/service/IUserInfoService.java
  25. 7
      tall/src/main/java/com/ccsens/tall/service/IUserService.java
  26. 6
      tall/src/main/java/com/ccsens/tall/service/IWpsService.java
  27. 4
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  28. 4
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  29. 2
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java
  30. 192
      tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java
  31. 2
      tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java
  32. 64
      tall/src/main/java/com/ccsens/tall/service/UserInfoService.java
  33. 42
      tall/src/main/java/com/ccsens/tall/service/UserService.java
  34. 53
      tall/src/main/java/com/ccsens/tall/service/WpsService.java
  35. 29
      tall/src/main/java/com/ccsens/tall/web/DebugController.java
  36. 14
      tall/src/main/java/com/ccsens/tall/web/PluginController.java
  37. 20
      tall/src/main/java/com/ccsens/tall/web/UserController.java
  38. 17
      tall/src/main/java/com/ccsens/tall/web/UserInfoController.java
  39. 2
      tall/src/main/java/com/ccsens/tall/web/WpsController.java
  40. 2
      tall/src/main/resources/application-prod.yml
  41. 2
      tall/src/main/resources/application-test.yml
  42. 1
      tall/src/main/resources/mapper_dao/TaskDetailDao.xml
  43. 75
      tall/src/main/resources/mapper_dao/TaskSubTimeDao.xml
  44. 323
      tall/src/main/resources/mapper_raw/SysUserInfoMapper.xml
  45. BIN
      tall/src/main/resources/template/regularMeetingTemplate.xlsx
  46. 8
      util/src/main/java/com/ccsens/util/CodeEnum.java
  47. 140
      util/src/main/java/com/ccsens/util/ImageCodeGeneratorUtil.java
  48. 117
      util/src/main/java/com/ccsens/util/PoiUtil.java
  49. 2
      util/src/main/java/com/ccsens/util/RedisUtil.java
  50. 10
      util/src/main/java/com/ccsens/util/WebConstant.java
  51. 4
      util/src/test/java/com/ccsens/util/Base64Test.java

2
game/src/main/java/com/ccsens/game/service/ClientService.java

@ -123,7 +123,7 @@ public class ClientService implements IClientService {
if (memberInfo.getData() == null) {
memberInfo = tallFeignClient.getUserByUserId(userId);
}
if (memberInfo.getCode().intValue() == CodeEnum.SUCCESS.getCode() && memberInfo.getData() != null) {
if (memberInfo.getCode().intValue() == CodeEnum.SUCCESS.getCode().intValue() && memberInfo.getData() != null) {
userJoin.setAvatarUrl(memberInfo.getData().getAvatarUrl());
userJoin.setNickname(memberInfo.getData().getNickname());

33
pims/.gitignore

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

310
pims/mvnw

@ -0,0 +1,310 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`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
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

182
pims/mvnw.cmd

@ -0,0 +1,182 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%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.5.6/maven-wrapper-0.5.6.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% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%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%

49
pims/pom.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.ccsens</groupId>
<artifactId>pims</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>pims</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

16
pims/src/main/java/com/ccsens/pims/PimsApplication.java

@ -0,0 +1,16 @@
package com.ccsens.pims;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author
*/
@SpringBootApplication
public class PimsApplication {
public static void main(String[] args) {
SpringApplication.run(PimsApplication.class, args);
}
}

25
pims/src/main/java/com/ccsens/pims/api/DebugController.java

@ -0,0 +1,25 @@
package com.ccsens.pims.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
//@Api(tags = "DEBUG" , description = "DebugController | ")
@RestController
@RequestMapping("/debug")
public class DebugController {
// @ApiOperation(value = "/测试",notes = "")
// @ApiImplicitParams({
// })
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public String getSmsCode(HttpServletRequest request) throws Exception {
return "测试";
}
}

1
pims/src/main/resources/application.properties

@ -0,0 +1 @@

13
pims/src/test/java/com/ccsens/pims/PimsApplicationTests.java

@ -0,0 +1,13 @@
package com.ccsens.pims;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class PimsApplicationTests {
@Test
void contextLoads() {
}
}

2
tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java

@ -142,6 +142,8 @@ public class TaskDto {
private int delay;
@ApiModelProperty("延迟切换时间")
private Long delayTime;
@ApiModelProperty("优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急 默认0")
private Byte priority;
@ApiModelProperty("任务提醒信息")
private List<UpdateTaskRemind> taskRemindList;
}

30
tall/src/main/java/com/ccsens/tall/bean/dto/UserDto.java

@ -1,6 +1,9 @@
package com.ccsens.tall.bean.dto;
import com.ccsens.tall.bean.vo.LabelVo;
import com.ccsens.tall.bean.vo.UserVo;
import com.ccsens.util.WebConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -10,6 +13,9 @@ import lombok.Setter;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
import java.util.List;
@Data
public class UserDto {
@Data
@ -182,4 +188,28 @@ public class UserDto {
@NotEmpty(message = "新昵称不能为空.")
private String nickname;
}
@Data
@ApiModel("修改个人详细信息")
public static class UpdateUserInfo{
@NotNull
@ApiModelProperty("userId")
private Long id;
@ApiModelProperty("昵称")
private String nickname;
@ApiModelProperty("个人签名")
private String signature;
@ApiModelProperty("个人简介")
private String introduction;
@ApiModelProperty("生日")
private String birthday;
@ApiModelProperty("所在地")
private String address;
@ApiModelProperty("网页")
private String webPath;
@ApiModelProperty("公司")
private String company;
@ApiModelProperty("职位")
private String position;
}
}

11
tall/src/main/java/com/ccsens/tall/bean/dto/WpsDto.java

@ -157,6 +157,8 @@ public class WpsDto {
@NotNull
@ApiModelProperty("应用id")
private String _w_appid;
@ApiModelProperty("业务处理路径")
private String _w_url;
}
@Data
@ -166,7 +168,7 @@ public class WpsDto {
private Long businessId;
@ApiModelProperty("wps文件ID")
private Long wpsFileId;
@ApiModelProperty("业务类型")
@ApiModelProperty("业务类型 0项目WBS 1交付物 2会议记录")
private Byte businessType;
@ApiModelProperty("用户ID")
private Long userId;
@ -183,4 +185,11 @@ public class WpsDto {
@ApiModelProperty("操作权限查询路径")
private String privilegeQueryUrl;
}
@Data
@ApiModel("异步通知")
public static class Async{
@ApiModelProperty("文件ID")
private Long fileId;
}
}

150
tall/src/main/java/com/ccsens/tall/bean/po/SysUserInfo.java

@ -0,0 +1,150 @@
package com.ccsens.tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysUserInfo implements Serializable {
private Long id;
private Long userId;
private String signature;
private String introduction;
private String birthday;
private String address;
private String webPath;
private String company;
private String position;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getSignature() {
return signature;
}
public void setSignature(String signature) {
this.signature = signature == null ? null : signature.trim();
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction == null ? null : introduction.trim();
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday == null ? null : birthday.trim();
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address == null ? null : address.trim();
}
public String getWebPath() {
return webPath;
}
public void setWebPath(String webPath) {
this.webPath = webPath == null ? null : webPath.trim();
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company == null ? null : company.trim();
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position == null ? null : position.trim();
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", signature=").append(signature);
sb.append(", introduction=").append(introduction);
sb.append(", birthday=").append(birthday);
sb.append(", address=").append(address);
sb.append(", webPath=").append(webPath);
sb.append(", company=").append(company);
sb.append(", position=").append(position);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

991
tall/src/main/java/com/ccsens/tall/bean/po/SysUserInfoExample.java

@ -0,0 +1,991 @@
package com.ccsens.tall.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SysUserInfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysUserInfoExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andSignatureIsNull() {
addCriterion("signature is null");
return (Criteria) this;
}
public Criteria andSignatureIsNotNull() {
addCriterion("signature is not null");
return (Criteria) this;
}
public Criteria andSignatureEqualTo(String value) {
addCriterion("signature =", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureNotEqualTo(String value) {
addCriterion("signature <>", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureGreaterThan(String value) {
addCriterion("signature >", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureGreaterThanOrEqualTo(String value) {
addCriterion("signature >=", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureLessThan(String value) {
addCriterion("signature <", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureLessThanOrEqualTo(String value) {
addCriterion("signature <=", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureLike(String value) {
addCriterion("signature like", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureNotLike(String value) {
addCriterion("signature not like", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureIn(List<String> values) {
addCriterion("signature in", values, "signature");
return (Criteria) this;
}
public Criteria andSignatureNotIn(List<String> values) {
addCriterion("signature not in", values, "signature");
return (Criteria) this;
}
public Criteria andSignatureBetween(String value1, String value2) {
addCriterion("signature between", value1, value2, "signature");
return (Criteria) this;
}
public Criteria andSignatureNotBetween(String value1, String value2) {
addCriterion("signature not between", value1, value2, "signature");
return (Criteria) this;
}
public Criteria andIntroductionIsNull() {
addCriterion("introduction is null");
return (Criteria) this;
}
public Criteria andIntroductionIsNotNull() {
addCriterion("introduction is not null");
return (Criteria) this;
}
public Criteria andIntroductionEqualTo(String value) {
addCriterion("introduction =", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionNotEqualTo(String value) {
addCriterion("introduction <>", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionGreaterThan(String value) {
addCriterion("introduction >", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionGreaterThanOrEqualTo(String value) {
addCriterion("introduction >=", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionLessThan(String value) {
addCriterion("introduction <", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionLessThanOrEqualTo(String value) {
addCriterion("introduction <=", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionLike(String value) {
addCriterion("introduction like", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionNotLike(String value) {
addCriterion("introduction not like", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionIn(List<String> values) {
addCriterion("introduction in", values, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionNotIn(List<String> values) {
addCriterion("introduction not in", values, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionBetween(String value1, String value2) {
addCriterion("introduction between", value1, value2, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionNotBetween(String value1, String value2) {
addCriterion("introduction not between", value1, value2, "introduction");
return (Criteria) this;
}
public Criteria andBirthdayIsNull() {
addCriterion("birthday is null");
return (Criteria) this;
}
public Criteria andBirthdayIsNotNull() {
addCriterion("birthday is not null");
return (Criteria) this;
}
public Criteria andBirthdayEqualTo(String value) {
addCriterion("birthday =", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotEqualTo(String value) {
addCriterion("birthday <>", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayGreaterThan(String value) {
addCriterion("birthday >", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayGreaterThanOrEqualTo(String value) {
addCriterion("birthday >=", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLessThan(String value) {
addCriterion("birthday <", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLessThanOrEqualTo(String value) {
addCriterion("birthday <=", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLike(String value) {
addCriterion("birthday like", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotLike(String value) {
addCriterion("birthday not like", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayIn(List<String> values) {
addCriterion("birthday in", values, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotIn(List<String> values) {
addCriterion("birthday not in", values, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayBetween(String value1, String value2) {
addCriterion("birthday between", value1, value2, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotBetween(String value1, String value2) {
addCriterion("birthday not between", value1, value2, "birthday");
return (Criteria) this;
}
public Criteria andAddressIsNull() {
addCriterion("address is null");
return (Criteria) this;
}
public Criteria andAddressIsNotNull() {
addCriterion("address is not null");
return (Criteria) this;
}
public Criteria andAddressEqualTo(String value) {
addCriterion("address =", value, "address");
return (Criteria) this;
}
public Criteria andAddressNotEqualTo(String value) {
addCriterion("address <>", value, "address");
return (Criteria) this;
}
public Criteria andAddressGreaterThan(String value) {
addCriterion("address >", value, "address");
return (Criteria) this;
}
public Criteria andAddressGreaterThanOrEqualTo(String value) {
addCriterion("address >=", value, "address");
return (Criteria) this;
}
public Criteria andAddressLessThan(String value) {
addCriterion("address <", value, "address");
return (Criteria) this;
}
public Criteria andAddressLessThanOrEqualTo(String value) {
addCriterion("address <=", value, "address");
return (Criteria) this;
}
public Criteria andAddressLike(String value) {
addCriterion("address like", value, "address");
return (Criteria) this;
}
public Criteria andAddressNotLike(String value) {
addCriterion("address not like", value, "address");
return (Criteria) this;
}
public Criteria andAddressIn(List<String> values) {
addCriterion("address in", values, "address");
return (Criteria) this;
}
public Criteria andAddressNotIn(List<String> values) {
addCriterion("address not in", values, "address");
return (Criteria) this;
}
public Criteria andAddressBetween(String value1, String value2) {
addCriterion("address between", value1, value2, "address");
return (Criteria) this;
}
public Criteria andAddressNotBetween(String value1, String value2) {
addCriterion("address not between", value1, value2, "address");
return (Criteria) this;
}
public Criteria andWebPathIsNull() {
addCriterion("web_path is null");
return (Criteria) this;
}
public Criteria andWebPathIsNotNull() {
addCriterion("web_path is not null");
return (Criteria) this;
}
public Criteria andWebPathEqualTo(String value) {
addCriterion("web_path =", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathNotEqualTo(String value) {
addCriterion("web_path <>", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathGreaterThan(String value) {
addCriterion("web_path >", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathGreaterThanOrEqualTo(String value) {
addCriterion("web_path >=", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathLessThan(String value) {
addCriterion("web_path <", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathLessThanOrEqualTo(String value) {
addCriterion("web_path <=", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathLike(String value) {
addCriterion("web_path like", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathNotLike(String value) {
addCriterion("web_path not like", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathIn(List<String> values) {
addCriterion("web_path in", values, "webPath");
return (Criteria) this;
}
public Criteria andWebPathNotIn(List<String> values) {
addCriterion("web_path not in", values, "webPath");
return (Criteria) this;
}
public Criteria andWebPathBetween(String value1, String value2) {
addCriterion("web_path between", value1, value2, "webPath");
return (Criteria) this;
}
public Criteria andWebPathNotBetween(String value1, String value2) {
addCriterion("web_path not between", value1, value2, "webPath");
return (Criteria) this;
}
public Criteria andCompanyIsNull() {
addCriterion("company is null");
return (Criteria) this;
}
public Criteria andCompanyIsNotNull() {
addCriterion("company is not null");
return (Criteria) this;
}
public Criteria andCompanyEqualTo(String value) {
addCriterion("company =", value, "company");
return (Criteria) this;
}
public Criteria andCompanyNotEqualTo(String value) {
addCriterion("company <>", value, "company");
return (Criteria) this;
}
public Criteria andCompanyGreaterThan(String value) {
addCriterion("company >", value, "company");
return (Criteria) this;
}
public Criteria andCompanyGreaterThanOrEqualTo(String value) {
addCriterion("company >=", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLessThan(String value) {
addCriterion("company <", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLessThanOrEqualTo(String value) {
addCriterion("company <=", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLike(String value) {
addCriterion("company like", value, "company");
return (Criteria) this;
}
public Criteria andCompanyNotLike(String value) {
addCriterion("company not like", value, "company");
return (Criteria) this;
}
public Criteria andCompanyIn(List<String> values) {
addCriterion("company in", values, "company");
return (Criteria) this;
}
public Criteria andCompanyNotIn(List<String> values) {
addCriterion("company not in", values, "company");
return (Criteria) this;
}
public Criteria andCompanyBetween(String value1, String value2) {
addCriterion("company between", value1, value2, "company");
return (Criteria) this;
}
public Criteria andCompanyNotBetween(String value1, String value2) {
addCriterion("company not between", value1, value2, "company");
return (Criteria) this;
}
public Criteria andPositionIsNull() {
addCriterion("position is null");
return (Criteria) this;
}
public Criteria andPositionIsNotNull() {
addCriterion("position is not null");
return (Criteria) this;
}
public Criteria andPositionEqualTo(String value) {
addCriterion("position =", value, "position");
return (Criteria) this;
}
public Criteria andPositionNotEqualTo(String value) {
addCriterion("position <>", value, "position");
return (Criteria) this;
}
public Criteria andPositionGreaterThan(String value) {
addCriterion("position >", value, "position");
return (Criteria) this;
}
public Criteria andPositionGreaterThanOrEqualTo(String value) {
addCriterion("position >=", value, "position");
return (Criteria) this;
}
public Criteria andPositionLessThan(String value) {
addCriterion("position <", value, "position");
return (Criteria) this;
}
public Criteria andPositionLessThanOrEqualTo(String value) {
addCriterion("position <=", value, "position");
return (Criteria) this;
}
public Criteria andPositionLike(String value) {
addCriterion("position like", value, "position");
return (Criteria) this;
}
public Criteria andPositionNotLike(String value) {
addCriterion("position not like", value, "position");
return (Criteria) this;
}
public Criteria andPositionIn(List<String> values) {
addCriterion("position in", values, "position");
return (Criteria) this;
}
public Criteria andPositionNotIn(List<String> values) {
addCriterion("position not in", values, "position");
return (Criteria) this;
}
public Criteria andPositionBetween(String value1, String value2) {
addCriterion("position between", value1, value2, "position");
return (Criteria) this;
}
public Criteria andPositionNotBetween(String value1, String value2) {
addCriterion("position not between", value1, value2, "position");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

46
tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java

@ -146,6 +146,8 @@ public class TaskVo {
private Byte routineLocation;
@ApiModelProperty("入参")
private String importParam;
@ApiModelProperty("优先级 默认0 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急")
private Byte priority;
@ApiModelProperty("提醒的信息")
private List<RemindInfo> remindInfoList;
public Long getDuration(){
@ -365,9 +367,9 @@ public class TaskVo {
private Long subTaskId;
//任务名
private String taskName;
//任务
//任务开始时间
private String taskBeginTime;
//任务
//任务结束时间
private String taskEndTime;
//提醒信息的id
private Long remindId;
@ -392,4 +394,44 @@ public class TaskVo {
@ApiModelProperty("时间")
private String time;
}
/**
* 会议纪要里的任务信息
*/
@Data
public static class TaskMinutesWps{
private Long taskSubTimeId;
//负责人角色名
private String executorRoleName;
//任务名
private String taskName;
//计划开始时间
private String beginTime;
//计划结束时间
private String endTime;
//实际开始时间
private String realBeginTime;
//实际结束时间
private String realEndTime;
//评论
private List<CommentByMinutes> comment;
//交付物
private List<DeliverByMinutes> deliverList;
@Data
public static class CommentByMinutes{
private Long commentId;
//发送者的名字
private String userName;
//评论内容
private String commentValue;
}
@Data
public static class DeliverByMinutes{
private Long deliverId;
//交付物名
private String deliverName;
//交付物文件地址,没有则为空
private String deliverPath;
}
}
}

10
tall/src/main/java/com/ccsens/tall/bean/vo/UserVo.java

@ -1,6 +1,7 @@
package com.ccsens.tall.bean.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -155,4 +156,13 @@ public class UserVo {
@ApiModelProperty("总空间(目前写无限制)")
private Integer interspaceTotal;
}
@Data
@ApiModel("返回图片验证码")
public static class VerificationCode{
@ApiModelProperty("图片验证码Id")
private String verificationCodeId;
@ApiModelProperty("图片的Base64字符串")
private String imageBase64;
}
}

1
tall/src/main/java/com/ccsens/tall/config/SpringConfig.java

@ -145,6 +145,7 @@ public class SpringConfig implements WebMvcConfigurer {
.excludePathPatterns("/users/allMemberAll")
.excludePathPatterns("/users/userId")
.excludePathPatterns("/users/mergeUserId")
.excludePathPatterns("/users/code")
.addPathPatterns("/plugins/**")
.excludePathPatterns("/plugins/sign")
.excludePathPatterns("/plugins/fuzzy")

8
tall/src/main/java/com/ccsens/tall/persist/dao/SysUserInfoDao.java

@ -0,0 +1,8 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.persist.mapper.SysUserInfoMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface SysUserInfoDao extends SysUserInfoMapper {
}

3
tall/src/main/java/com/ccsens/tall/persist/dao/TaskSubTimeDao.java

@ -19,4 +19,7 @@ public interface TaskSubTimeDao extends ProTaskSubTimeMapper{
List<TaskVo.KanBanTask> getKanbanTakeByType(@Param("userId")Long userId,@Param("projectId")Long projectId, @Param("roleId")Long roleId,
@Param("type")Integer type,@Param("orderType")Integer orderType,@Param("order")Integer order);
List<TaskVo.TaskMinutesWps> queryMinutesTaskByTime(@Param("projectId")Long projectId, @Param("startTime")Long startTime, @Param("endTime")Long endTime);
}

30
tall/src/main/java/com/ccsens/tall/persist/mapper/SysUserInfoMapper.java

@ -0,0 +1,30 @@
package com.ccsens.tall.persist.mapper;
import com.ccsens.tall.bean.po.SysUserInfo;
import com.ccsens.tall.bean.po.SysUserInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysUserInfoMapper {
long countByExample(SysUserInfoExample example);
int deleteByExample(SysUserInfoExample example);
int deleteByPrimaryKey(Long id);
int insert(SysUserInfo record);
int insertSelective(SysUserInfo record);
List<SysUserInfo> selectByExample(SysUserInfoExample example);
SysUserInfo selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysUserInfo record, @Param("example") SysUserInfoExample example);
int updateByExample(@Param("record") SysUserInfo record, @Param("example") SysUserInfoExample example);
int updateByPrimaryKeySelective(SysUserInfo record);
int updateByPrimaryKey(SysUserInfo record);
}

22
tall/src/main/java/com/ccsens/tall/service/AsyncService.java

@ -1,7 +1,12 @@
package com.ccsens.tall.service;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.tall.bean.vo.MessageVo;
import com.ccsens.tall.util.RobotUtil;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.RestTemplateUtil;
import com.ccsens.util.WebConstant;
import com.ccsens.util.annotation.OperateType;
import com.ccsens.util.wx.WxTemplateMessage;
import com.fasterxml.jackson.core.JsonProcessingException;
@ -12,6 +17,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Map;
@Slf4j
@Async
@ -34,4 +40,20 @@ public class AsyncService implements IAsyncService{
public void sendMessage(OperateType operateType, MessageVo.Inform inform, WxTemplateMessage wxTemplate) throws JsonProcessingException {
projectMessageService.sendProjectMessage(operateType, inform, wxTemplate);
}
@Override
public void postBody(String url, Object params) {
log.info("post请求,url:{}, params:{}", url, params);
String result = RestTemplateUtil.postBody(url, params);
log.info("post调用结果:{}", result);
if (RestTemplateUtil.pageResult(result)) {
// TODO 错误信息存库,方便后续定时重发
return;
}
JSONObject json = JSONObject.parseObject(result);
if (json.getIntValue(WebConstant.Field.CODE) == CodeEnum.SUCCESS.getCode().intValue()) {
return;
}
// TODO 错误信息存库,方便后续定时重发
}
}

9
tall/src/main/java/com/ccsens/tall/service/IAsyncService.java

@ -6,6 +6,8 @@ import com.ccsens.util.annotation.OperateType;
import com.ccsens.util.wx.WxTemplateMessage;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.Map;
/**
* 异步方法
*/
@ -20,5 +22,12 @@ public interface IAsyncService {
*/
void sendMessage(OperateType operateType, MessageVo.Inform inform, WxTemplateMessage wxTemplate) throws JsonProcessingException;
/**
* 消息发送
* @param url 调用路径
* @param params 参数
*/
void postBody(String url, Object params);
}

11
tall/src/main/java/com/ccsens/tall/service/ITaskPluginService.java

@ -5,6 +5,7 @@ import com.ccsens.tall.bean.po.ProTaskPlugin;
import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.bean.vo.TaskVo;
import java.io.FileNotFoundException;
import java.util.List;
/**
@ -44,4 +45,14 @@ public interface ITaskPluginService {
* @param notesId 笔记记录id
*/
void deleteNotes(Long currentUserId, Long notesId);
/**
* 获取会议纪要表
* @param currentUserId userId
* @param projectId 项目id
* @param taskId 任务di
* @param token token
* @return 返回wps里的文件的路径
*/
List<String> saveMinutes(Long currentUserId, Long projectId,Long taskId,String token) throws Exception;
}

8
tall/src/main/java/com/ccsens/tall/service/IUserInfoService.java

@ -38,4 +38,12 @@ public interface IUserInfoService {
* @return 个人信息
*/
UserVo.SelectUserInfo selectUserInfo(Long currentUserId);
/**
* 修改个人详细信息
* @param currentUserId userId
* @param updateUserInfo 需要修改的信息为空则不需要修改
* @return 返回当前用户的详细信息
*/
UserVo.SelectUserInfo updateUserInfo(Long currentUserId, UserDto.UpdateUserInfo updateUserInfo);
}

7
tall/src/main/java/com/ccsens/tall/service/IUserService.java

@ -24,7 +24,7 @@ public interface IUserService {
boolean tokenNotExistInCache(Long authId) throws Exception;
UserVo.SmsCode getSignInSmsCode(String phone,Integer client) throws Exception;
UserVo.SmsCode getSignInSmsCode(String phone,String verificationCodeId, String verificationCodeValue) throws Exception;
SysUser getUserById(Long aLong) throws Exception;
@ -105,4 +105,9 @@ public interface IUserService {
*/
List<UserVo.UserInfo> queryUserInfos(Long[] ids);
/**
* 获取图片验证码信息
* @return 返回图片转成的base64字符串和图片的id
*/
UserVo.VerificationCode getVertifyCode();
}

6
tall/src/main/java/com/ccsens/tall/service/IWpsService.java

@ -5,6 +5,7 @@ import com.ccsens.tall.bean.vo.WpsVo;
import javax.servlet.http.Part;
import java.util.List;
import java.util.Map;
/**
* @author whj
@ -37,10 +38,11 @@ public interface IWpsService {
*
* @param name 文件名称
* @param file 文件
* @param fileNew 文件保存
* @return 文件信息
* @throws Exception 异常
*/
WpsVo.FileNew fileNew(String token, String fileId, String name, Part file) throws Exception;
WpsVo.FileNew fileNew(String token, String fileId, String name, Part file, WpsDto.FileNew fileNew) throws Exception;
/**
* 在历史版本预览和回滚历史版本的时候获取特定版本文档的文件信息
@ -92,5 +94,5 @@ public interface IWpsService {
* @param token token
* @return WPS访问路径
*/
List<String> queryVisitUrls(long businessId, byte businessType, String token);
List<String> queryVisitUrls(long businessId, byte businessType, String token, Map<String, String> params);
}

4
tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java

@ -1107,6 +1107,10 @@ public class ProTaskDetailService implements IProTaskDetailService {
if(ObjectUtil.isNotNull(updateTaskInfo.getDelay())){
taskDetail.setDelay((byte) updateTaskInfo.getDelay());
}
//修改任务优先级
if(ObjectUtil.isNotNull(updateTaskInfo.getPriority())){
taskDetail.setPriority(updateTaskInfo.getPriority());
}
//延迟切换时间
if(ObjectUtil.isNotNull(updateTaskInfo.getDelayTime()) &&
(taskDetail.getDelay() == WebConstant.TASK_DELAY.DelayManual.value)){

4
tall/src/main/java/com/ccsens/tall/service/ProjectService.java

@ -197,7 +197,7 @@ public class ProjectService implements IProjectService {
ProjectVo.ProjectUnreadMsg unreadMsg = getUnreadMsgByProject(currentUserId,projectInfo.getId());
projectInfo.setProjectUnreadMsg(unreadMsg);
//获取wps文件路径
projectInfo.setWpsFilePaths(wpsService.queryVisitUrls(projectInfo.getId(), (byte) 0,token));
projectInfo.setWpsFilePaths(wpsService.queryVisitUrls(projectInfo.getId(), (byte) 0,token, null));
});
}
}
@ -333,7 +333,7 @@ public class ProjectService implements IProjectService {
projectInfo.setLabelList(labelList);
}
//获取wps文件路径
projectInfo.setWpsFilePaths(wpsService.queryVisitUrls(projectInfo.getId(), (byte) 0,token));
projectInfo.setWpsFilePaths(wpsService.queryVisitUrls(projectInfo.getId(), (byte) 0,token,null));
return projectInfo;
}

2
tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java

@ -498,7 +498,7 @@ public class TaskDeliverService implements ITaskDeliverService {
filePath.setCheckerList(checkerList);
filePath.setIsChecker(isChecker);
//获取wps里的文件路径
filePath.setWpsFilePaths(wpsService.queryVisitUrls(filePath.getDeliverLogId(), (byte) 1,token));
filePath.setWpsFilePaths(wpsService.queryVisitUrls(filePath.getDeliverLogId(), (byte) 1,token,null));
}
deliverInfo.setFileList(fileIds);
}

192
tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java

@ -1,26 +1,34 @@
package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.tall.bean.dto.PluginDto;
import com.ccsens.tall.bean.dto.WpsDto;
import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.bean.vo.TaskVo;
import com.ccsens.tall.persist.dao.*;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.PoiUtil;
import com.ccsens.util.PropUtil;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.io.*;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
/**
* @author
@ -57,6 +65,8 @@ public class TaskPluginService implements ITaskPluginService{
private IRobotService robotService;
@Resource
private ProNotesDao proNotesDao;
@Resource
private IWpsService wpsService;
@Override
public void savePlugin(ProTaskPlugin taskPlugin) {
@ -261,6 +271,184 @@ public class TaskPluginService implements ITaskPluginService{
throw new BaseException(CodeEnum.NOT_POWER);
}
}
}
@Override
public List<String> saveMinutes(Long currentUserId, Long projectId, Long taskId,String token) throws Exception {
Map<String,String> params = new HashMap<>();
params.put(WebConstant.Wps._W_URL,PropUtil.domain + "debug");
List<String> wpsPath = wpsService.queryVisitUrls(taskId,(byte) 2,token,params);
if(CollectionUtil.isNotEmpty(wpsPath)){
return wpsPath;
}
log.info("生成会议记录,项目id:{}",projectId);
SysProject sysProject = sysProjectDao.selectByPrimaryKey(projectId);
if(ObjectUtil.isNull(sysProject)){
throw new BaseException(CodeEnum.NOT_PROJECT);
}
//获取本周和上周的时间
long thisWeekStartTime = DateUtil.beginOfWeek(new Date()).getTime();
long thisWeekEndTime = DateUtil.endOfWeek(new Date()).getTime();
long lastWeekStartTime = DateUtil.beginOfWeek(new Date(thisWeekStartTime - 1)).getTime();
long lastWeekEndTime = DateUtil.endOfWeek(new Date(thisWeekStartTime - 1)).getTime();
//查找上周任务
List<TaskVo.TaskMinutesWps> lastWeekTask = taskSubTimeDao.queryMinutesTaskByTime(projectId,lastWeekStartTime,lastWeekEndTime);
//查找本周任务
List<TaskVo.TaskMinutesWps> thisWeekTask = taskSubTimeDao.queryMinutesTaskByTime(projectId,thisWeekStartTime,thisWeekEndTime);
//生成excel写入的数据
List<List<PoiUtil.PoiUtilCell>> minutes = writeMinutes(lastWeekTask,thisWeekTask);
//写入WBS
ResourceLoader resourceLoader = new DefaultResourceLoader();
InputStream is = resourceLoader.getResource("classpath:template/regularMeetingTemplate.xlsx").getInputStream();
XSSFWorkbook wb = new XSSFWorkbook(is);
// Workbook wb = new XSSFWorkbook();
// PoiUtil.exportWB("会议记录", minutes, wb);
PoiUtil.exportWB("会议记录", minutes, wb);
//生成文件
String name = sysProject.getName() + "会议记录。xlsx";
String fileName = "minutes/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx";
String path = WebConstant.UPLOAD_PATH_BASE + File.separator + fileName;
File tmpFile = new File(path);
if (!tmpFile.getParentFile().exists()) {
tmpFile.getParentFile().mkdirs();
}
OutputStream stream = new FileOutputStream(tmpFile);
wb.write(stream);
stream.close();
//关联wps
WpsDto.Business business = new WpsDto.Business();
business.setBusinessId(taskId);
business.setBusinessType((byte) 2);
business.setUserId(currentUserId);
business.setFileName(name);
business.setFilePath(fileName);
business.setFileSize(tmpFile.length());
business.setOperation(WebConstant.Wps.USER_OPERATION_NEW);
business.setPrivilege(WebConstant.Wps.PROJECT_PRIVILEGE_READ);
wpsService.saveFile(business);
//获取wps文件的路径并返回
wpsPath = wpsService.queryVisitUrls(taskId,(byte) 2,token,params);
return wpsPath;
}
/**
* 生成写入的数据格式
* @param lastWeekTaskList 上周的任务
* @param thisWeekTaskList 本周的任务
* @return 返回写入excel的数据
*/
private List<List<PoiUtil.PoiUtilCell>> writeMinutes(List<TaskVo.TaskMinutesWps> lastWeekTaskList, List<TaskVo.TaskMinutesWps> thisWeekTaskList) {
List<List<PoiUtil.PoiUtilCell>> sheet = new ArrayList<>();
// //logo 和标题
// List<PoiUtil.PoiUtilCell> headerTitle = new ArrayList<>();
// headerTitle.add(new PoiUtil.PoiUtilCell("logo",1,1));
// headerTitle.add(new PoiUtil.PoiUtilCell("深孵公司周例会",7,1));
// sheet.add(headerTitle);
// //会议时间和主持人
// List<PoiUtil.PoiUtilCell> header1 = new ArrayList<>();
// header1.add(new PoiUtil.PoiUtilCell("会议时间"));
// header1.add(new PoiUtil.PoiUtilCell("",3,1));
// header1.add(new PoiUtil.PoiUtilCell());
// header1.add(new PoiUtil.PoiUtilCell());
// header1.add(new PoiUtil.PoiUtilCell("主持人"));
// header1.add(new PoiUtil.PoiUtilCell("",3,1));
// sheet.add(header1);
// //参会人员
// List<PoiUtil.PoiUtilCell> header2 = new ArrayList<>();
// header2.add(new PoiUtil.PoiUtilCell("参会人员",1,1));
// header2.add(new PoiUtil.PoiUtilCell("",7,1));
// sheet.add(header2);
// //主题议题
// List<PoiUtil.PoiUtilCell> header3 = new ArrayList<>();
// header3.add(new PoiUtil.PoiUtilCell("主题议题",1,1));
// header3.add(new PoiUtil.PoiUtilCell("",7,1));
// sheet.add(header3);
// //再空一行
// List<PoiUtil.PoiUtilCell> header4 = new ArrayList<>();
// header4.add(new PoiUtil.PoiUtilCell("",8,1));
// sheet.add(header4);
// //会议记录内容
// List<PoiUtil.PoiUtilCell> minutesValue = new ArrayList<>();
// minutesValue.add(new PoiUtil.PoiUtilCell("会议记录内容",8,1));
// sheet.add(minutesValue);
List<PoiUtil.PoiUtilCell> header1 = new ArrayList<>();
sheet.add(header1);
List<PoiUtil.PoiUtilCell> header2 = new ArrayList<>();
sheet.add(header2);
List<PoiUtil.PoiUtilCell> header3 = new ArrayList<>();
sheet.add(header3);
List<PoiUtil.PoiUtilCell> header4 = new ArrayList<>();
sheet.add(header4);
List<PoiUtil.PoiUtilCell> header5 = new ArrayList<>();
sheet.add(header5);
List<PoiUtil.PoiUtilCell> header6 = new ArrayList<>();
sheet.add(header6);
//上周任务
List<PoiUtil.PoiUtilCell> lastWeek = new ArrayList<>();
lastWeek.add(new PoiUtil.PoiUtilCell("上周任务",8,1));
sheet.add(lastWeek);
//上周任务内容
generateExcelTask(lastWeekTaskList, sheet);
//本周任务
List<PoiUtil.PoiUtilCell> thisWeek = new ArrayList<>();
thisWeek.add(new PoiUtil.PoiUtilCell("本周任务",8,1));
sheet.add(thisWeek);
//本周任务内容
generateExcelTask(thisWeekTaskList, sheet);
//会议记录人和领导签字
List<PoiUtil.PoiUtilCell> end = new ArrayList<>();
end.add(new PoiUtil.PoiUtilCell("会议记录人",1,1));
end.add(new PoiUtil.PoiUtilCell("",3,1));
end.add(new PoiUtil.PoiUtilCell());
end.add(new PoiUtil.PoiUtilCell());
end.add(new PoiUtil.PoiUtilCell("领导签字",1,1));
end.add(new PoiUtil.PoiUtilCell("",3,1));
sheet.add(end);
//备注留白
List<PoiUtil.PoiUtilCell> remark = new ArrayList<>();
remark.add(new PoiUtil.PoiUtilCell("",8,8));
sheet.add(remark);
return sheet;
}
private void generateExcelTask(List<TaskVo.TaskMinutesWps> weekTaskList, List<List<PoiUtil.PoiUtilCell>> sheet) {
//上周任务表头
List<PoiUtil.PoiUtilCell> taskWeek = new ArrayList<>();
taskWeek.add(new PoiUtil.PoiUtilCell("角色名",1,1));
taskWeek.add(new PoiUtil.PoiUtilCell("任务名",1,1));
taskWeek.add(new PoiUtil.PoiUtilCell("计划开始时间",1,1));
taskWeek.add(new PoiUtil.PoiUtilCell("计划结束时间",1,1));
taskWeek.add(new PoiUtil.PoiUtilCell("实际开始时间",1,1));
taskWeek.add(new PoiUtil.PoiUtilCell("实际结束时间",1,1));
taskWeek.add(new PoiUtil.PoiUtilCell("交付物",1,1));
taskWeek.add(new PoiUtil.PoiUtilCell("评论",1,1));
sheet.add(taskWeek);
//循环获取任务内容
if(CollectionUtil.isNotEmpty(weekTaskList)){
weekTaskList.forEach(weekTask -> {
List<PoiUtil.PoiUtilCell> lastWeekValue = new ArrayList<>();
lastWeekValue.add(new PoiUtil.PoiUtilCell(weekTask.getExecutorRoleName(),1,1));
lastWeekValue.add(new PoiUtil.PoiUtilCell(weekTask.getTaskName(),1,1));
lastWeekValue.add(new PoiUtil.PoiUtilCell(weekTask.getBeginTime(),1,1));
lastWeekValue.add(new PoiUtil.PoiUtilCell(weekTask.getEndTime(),1,1));
lastWeekValue.add(new PoiUtil.PoiUtilCell(weekTask.getRealBeginTime(),1,1));
lastWeekValue.add(new PoiUtil.PoiUtilCell(weekTask.getRealEndTime(),1,1));
//获取交付物信息
AtomicReference<String> deliverName = new AtomicReference<>("");
if(CollectionUtil.isNotEmpty(weekTask.getDeliverList())){
weekTask.getDeliverList().forEach(deliverByMinutes -> deliverName.set(deliverName.get() + deliverByMinutes.getDeliverName() + "\n"));
}
lastWeekValue.add(new PoiUtil.PoiUtilCell(deliverName.get(),1,1));
//获取评论信息
AtomicReference<String> comment = new AtomicReference<>("");
if(CollectionUtil.isNotEmpty(weekTask.getComment())){
weekTask.getComment().forEach(commentByMinutes -> comment.set(
comment.get() + commentByMinutes.getUserName() + ":" + commentByMinutes.getCommentValue() + "\n"));
}
lastWeekValue.add(new PoiUtil.PoiUtilCell(comment.get(),1,1));
sheet.add(lastWeekValue);
});
}
}
}

2
tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java

@ -20,12 +20,10 @@ import com.ccsens.util.cron.NatureToDate;
import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sun.corba.se.spi.ior.ObjectKey;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.unit.DataUnit;
import javax.annotation.Resource;
import java.util.*;

64
tall/src/main/java/com/ccsens/tall/service/UserInfoService.java

@ -3,6 +3,7 @@ package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ImageUtil;
import cn.hutool.core.util.ObjectUtil;
@ -13,6 +14,7 @@ import com.ccsens.tall.bean.vo.UserVo;
import com.ccsens.tall.persist.dao.SysAuthDao;
import com.ccsens.tall.persist.dao.SysLabelDao;
import com.ccsens.tall.persist.dao.SysUserDao;
import com.ccsens.tall.persist.dao.SysUserInfoDao;
import com.ccsens.tall.util.TallConstant;
import com.ccsens.util.*;
import com.ccsens.util.exception.BaseException;
@ -43,6 +45,10 @@ public class UserInfoService implements IUserInfoService{
private SysUserDao sysUserDao;
@Resource
private SysLabelDao sysLabelDao;
@Resource
private SysUserInfoDao sysUserInfoDao;
@Resource
private Snowflake snowflake;
@Override
public void updateAccount(Long userId, UserDto.UpdateAccount changeAccount) {
@ -170,4 +176,62 @@ public class UserInfoService implements IUserInfoService{
return selectUserInfo;
}
@Override
public UserVo.SelectUserInfo updateUserInfo(Long currentUserId, UserDto.UpdateUserInfo updateUserInfo) {
//查找用户
SysUser user = sysUserDao.selectByPrimaryKey(updateUserInfo.getId());
if(ObjectUtil.isNull(user)){
throw new BaseException(CodeEnum.NOT_USER);
}
//查找用户详细信息的记录
SysUserInfo sysUserInfo;
SysUserInfoExample sysUserInfoExample = new SysUserInfoExample();
sysUserInfoExample.createCriteria().andUserIdEqualTo(updateUserInfo.getId());
List<SysUserInfo> sysUserInfoList = sysUserInfoDao.selectByExample(sysUserInfoExample);
if(CollectionUtil.isNotEmpty(sysUserInfoList)){
sysUserInfo = sysUserInfoList.get(0);
}else {
sysUserInfo = new SysUserInfo();
sysUserInfo.setId(snowflake.nextId());
sysUserInfo.setUserId(updateUserInfo.getId());
sysUserInfoDao.insertSelective(sysUserInfo);
}
//修改昵称
if(StrUtil.isNotEmpty(updateUserInfo.getNickname())){
UserDto.UpdateNickname updateNickname = new UserDto.UpdateNickname();
updateNickname.setNickname(updateUserInfo.getNickname());
updateNickname(updateUserInfo.getId(),updateNickname);
}
//个人签名
if(StrUtil.isNotEmpty(updateUserInfo.getSignature())){
sysUserInfo.setSignature(updateUserInfo.getSignature());
}
//个人简介
if(StrUtil.isNotEmpty(updateUserInfo.getIntroduction())){
sysUserInfo.setIntroduction(updateUserInfo.getIntroduction());
}
//生日
if(StrUtil.isNotEmpty(updateUserInfo.getBirthday())){
sysUserInfo.setBirthday(updateUserInfo.getBirthday());
}
//所在地
if(StrUtil.isNotEmpty(updateUserInfo.getAddress())){
sysUserInfo.setAddress(updateUserInfo.getAddress());
}
//网页
if(StrUtil.isNotEmpty(updateUserInfo.getWebPath())){
sysUserInfo.setWebPath(updateUserInfo.getWebPath());
}
//公司
if(StrUtil.isNotEmpty(updateUserInfo.getCompany())){
sysUserInfo.setCompany(updateUserInfo.getCompany());
}
//职位
if(StrUtil.isNotEmpty(updateUserInfo.getPosition())){
sysUserInfo.setPosition(updateUserInfo.getPosition());
}
sysUserInfoDao.updateByPrimaryKeySelective(sysUserInfo);
return selectUserInfo(updateUserInfo.getId());
}
}

42
tall/src/main/java/com/ccsens/tall/service/UserService.java

@ -334,7 +334,6 @@ public class UserService implements IUserService {
if (CollectionUtil.isNotEmpty(authList)) {
theAuth = authList.get(0);
} else {
// throw new BaseException(CodeEnum.NOT_REGISTER);
theAuth = wxRegist(phone, null, WebConstant.IDENTIFY_TYPE.Phone);
}
userSignVo = new UserVo.UserSign();
@ -595,14 +594,24 @@ public class UserService implements IUserService {
* 发送验证码
*/
@Override
public UserVo.SmsCode getSignInSmsCode(String phone, Integer client) {
public UserVo.SmsCode getSignInSmsCode(String phone,String verificationCodeId, String verificationCodeValue) {
//获取登陆客户端类型
WebConstant.CLIENT_TYPE client_type = null;
if (ObjectUtil.isNotNull(client)) {
client_type = WebConstant.CLIENT_TYPE.valueOf(client);
} else {
client_type = WebConstant.CLIENT_TYPE.valueOf(1);
// WebConstant.CLIENT_TYPE client_type = null;
// if (ObjectUtil.isNotNull(client)) {
// client_type = WebConstant.CLIENT_TYPE.valueOf(client);
// } else {
// client_type = WebConstant.CLIENT_TYPE.valueOf(1);
// }
//检查图形验证码是否正确
String codeKey = WebConstant.IMAGE_CODE + verificationCodeId;
if (!redisUtil.hasKey(codeKey)) {
throw new BaseException(CodeEnum.VERIFICATION_CODE_PAST);
}
if (!verificationCodeValue.equals(String.valueOf(redisUtil.get(codeKey)))) {
throw new BaseException(CodeEnum.VERIFICATION_CODE_ERROR);
}
//验证一次,无论是否正确,都将缓存删除
redisUtil.del(codeKey);
//验证手机号的正确性
String regex = "[1]([3-9])[0-9]{9}$";
Pattern p = Pattern.compile(regex);
@ -612,7 +621,7 @@ public class UserService implements IUserService {
throw new BaseException(CodeEnum.PHONE_ERR);
}
UserVo.SmsCode smsCodeVo = null;
UserVo.SmsCode smsCodeVo;
//1.验证发送间隔是否大于指定间隔
if (redisUtil.hasKey(RedisKeyManager.getSigninSmsExistKey(phone))) {
throw new SmsException(SmsException.Error_SendTooFast);
@ -1577,4 +1586,21 @@ public class UserService implements IUserService {
List<UserVo.UserInfo> infos = userDao.queryUserInfos(ids);
return infos;
}
@Override
public UserVo.VerificationCode getVertifyCode() {
Map<String,Object> codeMap = ImageCodeGeneratorUtil.generateCountCode();
//生成一个id
long id = snowflake.nextId();
//将两个数的和,存在redis内,key为新生成的id
String imageCodeKey = WebConstant.IMAGE_CODE + id;
redisUtil.set(imageCodeKey,codeMap.get("sum"),90);
String imageBase64 = "data:image/png;base64," + ImageCodeGeneratorUtil.generateCodeImage(null, (String) codeMap.get("imageCode"), 200, 70);
UserVo.VerificationCode vertifyCode = new UserVo.VerificationCode();
vertifyCode.setImageBase64(imageBase64);
vertifyCode.setVerificationCodeId(String.valueOf(id));
return vertifyCode;
}
}

53
tall/src/main/java/com/ccsens/tall/service/WpsService.java

@ -54,9 +54,11 @@ public class WpsService implements IWpsService {
private RedisUtil redisUtil;
@Resource
private Snowflake snowflake;
@Resource
private AsyncService asyncService;
@Override
public List<String> queryVisitUrls(long businessId, byte businessType, String token) {
public List<String> queryVisitUrls(long businessId, byte businessType, String token, Map<String, String> params) {
log.info("查询访问路径:{},{}", businessId, businessType);
List<String> urls = new ArrayList<>();
@ -64,7 +66,7 @@ public class WpsService implements IWpsService {
files.forEach(file -> {
String name = file.getFileName();
log.info("文件名:{}", name);
String url = getUrl(String.valueOf(file.getFileId()), name.substring(name.lastIndexOf(".") + 1), token);
String url = getUrl(String.valueOf(file.getFileId()), name.substring(name.lastIndexOf(".") + 1), token, params);
urls.add(url);
});
log.info("访问路径返回结果:{}", urls);
@ -185,15 +187,19 @@ public class WpsService implements IWpsService {
}
@Override
public WpsVo.FileNew fileNew(String token, String fileId, String name, Part file) throws Exception {
WpsFile wpsFile = saveWpsFile(token, fileId, file,WebConstant.Wps.USER_OPERATION_NEW);
public WpsVo.FileNew fileNew(String token, String fileId, String name, Part file, WpsDto.FileNew fileNew) throws Exception {
WpsFile wpsFile = saveWpsFile(token, fileId, file,WebConstant.Wps.USER_OPERATION_NEW, fileNew.get_w_url());
String fileName = UploadFileUtil_Servlet3.getFileNameByPart(file);
String ext = FileUtil.extName(fileName);
String url = getUrl(String.valueOf(wpsFile.getId()), ext, token);
WpsVo.FileNew fileNew = new WpsVo.FileNew();
fileNew.setRedirect_url(url);
fileNew.setUser_id(String.valueOf(wpsFile.getCreator()));
return fileNew;
Map<String, String> params = new HashMap<>();
if (StrUtil.isNotEmpty(fileNew.get_w_url())) {
params.put(WebConstant.Wps._W_URL, fileNew.get_w_url());
}
String url = getUrl(String.valueOf(wpsFile.getId()), ext, token, params);
WpsVo.FileNew fileNew2 = new WpsVo.FileNew();
fileNew2.setRedirect_url(url);
fileNew2.setUser_id(String.valueOf(wpsFile.getCreator()));
return fileNew2;
}
/**
@ -201,9 +207,10 @@ public class WpsService implements IWpsService {
* @param fileId 文件ID
* @param ext 后缀
* @param token token
* @param params
* @return wps访问路径
*/
private String getUrl(String fileId, String ext, String token) {
private String getUrl(String fileId, String ext, String token, Map<String, String> params) {
if(!WebConstant.Wps.FILE_TYPE_ALL.contains(ext)){
return null;
}
@ -211,8 +218,19 @@ public class WpsService implements IWpsService {
Map<String, String> paramMap= new HashMap<>();
paramMap.put("_w_appid", WebConstant.Wps.APPID);
paramMap.put("_w_token", token);
if (CollectionUtil.isNotEmpty(params)) {
paramMap.putAll(params);
}
String newSignature = WpsSignature.getSignature(paramMap, WebConstant.Wps.APPKEY);
String fileUrl = "https://wwo.wps.cn/office/{}/{}?_w_appid=" + WebConstant.Wps.APPID + "&_w_signature={}&_w_token={}";
StringBuilder fileUrl = new StringBuilder("https://wwo.wps.cn/office/{}/{}?_w_appid=" + WebConstant.Wps.APPID + "&_w_signature={}&_w_token={}");
if (CollectionUtil.isNotEmpty(params)) {
params.forEach((k,v) -> {
fileUrl.append("&").append(k).append("=").append(v);
});
}
return StrUtil.format(fileUrl, fileType, fileId, newSignature, token);
}
@ -261,8 +279,8 @@ public class WpsService implements IWpsService {
}
ProProjectFile projectFile = proProjectFiles.get(0);
byte businessType = projectFile.getBusinessType();
switch (businessType) {
byte privilege = projectFile.getPrivilege();
switch (privilege) {
case WebConstant.Wps.PROJECT_PRIVILEGE_READ :
user.setPermission(WebConstant.Wps.PERMISSION_READ);
break;
@ -310,7 +328,7 @@ public class WpsService implements IWpsService {
@Override
public WpsVo.FileSave fileSave(String token, String fileId, WpsDto.FileSave fileSave, Part file) throws Exception {
WpsFile wpsFile = saveWpsFile(token, fileId, file,WebConstant.Wps.USER_OPERATION_SAVE);
WpsFile wpsFile = saveWpsFile(token, fileId, file,WebConstant.Wps.USER_OPERATION_SAVE, fileSave.get_w_url());
// 返回参数
WpsVo.FileBase fileBase = new WpsVo.FileBase(wpsFile);
@ -318,7 +336,7 @@ public class WpsService implements IWpsService {
return new WpsVo.FileSave(fileBase);
}
private WpsFile saveWpsFile(String token, String fileId, Part file, Byte operation) throws Exception {
private WpsFile saveWpsFile(String token, String fileId, Part file, Byte operation, String url) throws Exception {
Long userId = getUserId(token);
// 保存文件
String allowedExt = WebConstant.Wps.FILE_TYPE_ALL;
@ -331,6 +349,11 @@ public class WpsService implements IWpsService {
// 更新文件记录
WpsFileVersion version = saveVersion(wpsFile);
// 调用接口,更新数据项目接口(异步调用)
if (StrUtil.isNotEmpty(url)) {
WpsDto.Async params = new WpsDto.Async();
params.setFileId(wpsFile.getId());
asyncService.postBody(url, params);
}
// 保存用户提交记录
WpsFileUser wpsFileUser = initFileUser(userId, version.getId());
wpsFileUser.setOperation( operation);

29
tall/src/main/java/com/ccsens/tall/web/DebugController.java

@ -1,5 +1,7 @@
package com.ccsens.tall.web;
import cn.hutool.core.lang.UUID;
import com.ccsens.util.ImageCodeGeneratorUtil;
import com.ccsens.util.JacksonUtil;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.TransactionUtil;
@ -23,7 +25,11 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.FileOutputStream;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@Slf4j
@Api(tags = "DEBUG" , description = "DebugController | ")
@ -42,21 +48,11 @@ public class DebugController {
})
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse getSmsCode(HttpServletRequest request) throws Exception {
commit();
commit();
log.info("修改wps后调用接口");
return JsonResponse.newInstance().ok("测试");
}
private void commit() {
TransactionStatus transactionStatus = TransactionUtil.getTransactionStatus(transactionManager);
for (int i = 0; i < 10; i++) {
transactionManager.commit(transactionStatus);
transactionStatus = TransactionUtil.getTransactionStatus(transactionManager);
}
}
@ApiOperation(value = "消息测试",notes = "")
@ -86,4 +82,15 @@ public class DebugController {
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "图片验证码")
@ApiImplicitParams({
})
@RequestMapping(value = "/code", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public void vertifyCode(HttpServletRequest request, HttpServletResponse response) throws Exception {
// Map<String,String> codeMap = ImageCodeGeneratorUtil.generateCountCode();
// log.info(codeMap.get("sum"));
// ImageCodeGeneratorUtil.generateCodeImage(response.getOutputStream(), codeMap.get("imageCode"), 200, 70);
}
}

14
tall/src/main/java/com/ccsens/tall/web/PluginController.java

@ -144,4 +144,18 @@ public class PluginController {
taskPluginService.deleteNotes(currentUserId,notesId);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "会议纪要表", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/minutes", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<String> saveMinutes(HttpServletRequest request,
@RequestParam(required = true) Long projectId,Long taskId) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN);
String token = authHeader.substring(WebConstant.HEADER_KEY_TOKEN_PREFIX.length());
List<String> wpsPath = taskPluginService.saveMinutes(currentUserId,projectId,taskId,token);
return JsonResponse.newInstance().ok(wpsPath);
}
}

20
tall/src/main/java/com/ccsens/tall/web/UserController.java

@ -17,15 +17,18 @@ import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.SignatureException;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.util.List;
import java.util.Map;
@Slf4j
@Api(tags = "用户相关操作API", description = "UserController | 用户操作控制器类")
@RestController
@RequestMapping("/users")
@ -107,8 +110,9 @@ public class UserController {
@RequestMapping(value = "/smscode", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.SmsCode> getSmsCode(HttpServletRequest request,
@ApiParam @RequestParam String phone,
@ApiParam Integer client) throws Exception {
UserVo.SmsCode smsCodeVo = userService.getSignInSmsCode(phone,client);
// @ApiParam Integer client,
@RequestParam(required = true) String verificationCodeId, String verificationCodeValue) throws Exception {
UserVo.SmsCode smsCodeVo = userService.getSignInSmsCode(phone,verificationCodeId,verificationCodeValue);
return JsonResponse.newInstance().ok(smsCodeVo);
}
@ -441,7 +445,15 @@ public class UserController {
return memberIdInfo;
}
@ApiOperation(value = "图片验证码")
@ApiImplicitParams({
})
@RequestMapping(value = "/code", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.VerificationCode> vertifyCode(HttpServletRequest request, HttpServletResponse response) throws Exception {
UserVo.VerificationCode vertifyCode = userService.getVertifyCode();
// ImageCodeGeneratorUtil.generateCodeImage(response.getOutputStream(), (String) codeMap.get("imageCode"), 200, 70);
return JsonResponse.newInstance().ok(vertifyCode);
}
}

17
tall/src/main/java/com/ccsens/tall/web/UserInfoController.java

@ -2,9 +2,11 @@ package com.ccsens.tall.web;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ImageUtil;
import cn.hutool.http.HttpResponse;
import com.ccsens.tall.bean.dto.UserDto;
import com.ccsens.tall.bean.vo.UserVo;
import com.ccsens.tall.service.IUserInfoService;
import com.ccsens.util.ImageCodeGeneratorUtil;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.UploadFileUtil_Servlet3;
import com.ccsens.util.WebConstant;
@ -19,9 +21,11 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import java.awt.*;
import java.io.File;
import java.io.FileOutputStream;
/**
* @author
@ -79,4 +83,17 @@ public class UserInfoController {
return JsonResponse.newInstance().ok(selectUserInfo);
}
@ApiOperation(value = "修改用户详细信息")
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.SelectUserInfo> updateUserInfo(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.UpdateUserInfo updateUserInfo) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
UserVo.SelectUserInfo selectUserInfo = userInfoService.updateUserInfo(currentUserId,updateUserInfo);
return JsonResponse.newInstance().ok(selectUserInfo);
}
}

2
tall/src/main/java/com/ccsens/tall/web/WpsController.java

@ -157,7 +157,7 @@ public class WpsController {
public WpsVo.FileNew fileNew(HttpServletRequest request, WpsDto.FileNew fileNew, String name, Part file) throws Exception {
log.info("上传文件新版本请求参数:{}", fileNew);
WpsHeader header = checkSignature(request, fileNew.get_w_signature());
WpsVo.FileNew fileNewVo = wpsService.fileNew(header.getToken(), header.getFileId(), name, file);
WpsVo.FileNew fileNewVo = wpsService.fileNew(header.getToken(), header.getFileId(), name, file, fileNew);
log.info("文件新建返回:{}", fileNewVo);
return fileNewVo;
}

2
tall/src/main/resources/application-prod.yml

@ -38,7 +38,7 @@ eureka:
gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/
wx:
prefixUrl: https://test.tall.wiki/wxconfigurer-api/
prefixUrl: https://www.tall.wiki/wxconfigurer-api/
file:
domain: https://www.tall.wiki/gateway/tall/v1.0/
imgDomain: https://www.tall.wiki/gateway/tall/v1.0/uploads

2
tall/src/main/resources/application-test.yml

@ -39,7 +39,7 @@ eureka:
gatewayUrl: https://test.tall.wiki/gateway/
notGatewayUrl: https://test.tall.wiki/
wx:
prefixUrl: https://test.tall.wiki/wxconfigurer-api/
prefixUrl: https://www.tall.wiki/wxconfigurer-api/
file:
domain: https://test.tall.wiki/gateway/tall/v1.0/
imgDomain: https://test.tall.wiki/gateway/tall/v1.0/uploads

1
tall/src/main/resources/mapper_dao/TaskDetailDao.xml

@ -36,6 +36,7 @@
<result column="webPath" property="webPath" />
<result column="routineLocation" property="routineLocation" />
<result column="importParam" property="importParam" />
<result column="priority" property="priority" />
<collection property="plugins" ofType="com.ccsens.tall.bean.vo.TaskVo$PluginVo">
<id column="pId" property="id"/>
<result column="pName" property="name"/>

75
tall/src/main/resources/mapper_dao/TaskSubTimeDao.xml

@ -2,6 +2,26 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tall.persist.dao.TaskSubTimeDao">
<resultMap id="taskMinutesWps" type="com.ccsens.tall.bean.vo.TaskVo$TaskMinutesWps">
<id column="taskSubTimeId" property="taskSubTimeId" />
<result column="executorRoleName" property="executorRoleName" />
<result column="taskName" property="taskName" />
<result column="beginTime" property="beginTime" />
<result column="endTime" property="endTime" />
<result column="realBeginTime" property="realBeginTime" />
<result column="realEndTime" property="realEndTime" />
<collection property="comment" ofType="com.ccsens.tall.bean.vo.TaskVo$TaskMinutesWps$CommentByMinutes">
<id column="commentId" property="commentId"/>
<result column="userName" property="userName"/>
<result column="commentValue" property="commentValue"/>
</collection>
<collection property="deliverList" ofType="com.ccsens.tall.bean.vo.TaskVo$TaskMinutesWps$DeliverByMinutes">
<id column="deliverId" property="deliverId"/>
<id column="deliverName" property="deliverName"/>
<result column="deliverPath" property="deliverPath"/>
</collection>
</resultMap>
<select id="getUnderwayTaskByRoleId" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.po.ProTaskSubTime">
SELECT
*
@ -156,4 +176,59 @@
,s.begin_time DESC
</if>
</select>
<select id="queryMinutesTaskByTime" parameterType="java.util.Map" resultMap="taskMinutesWps">
SELECT
s.id as taskSubTimeId,
r.`name` as executorRoleName,
d.`name` as taskName,
FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d %H:%m') as beginTime,
FROM_UNIXTIME(s.end_time/1000,'%Y-%m-%d %H:%m') as endTime,
if(s.real_begin_time = 0,'' ,FROM_UNIXTIME(s.real_begin_time/1000,'%Y-%m-%d %H:%m')) as realBeginTime,
if(s.real_end_time = 0,'' ,FROM_UNIXTIME(s.real_end_time/1000,'%Y-%m-%d %H:%m')) as realEndTime,
t.commentId as commentId,
t.userName as userName,
t.commentValue as commentValue,
td.`name` as deliverName,
n.deliverPath as deliverPath,
td.id as deliverId
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d on s.task_detail_id = d.id
LEFT JOIN t_pro_role r on d.executor_role = r.id
LEFT JOIN t_pro_task_deliver td on d.id = td.task_detail_id
LEFT JOIN
(
SELECT
c.id as commentId,
c.task_sub_time_id as taskId,
c.description as `commentValue`,
if(s.nickname = '',a.identifier,s.nickname) as userName
FROM
t_pro_task_comment c left join t_sys_user s on c.user_id = s.id
left join t_sys_auth a on s.id = a.user_id and a.identify_type = 3
WHERE
c.rec_status = 0
and
a.rec_status = 0
)t on t.taskId = s.id
LEFT JOIN
(
SELECT
dl.id as deliverLogPostId,
dl.task_sub_time_id as taskId,
cf.path as deliverPath
FROM
t_pro_task_deliver_post_log dl LEFT JOIN t_sys_commited_file cf on cf.id = dl.file_id
)n on s.id = n.taskId
WHERE
d.rec_status = 0
AND
d.project_id = #{projectId}
AND
s.begin_time &lt; #{endTime}
AND
s.end_time &gt; #{startTime}
and
d.level != 1
</select>
</mapper>

323
tall/src/main/resources/mapper_raw/SysUserInfoMapper.xml

@ -0,0 +1,323 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tall.persist.mapper.SysUserInfoMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.SysUserInfo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="signature" jdbcType="VARCHAR" property="signature" />
<result column="introduction" jdbcType="VARCHAR" property="introduction" />
<result column="birthday" jdbcType="VARCHAR" property="birthday" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="web_path" jdbcType="VARCHAR" property="webPath" />
<result column="company" jdbcType="VARCHAR" property="company" />
<result column="position" jdbcType="VARCHAR" property="position" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, signature, introduction, birthday, address, web_path, company, position,
created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysUserInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_sys_user_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_sys_user_info
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_sys_user_info
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.SysUserInfoExample">
delete from t_sys_user_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysUserInfo">
insert into t_sys_user_info (id, user_id, signature,
introduction, birthday, address,
web_path, company, position,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{signature,jdbcType=VARCHAR},
#{introduction,jdbcType=VARCHAR}, #{birthday,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{webPath,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysUserInfo">
insert into t_sys_user_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="signature != null">
signature,
</if>
<if test="introduction != null">
introduction,
</if>
<if test="birthday != null">
birthday,
</if>
<if test="address != null">
address,
</if>
<if test="webPath != null">
web_path,
</if>
<if test="company != null">
company,
</if>
<if test="position != null">
position,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="signature != null">
#{signature,jdbcType=VARCHAR},
</if>
<if test="introduction != null">
#{introduction,jdbcType=VARCHAR},
</if>
<if test="birthday != null">
#{birthday,jdbcType=VARCHAR},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="webPath != null">
#{webPath,jdbcType=VARCHAR},
</if>
<if test="company != null">
#{company,jdbcType=VARCHAR},
</if>
<if test="position != null">
#{position,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysUserInfoExample" resultType="java.lang.Long">
select count(*) from t_sys_user_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_sys_user_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.signature != null">
signature = #{record.signature,jdbcType=VARCHAR},
</if>
<if test="record.introduction != null">
introduction = #{record.introduction,jdbcType=VARCHAR},
</if>
<if test="record.birthday != null">
birthday = #{record.birthday,jdbcType=VARCHAR},
</if>
<if test="record.address != null">
address = #{record.address,jdbcType=VARCHAR},
</if>
<if test="record.webPath != null">
web_path = #{record.webPath,jdbcType=VARCHAR},
</if>
<if test="record.company != null">
company = #{record.company,jdbcType=VARCHAR},
</if>
<if test="record.position != null">
position = #{record.position,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_sys_user_info
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
signature = #{record.signature,jdbcType=VARCHAR},
introduction = #{record.introduction,jdbcType=VARCHAR},
birthday = #{record.birthday,jdbcType=VARCHAR},
address = #{record.address,jdbcType=VARCHAR},
web_path = #{record.webPath,jdbcType=VARCHAR},
company = #{record.company,jdbcType=VARCHAR},
position = #{record.position,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.SysUserInfo">
update t_sys_user_info
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="signature != null">
signature = #{signature,jdbcType=VARCHAR},
</if>
<if test="introduction != null">
introduction = #{introduction,jdbcType=VARCHAR},
</if>
<if test="birthday != null">
birthday = #{birthday,jdbcType=VARCHAR},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="webPath != null">
web_path = #{webPath,jdbcType=VARCHAR},
</if>
<if test="company != null">
company = #{company,jdbcType=VARCHAR},
</if>
<if test="position != null">
position = #{position,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.SysUserInfo">
update t_sys_user_info
set user_id = #{userId,jdbcType=BIGINT},
signature = #{signature,jdbcType=VARCHAR},
introduction = #{introduction,jdbcType=VARCHAR},
birthday = #{birthday,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
web_path = #{webPath,jdbcType=VARCHAR},
company = #{company,jdbcType=VARCHAR},
position = #{position,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

BIN
tall/src/main/resources/template/regularMeetingTemplate.xlsx

Binary file not shown.

8
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -126,8 +126,10 @@ public enum CodeEnum {
FILE_NOT_FOUND(106,"未找到对应的文件,请检查后操作",true),
SIGNATURE_FAIL(107,"签名验证失败",true),
NOT_UNIT(107,"时间单位不能为空",true),
NOT_UNIT(108,"时间单位不能为空",true),
NOT_USER(109,"用户不存在",true),
VERIFICATION_CODE_PAST(110,"验证码失效,请刷新重试",true),
VERIFICATION_CODE_ERROR(110,"验证码错误",true),
@ -139,7 +141,7 @@ public enum CodeEnum {
}
public static CodeEnum getByCode(int code) {
for (CodeEnum codeEnum: CodeEnum.values()) {
if (codeEnum.getCode().intValue() == code) {
if (codeEnum.getCode() == code) {
return codeEnum;
}
}

140
util/src/main/java/com/ccsens/util/ImageCodeGeneratorUtil.java

@ -0,0 +1,140 @@
package com.ccsens.util;
import cn.hutool.core.codec.Base64;
import lombok.extern.slf4j.Slf4j;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import javax.imageio.ImageIO;
/**
* @author
*/
@Slf4j
public class ImageCodeGeneratorUtil {
/**
* 验证码字符的范围
*/
public static final String VERTIFICATION_CODE ="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
/**
*
* @param size 字符长度
* @param sourceCode 字符范围
* @return 返回随机生成的字符
*/
public static String generateCode(int size,String sourceCode) {
Random random = new Random(System.currentTimeMillis());
char[] codes= new char[size];
for(int i=0;i<size;i++) {
codes[i]=sourceCode.charAt(random.nextInt(sourceCode.length()-1));
}
return String.valueOf(codes);
}
/**
* 生成算数验证码
* @return 返回
*/
public static Map<String,Object> generateCountCode() {
//生成两个随机数
Random random = new Random();
int i1 = random.nextInt(50);
int i2 = random.nextInt(50);
//计算两个数的和,并生成验证码的内容
int sum = i1 + i2;
String imageCode = i1 + "+" + i2 + "=" + "?";
//返回
Map<String,Object> codeMap = new HashMap<>();
codeMap.put("imageCode",imageCode);
codeMap.put("sum",sum);
return codeMap;
}
public static String generateCodeImage(OutputStream os,String vertifyCode,int width,int height) {
int verifySize = vertifyCode.length();
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
// 获取图形上下文
Graphics g = image.getGraphics();
// 生成随机类
Random random = new Random();
// 设定背景色
g.setColor(getRandColor(230, 255));
g.fillRect(0, 0, width, height);
// 设定字体
g.setFont(new Font("Arial", Font.CENTER_BASELINE | Font.ITALIC, 28));
// 产生0条干扰线,
g.drawLine(0, 0, 0, 0);
// 取随机产生的认证码(4位数字)
for (int i = 0; i < verifySize; i++) {
// 将认证码显示到图象中
// 调用函数出来的颜色相同,可能是因为种子太接近,所以只能直接生成
g.setColor(getRandColor(100, 150));
g.drawString(String.valueOf(vertifyCode.charAt(i)), i * (width/verifySize) +5, 50);
}
//画干扰线
for(int i=0;i<(random.nextInt(20)+5);i++){
g.setColor(new Color(random.nextInt(255)+1,random.nextInt(255)+1,random.nextInt(255)+1));
g.drawLine(random.nextInt(width),random.nextInt(height),random.nextInt(width)+5,random.nextInt(height)+5);
}
// 图象生效
g.dispose();
// 输出图象到页面
try {
// ImageIO.write(image, "jpg", os);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
ImageIO.write(image, "png", outputStream);
ByteArrayInputStream input = new ByteArrayInputStream(outputStream.toByteArray());
return Base64.encode(input);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
log.error("生成图片验证码异常",e);
return null;
}
}
public static void main(String[] args) {
// System.out.println(generateCode(6, VERTIFICATION_CODE));
// int iRandom = (int)(1+Math.random()*50);
// Double a = Math.random();
// System.out.println(a);
// System.out.println(a*50);
// System.out.println(1+a*50);
// System.out.println(new Random().nextInt(9)+1);
String c = new String("aaa");
String a = "helloword";
String b = "ewor";
a.indexOf(b);
}
private static Color getRandColor(int fc, int bc) {
Random random = new Random();
if (fc > 255) {
fc = 255;
}
if (bc > 255) {
bc = 255;
}
int r = fc + random.nextInt(bc - fc);
int g = fc + random.nextInt(bc - fc);
int b = fc + random.nextInt(bc - fc);
return new Color(r, g, b);
}
}

117
util/src/main/java/com/ccsens/util/PoiUtil.java

@ -18,6 +18,8 @@ import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;
import org.springframework.stereotype.Component;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
@ -180,16 +182,23 @@ public class PoiUtil {
* @return
*/
private static void mergedRegion(Sheet sheet, int rows, int cols, PoiUtilCell cell) {
//
// int rowspan = cell.rowspan;
// if (rowspan > 1) {
// sheet.addMergedRegion(new CellRangeAddress(rows, rows + rowspan - 1, cols, cols));
// }
// int colspan = cell.colspan;
//
// if (colspan > 1) {
// sheet.addMergedRegion(new CellRangeAddress(rows, rows, cols, cols + colspan - 1));
// }
int rowspan = cell.rowspan;
if (rowspan > 1) {
sheet.addMergedRegion(new CellRangeAddress(rows, rows + rowspan - 1, cols, cols));
}
int colspan = cell.colspan;
if (colspan > 1) {
sheet.addMergedRegion(new CellRangeAddress(rows, rows, cols, cols + colspan - 1));
if(rowspan > 1 || colspan > 1){
sheet.addMergedRegion(new CellRangeAddress(rows, rows + rowspan - 1, cols, cols + colspan - 1));
}
}
@ -383,6 +392,42 @@ public class PoiUtil {
return map;
}
public static void setPicture(File file){
FileOutputStream fileOut = null;
BufferedImage bufferImg = null;
//先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray
try {
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
bufferImg = ImageIO.read(file);
ImageIO.write(bufferImg, "jpg", byteArrayOut);
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet1 = wb.createSheet("test picture");
//画图的顶级管理器,一个sheet只能获取一个(一定要注意这点)
XSSFDrawing patriarch = sheet1.createDrawingPatriarch();
//anchor主要用于设置图片的属性
XSSFClientAnchor anchor = new XSSFClientAnchor(0, 0, 255, 255,(short) 1, 1, (short) 5, 8);
//注意:这个方法在新版本的POI中参数类型改成了(AnchorType anchorType) 
anchor.setAnchorType(ClientAnchor.AnchorType.byId(3));
//插入图片
patriarch.createPicture(anchor, wb.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG));
fileOut = new FileOutputStream("D:/测试Excel.xlsx");
// 写入excel文件
wb.write(fileOut);
System.out.println("----Excle文件已生成------");
} catch (Exception e) {
e.printStackTrace();
}finally{
if(fileOut != null){
try {
fileOut.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* 获取当前行
*/
@ -430,36 +475,36 @@ public class PoiUtil {
}
public static void main(String[] args) throws Exception {
// File file = new File("D:\\1.xlsx");
// List<Object[]> list = readExce(file, 0, null, 3, true);
// for (Object[] arr : list) {
// for (Object t : arr) {
// System.out.print(t + "---");
// }
// System.out.println("============");
// }
List<List<PoiUtilCell>> list = new ArrayList<>();
List<PoiUtilCell> cells = new ArrayList<>();
cells.add(new PoiUtilCell("1", 5, 1));
cells.add(new PoiUtilCell());
cells.add(new PoiUtilCell());
cells.add(new PoiUtilCell());
cells.add(new PoiUtilCell());
cells.add(new PoiUtilCell("2"));
list.add(cells);
List<PoiUtilCell> cells2 = new ArrayList<>();
cells2.add(new PoiUtilCell("3", 1, 2));
cells2.add(new PoiUtilCell("4"));
list.add(cells2);
List<PoiUtilCell> cells3 = new ArrayList<>();
cells3.add(new PoiUtilCell("5"));
cells3.add(new PoiUtilCell("6"));
list.add(cells3);
Workbook wbs = exportWB("wbs", list, null);
OutputStream stream = new FileOutputStream(new File("D:\\1.xlsx"));
wbs.write(stream);
stream.close();
// List<List<PoiUtilCell>> list = new ArrayList<>();
// List<PoiUtilCell> cells = new ArrayList<>();
// cells.add(new PoiUtilCell("1", 5, 1));
// cells.add(new PoiUtilCell());
// cells.add(new PoiUtilCell());
// cells.add(new PoiUtilCell());
// cells.add(new PoiUtilCell());
// cells.add(new PoiUtilCell("2"));
// list.add(cells);
// List<PoiUtilCell> cells2 = new ArrayList<>();
// cells2.add(new PoiUtilCell("3", 1, 2));
// cells2.add(new PoiUtilCell("4"));
// list.add(cells2);
// List<PoiUtilCell> cells3 = new ArrayList<>();
// cells3.add(new PoiUtilCell("5"));
// cells3.add(new PoiUtilCell("6"));
// list.add(cells3);
// List<PoiUtilCell> cells4 = new ArrayList<>();
// list.add(cells4);
// List<PoiUtilCell> cells5 = new ArrayList<>();
// cells5.add(new PoiUtilCell("9", 2, 2));
// cells5.add(new PoiUtilCell("9"));
// list.add(cells5);
//
// Workbook wbs = exportWB("wbs", list, null);
// OutputStream stream = new FileOutputStream(new File("D:\\1.xlsx"));
// wbs.write(stream);
// stream.close();
setPicture(new File("C:\\Users\\逗\\Desktop\\0cf3ffd8f0001c4310b02f706753721.png"));
}

2
util/src/main/java/com/ccsens/util/RedisUtil.java

@ -132,7 +132,7 @@ public class RedisUtil {
* 递增
*
* @param key
* @param by 要增加几(大于0)
* @param delta 要增加几(大于0)
* @return
*/
public long incr(String key, long delta) {

10
util/src/main/java/com/ccsens/util/WebConstant.java

@ -13,6 +13,12 @@ public class WebConstant {
/**数据已删除*/
public static final byte STATUS_DELETE = 1;
/**属性名*/
public static class Field{
public static final String CODE = "code";
}
public static enum TemplateParam {
Operator("{{operator}}", "操作者"),
@ -42,6 +48,8 @@ public class WebConstant {
public static final String FILE_TYPE_TABLE = "xls, xlt, et, xlsx, xltx, csv, xlsm, xltm";
public static final String FILE_TYPE_DEMO = " ppt,pptx,pptm,ppsx,ppsm,pps,potx,potm,dpt,dps";
public static final String FILE_TYPE_PDF = "pdf";
public static final String _W_URL = "_w_url";
/**新建*/
public static final byte USER_OPERATION_NEW = 0;
@ -137,7 +145,7 @@ public class WebConstant {
public static final String REQUEST_KEY_CLAIMS = "claims";
public static final String REQUEST_KEY_TOKEN_USERS = "Token_User";
public static final String RANDOM_STR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
public static final String IMAGE_CODE = "image_code_";
public static final long JWT_ACCESS_TOKEN_EXPIRED_TLLMILLS = 3600 * 24 * 365 * 1000; //20 hours

4
util/src/test/java/com/ccsens/util/Base64Test.java

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save