Browse Source

更新faseJson 1.2.83

wuweihao 3 năm trước cách đây
mục cha
commit
07c47b70af

+ 1 - 6
gis_cms/src/main/java/com/gis/cms/service/impl/HotelServiceImpl.java

@@ -66,12 +66,6 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> impl
 
 
 
-
-    // 链路id
-    static String traceId;
-
-
-
     @Override
     public Result search(HotelPageDto param) {
 
@@ -289,6 +283,7 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> impl
         HashMap<String, Object> result = new HashMap<>();
         result.put("size", rows.size());
         result.put("filePath", filePath);
+
         return  Result.success(result);
     }
 

+ 10 - 0
gis_cms/src/main/java/com/gis/cms/zhengyuan/ZhengYuanService.java

@@ -1,5 +1,6 @@
 package com.gis.cms.zhengyuan;
 
+import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.gis.cms.entity.po.HotelEntity;
 import com.gis.common.base.entity.po.LogEntity;
@@ -75,6 +76,15 @@ public class ZhengYuanService {
 
     }
 
+    public void testLog(){
+        LogService logService = SpringUtil.getBean(LogService.class);
+        traceId = MDC.get("TRACE_ID");
+        executorService.execute(() -> {
+            MDC.put("TRACE_ID", traceId);
+            logService.save(new LogEntity(1L, "1", "11111", null));
 
+        });
+
+    }
 
 }

+ 60 - 0
run.sh

@@ -0,0 +1,60 @@
+#!/bin/sh
+APP_NAME=gov_zhuhai_isolation.jar
+APP_PORT=8014
+APP_EVN=$2   #执行环境 sit|pro
+APP_ORDER=$1   #执行方法  start|stop|restart
+# 获取进程号
+APP_PID=`netstat -ntpl | grep $APP_PORT | grep LISTEN | awk '{print $7}' | awk -F "/" '{print $1}'`
+
+
+# 启动命令
+startApp(){
+    if [ ${APP_PID} ];
+    then
+    	echo "程序已经在运行了"
+    else
+    	echo "执行 start 方法"
+    	nohup java -jar -Xmx3072M -Xms512M ./$APP_NAME --spring.profiles.active=$APP_EVN --server.port=$APP_PORT > logs.log 2>error.log &  # 说明pid为空
+	echo Start Success!
+fi
+}
+
+# 停止命令
+stopApp(){
+    echo "执行 stop 方法"
+    if [ ${APP_PID} ];
+	then
+		echo $APP_NAME "存在,执行 stop 方法"
+			kill -9 ${APP_PID} && echo 'Kill Process!'
+	else
+		echo $APP_NAME 没有运行
+    fi
+}
+
+# 重启命令
+restartApp(){
+    echo " 1 执行 restart 方法"
+	stopApp
+	APP_PID=''  #将进程号置空
+	sleep 2
+	echo "进程号:" ${APP_PID} "端口号:" ${APP_PORT}
+	echo " 2 执行 restart 方法"
+	startApp
+}
+
+# 判断执行命令 取第一个参数
+case $APP_ORDER in
+    "start")
+        startApp
+        ;;
+    "stop")
+        stopApp
+        ;;
+	"restart")
+		restartApp
+        ;;
+        *)
+     ;;
+esac
+
+