diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100644 index 00000000..49d3e344 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +export deploy_path=/opt/webapps/NingXiaJiJu + +#export jars_path = /home/jenkins/workspace/NingXiaJiJu/bonus-auth/target + +export app_workspace=/home/jenkins/workspace/NingXiaJiJu + + +app_source_jars=( + "sgzb-api/sgzb-api-system/target/sgzb-api-system-3.6.3.jar" + "sgzb-auth/target/sgzb-auth.jar" + "sgzb-gateway/target/sgzb-gateway.jar" + "sgzb-modules/sgzb-base/target/sgzb-base.jar" + "sgzb-modules/sgzb-file/target/sgzb-file.jar" + "sgzb-modules/sgzb-gen/target/sgzb-gen.jar" + "sgzb-modules/sgzb-job/target/sgzb-job.jar" + "sgzb-modules/sgzb-material/target/sgzb-material.jar" + "sgzb-modules/sgzb-settlement/target/sgzb-settlement.jar" + "sgzb-modules/sgzb-system/target/sgzb-system.jar" + "sgzb-visual/target/sgzb-visual-monitor.jar" +) + +for source_jar in "${app_source_jars[@]}"; do + cp -f ${app_workspace}/${source_jar} $deploy_path + echo "copied ${app_workspace}/${source_jar}/auth/target/auth.jar to $deploy_path" +done +# Define an array of JAR files to run +jars=("sgzb-auth.jar" "sgzb-gateway.jar" "sgzb-modules-base.jar" "sgzb-modules-file.jar" + "sgzb-modules-gen.jar" "sgzb-modules-job.jar" "sgzb-modules-material.jar" + "sgzb-modules-settlement.jar" "sgzb-modules-system.jar" "sgzb-system.jar" + "sgzb-visual-monitor.jar" "sentinel-dashboard-1.8.1.jar") + +# Stop all running JARs +for jar in "${jars[@]}"; do + P_ID=$(pgrep -f "$jar") + # 如果该项目已经在服务器上启动则kill掉 + echo "原应用程序$jar进程id:$P_ID" + if [ -z "$P_ID" ]; then + echo "==$jar service process does not exist" + else + # 尝试优雅地关闭应用程序 + kill -9 "$P_ID" + wait "$P_ID" 2>/dev/null + + # 检查进程是否仍在运行 + if ! ps -p "$P_ID" > /dev/null; then + echo "$jar service process was terminated gracefully" + else + # 如果优雅关闭失败,则强制杀死进程 + kill -9 "$P_ID" + echo "$jar service process was killed forcefully" + fi + fi +done + +# Iterate over the JAR files array +for jar in "${jars[@]}"; do + echo "Running $jar..." + # Assuming java is in your PATH and the JARs are in the current directory + nohup /usr/lib/jvm/jdk1.8.0_381/bin/java -jar "$jar" >/dev/null 2>&1 & + +done + +echo "All JARs have been run successfully." diff --git a/scripts/stopServices.sh b/scripts/stopServices.sh new file mode 100644 index 00000000..61d3ad52 --- /dev/null +++ b/scripts/stopServices.sh @@ -0,0 +1,71 @@ +P_ID=$(pgrep -f SgzbAuthApplication) +if [ -z "$P_ID" ]; then + echo "SgzbAuthApplication is not running" +else + kill -9 "$P_ID" +fi + +P_ID=$(pgrep -f SgzbFileApplication) +if [ -z "$P_ID" ]; then + echo "SgzbFileApplication is not running" +else + kill -9 "$P_ID" +fi + +P_ID=$(pgrep -f SgzbGatewayApplication) +if [ -z "$P_ID" ]; then + echo "SgzbGatewayApplication is not running" +else + kill -9 "$P_ID" +fi + +P_ID=$(pgrep -f SgzbGenApplication) +if [ -z "$P_ID" ]; then + echo "SgzbGenApplication is not running" +else + kill -9 "$P_ID" +fi + +P_ID=$(pgrep -f SgzbJobApplication) +if [ -z "$P_ID" ]; then + echo "SgzbJobApplication is not running" +else + kill -9 "$P_ID" +fi + +P_ID=$(pgrep -f SgzbMonitorApplication) +if [ -z "$P_ID" ]; then + echo "SgzbMonitorApplication is not running" +else + kill -9 "$P_ID" +fi + +P_ID=$(pgrep -f SgzbBaseApplication) +if [ -z "$P_ID" ]; then + echo "SgzbBaseApplication is not running" +else + kill -9 "$P_ID" +fi + +P_ID=$(pgrep -f SgzbMaterialApplication) +if [ -z "$P_ID" ]; then + echo "SgzbMaterialApplication is not running" +else + kill -9 "$P_ID" +fi + +P_ID=$(pgrep -f SgzbSettlementApplication) +if [ -z "$P_ID" ]; then + echo "SgzbSettlementApplication is not running" +else + kill -9 "$P_ID" +fi + + +P_ID=$(pgrep -f SgzbSystemApplication) +if [ -z "$P_ID" ]; then + echo "SgzbSystemApplication is not running" +else + kill -9 "$P_ID" +fi + diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java index 6c23bc5d..125729b7 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java @@ -122,6 +122,7 @@ public class BackReceiveController extends BaseController { String[] split = record.getTypeId().split(","); for (String s : split) { record.setModelId(s); + record.setTypeId(null); List list = backReceiveService.receiveView(record); for (BackApplyInfo backApplyInfo : list) { if (Double.valueOf(backApplyInfo.getNum()).intValue() != 0) { diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java index 5dd77e58..0007f856 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java @@ -200,6 +200,7 @@ public class BackReceiveServiceImpl implements BackReceiveService { } } + //维修的创建维修任务,插入任务协议表 List wxList = backReceiveMapper.getWxList(record); if (wxList != null && wxList.size() > 0) { @@ -210,8 +211,8 @@ public class BackReceiveServiceImpl implements BackReceiveService { //插入维修记录表repair_apply_details res = insertRad(newTaskId, wxList); } - //待报废的创建报废任务,插入任务协议表 + //待报废的创建报废任务,插入任务协议表 List bfList = backReceiveMapper.getBfList(record); if (bfList != null && bfList.size() > 0) { //插入任务表tm_task diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml index 836e1e49..c37beaef 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml @@ -1078,6 +1078,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" scrap_check_details scd1 LEFT JOIN scrap_apply_details sad1 ON scd1.parent_id = sad1.parent_id AND scd1.type_id = sad1.type_id + WHERE sad1.task_id = #{taskId} GROUP BY scd1.parent_id, sad1.type_id