From aadfdda9ee76ec59e5a2bc90214d7c91624b32d2 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Tue, 23 Jul 2024 09:37:06 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97,?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E8=BF=90=E8=90=A5=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/sh/app-prd.sh | 92 +++++++++++++++++++ bin/sh/app-pre.sh | 92 +++++++++++++++++++ bin/sh/app-sit.sh | 92 +++++++++++++++++++ .../TransactionRecordsRequestHandler.java | 2 +- jsowell-ui/src/views/pile/basic/index.vue | 10 +- 5 files changed, 286 insertions(+), 2 deletions(-) create mode 100644 bin/sh/app-prd.sh create mode 100644 bin/sh/app-pre.sh create mode 100644 bin/sh/app-sit.sh diff --git a/bin/sh/app-prd.sh b/bin/sh/app-prd.sh new file mode 100644 index 000000000..79a9de8be --- /dev/null +++ b/bin/sh/app-prd.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# 声明应用的名称和使用的端口号 +APP_NAME=jsowell-admin.jar +PORT=8080 # 假设应用绑定到这个端口 + +# 使用函数来显示脚本的使用方式,并退出脚本 +usage() { + echo "Usage: sh app.sh [start|stop|restart|status]" + exit 1 +} + +# 检查应用是否已经在运行 +is_exist(){ + # 使用 lsof 命令查找使用指定端口的进程ID,这里应该是 lsof 的拼写错误,应为 lsof 或 lsof 的替代品如 netstat、ss + pid=$(lsof -t -i :$PORT) + if [ -z "$pid" ]; then + # 如果 pid 为空,表示没有找到对应的进程,返回 1 + return 1 + else + # 如果找到了进程,返回 0 + return 0 + fi +} + +# 启动应用的函数 +start(){ + # 检查应用是否已经在运行 + is_exist + if [ $? -eq 0 ]; then + # 如果应用已经在运行,则输出提示信息 + echo "${APP_NAME} is already running on port $PORT." + else + # 如果应用没有运行,则启动应用,并将输出重定向到 nobup.log 文件 + # 注意:nohup 应该是 nohup 的拼写错误 + nohup java -Xms12g -Xmx12g -XX:+UseG1GC -jar /opt/app/spring/jar/jsowell-admin.jar --spring.profiles.active=prd >/dev/null 2>&1 & + fi +} + +# 停止应用的函数 +stop(){ + # 检查应用是否在运行 + is_exist + if [ $? -eq 0 ]; then + # 如果应用在运行,则强制终止该进程 + kill -9 $pid + # 输出停止应用的提示信息 + echo "Stopped ${APP_NAME} running on port $PORT." + else + # 如果应用没有运行,则输出提示信息 + echo "${APP_NAME} is not running on port $PORT." + fi +} + +# 检查应用状态的函数 +status(){ + # 检查应用是否在运行 + is_exist + if [ $? -eq 0 ]; then + # 如果应用在运行,则输出应用的运行状态和进程ID + echo "${APP_NAME} is running on port $PORT. Pid is $pid" + else + # 如果应用没有运行,则输出提示信息 + echo "${APP_NAME} is NOT running on port $PORT." + fi +} + +# 重启应用的函数 +restart(){ + # 停止应用 + stop + # 启动应用 + start +} + +# 根据传入的参数执行相应的操作 +case "$1" in + "start") + start # 启动应用 + ;; + "stop") + stop # 停止应用 + ;; + "status") + status # 检查应用状态 + ;; + "restart") + restart # 重启应用 + ;; + *) + usage # 如果参数不正确,则显示使用方式 + ;; +esac \ No newline at end of file diff --git a/bin/sh/app-pre.sh b/bin/sh/app-pre.sh new file mode 100644 index 000000000..82c3afe98 --- /dev/null +++ b/bin/sh/app-pre.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# 声明应用的名称和使用的端口号 +APP_NAME=jsowell-admin.jar +PORT=8080 # 假设应用绑定到这个端口 + +# 使用函数来显示脚本的使用方式,并退出脚本 +usage() { + echo "Usage: sh app.sh [start|stop|restart|status]" + exit 1 +} + +# 检查应用是否已经在运行 +is_exist(){ + # 使用 lsof 命令查找使用指定端口的进程ID,这里应该是 lsof 的拼写错误,应为 lsof 或 lsof 的替代品如 netstat、ss + pid=$(lsof -t -i :$PORT) + if [ -z "$pid" ]; then + # 如果 pid 为空,表示没有找到对应的进程,返回 1 + return 1 + else + # 如果找到了进程,返回 0 + return 0 + fi +} + +# 启动应用的函数 +start(){ + # 检查应用是否已经在运行 + is_exist + if [ $? -eq 0 ]; then + # 如果应用已经在运行,则输出提示信息 + echo "${APP_NAME} is already running on port $PORT." + else + # 如果应用没有运行,则启动应用,并将输出重定向到 nobup.log 文件 + # 注意:nohup 应该是 nohup 的拼写错误 + nohup java -Xms512m -Xmx512m -XX:+UseG1GC -jar /opt/app/spring/jar/jsowell-admin.jar --spring.profiles.active=pre >/dev/null 2>&1 & + fi +} + +# 停止应用的函数 +stop(){ + # 检查应用是否在运行 + is_exist + if [ $? -eq 0 ]; then + # 如果应用在运行,则强制终止该进程 + kill -9 $pid + # 输出停止应用的提示信息 + echo "Stopped ${APP_NAME} running on port $PORT." + else + # 如果应用没有运行,则输出提示信息 + echo "${APP_NAME} is not running on port $PORT." + fi +} + +# 检查应用状态的函数 +status(){ + # 检查应用是否在运行 + is_exist + if [ $? -eq 0 ]; then + # 如果应用在运行,则输出应用的运行状态和进程ID + echo "${APP_NAME} is running on port $PORT. Pid is $pid" + else + # 如果应用没有运行,则输出提示信息 + echo "${APP_NAME} is NOT running on port $PORT." + fi +} + +# 重启应用的函数 +restart(){ + # 停止应用 + stop + # 启动应用 + start +} + +# 根据传入的参数执行相应的操作 +case "$1" in + "start") + start # 启动应用 + ;; + "stop") + stop # 停止应用 + ;; + "status") + status # 检查应用状态 + ;; + "restart") + restart # 重启应用 + ;; + *) + usage # 如果参数不正确,则显示使用方式 + ;; +esac \ No newline at end of file diff --git a/bin/sh/app-sit.sh b/bin/sh/app-sit.sh new file mode 100644 index 000000000..c5247bda5 --- /dev/null +++ b/bin/sh/app-sit.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# 声明应用的名称和使用的端口号 +APP_NAME=jsowell-admin.jar +PORT=8080 # 假设应用绑定到这个端口 + +# 使用函数来显示脚本的使用方式,并退出脚本 +usage() { + echo "Usage: sh app.sh [start|stop|restart|status]" + exit 1 +} + +# 检查应用是否已经在运行 +is_exist(){ + # 使用 lsof 命令查找使用指定端口的进程ID,这里应该是 lsof 的拼写错误,应为 lsof 或 lsof 的替代品如 netstat、ss + pid=$(lsof -t -i :$PORT) + if [ -z "$pid" ]; then + # 如果 pid 为空,表示没有找到对应的进程,返回 1 + return 1 + else + # 如果找到了进程,返回 0 + return 0 + fi +} + +# 启动应用的函数 +start(){ + # 检查应用是否已经在运行 + is_exist + if [ $? -eq 0 ]; then + # 如果应用已经在运行,则输出提示信息 + echo "${APP_NAME} is already running on port $PORT." + else + # 如果应用没有运行,则启动应用,并将输出重定向到 nobup.log 文件 + # 注意:nohup 应该是 nohup 的拼写错误 + nohup java -Xms512m -Xmx512m -XX:+UseG1GC -jar /opt/app/spring/jar/jsowell-admin.jar --spring.profiles.active=sit >/dev/null 2>&1 & + fi +} + +# 停止应用的函数 +stop(){ + # 检查应用是否在运行 + is_exist + if [ $? -eq 0 ]; then + # 如果应用在运行,则强制终止该进程 + kill -9 $pid + # 输出停止应用的提示信息 + echo "Stopped ${APP_NAME} running on port $PORT." + else + # 如果应用没有运行,则输出提示信息 + echo "${APP_NAME} is not running on port $PORT." + fi +} + +# 检查应用状态的函数 +status(){ + # 检查应用是否在运行 + is_exist + if [ $? -eq 0 ]; then + # 如果应用在运行,则输出应用的运行状态和进程ID + echo "${APP_NAME} is running on port $PORT. Pid is $pid" + else + # 如果应用没有运行,则输出提示信息 + echo "${APP_NAME} is NOT running on port $PORT." + fi +} + +# 重启应用的函数 +restart(){ + # 停止应用 + stop + # 启动应用 + start +} + +# 根据传入的参数执行相应的操作 +case "$1" in + "start") + start # 启动应用 + ;; + "stop") + stop # 停止应用 + ;; + "status") + status # 检查应用状态 + ;; + "restart") + restart # 重启应用 + ;; + *) + usage # 如果参数不正确,则显示使用方式 + ;; +esac \ No newline at end of file diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/TransactionRecordsRequestHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/TransactionRecordsRequestHandler.java index 0d8a08e72..8caae9a3a 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/TransactionRecordsRequestHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/handler/yunkuaichong/TransactionRecordsRequestHandler.java @@ -569,7 +569,7 @@ public class TransactionRecordsRequestHandler extends AbstractHandler { processOrder(data); } } catch (Exception e) { - log.error("处理订单发生异常", e); + log.error("处理订单transactionCode:{}, 发生异常", transactionCode, e); } finally { if (uuid.equals(redisCache.getCacheObject(lockKey).toString())) { redisCache.unLock(lockKey); diff --git a/jsowell-ui/src/views/pile/basic/index.vue b/jsowell-ui/src/views/pile/basic/index.vue index ddef06709..28c23ac2a 100644 --- a/jsowell-ui/src/views/pile/basic/index.vue +++ b/jsowell-ui/src/views/pile/basic/index.vue @@ -140,6 +140,14 @@ /> + + +