opt:优化首页与状态栏信息,状态信息等。

This commit is contained in:
2023-11-21 14:02:25 +08:00
parent 2571beb3ba
commit 3622baa490
7 changed files with 555 additions and 308 deletions

View File

@@ -0,0 +1,38 @@
package org.nl.agv.enu;
import java.util.Arrays;
import java.util.Optional;
/**
* 任务状态枚举
*
* @author gbx
* @since 2023-11-21
*/
public enum TaskStatusEnum{
// 00 生成 01 执行中 02 执行完成
CREATE("生成未执行", "00"),
RUNNING("执行中", "01"),
END("完成", "02"),
OTHER("其他", "03");
private final String name;
private final String code;
TaskStatusEnum(String name, String code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public String getCode() {
return code;
}
public static TaskStatusEnum getType(String type) {
Optional<TaskStatusEnum> first = Arrays.stream(TaskStatusEnum.values()).filter(a -> a.getCode().equals(type)).findFirst();
return first.orElse(TaskStatusEnum.OTHER);
}
}

View File

@@ -49,13 +49,8 @@ public class ErrorServiceImpl implements ErrorService{
public Map<String,Object> querryError(Map<String,String> jsonObject) {
String errorStatus = "无故障";
List<String> errorCodeList = new ArrayList<>();
JSONArray result = new JSONArray();
JSONObject debugInfoJson = HomeServiceImpl.debugInfoJson;
if(debugInfoJson.size()>0) {
//todo 用,正式需改回
//int warningCode = 754529;

View File

@@ -23,6 +23,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import com.esotericsoftware.minlog.Log;
import com.sun.org.apache.regexp.internal.RE;
import edu.wpi.rail.jrosbridge.Ros;
import edu.wpi.rail.jrosbridge.Topic;
import edu.wpi.rail.jrosbridge.callback.TopicCallback;
@@ -31,9 +32,11 @@ import edu.wpi.rail.jrosbridge.services.ServiceResponse;
import lombok.RequiredArgsConstructor;
import com.alibaba.fastjson.JSONObject;
import org.nl.agv.enu.TaskSendBackStatusEnum;
import org.nl.agv.enu.TaskStatusEnum;
import org.nl.agv.service.HomeService;
import org.nl.agv.unit.RosUtil;
import org.nl.agv.unit.sendToAgvUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.core.bean.WQLObject;
@@ -43,10 +46,10 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.stream.Collectors;
/**
* @author qinx
@@ -65,83 +68,106 @@ public class HomeServiceImpl implements HomeService{
this.pool = pool;
}
/**
* 优化获取主页及状态栏信息
*/
@Override
public void qeryDebuggerInfo() {
Map<String,String> urlInfo = RosUtil.getRosHostInfo();
//todo RosJons模拟数据用正式需改回
//String result1 = HttpUtil.get("http://localhost:8011/api/pcsIfPurchaseorder/queryApt");
String result1 = "{\"Msg_DisplayState\":{\"AGV_ID\":255,\"Auto_In_Line_State\":0,\"Bosch_Car_Global_Theta\":-90.19221757272916,\"Bosch_Car_Global_rx\":-1.0619603784858553,\"Bosch_Car_Global_ry\":0.0020978358374357303,\"Bosch_Loc_State\":-2,\"Bosch_No_Rec_State\":0,\"Bosch_raw_age\":0.01389455795288086,\"Bosch_raw_epoch\":1,\"Bosch_raw_locState\":-2,\"Bosch_raw_qw\":0.9999999908132869,\"Bosch_raw_qx\":0.0,\"Bosch_raw_qy\":0.0,\"Bosch_raw_qz\":0.00013554861104682667,\"Bosch_raw_timestamp\":1695633231.1093392,\"Bosch_raw_uniqueId\":0,\"Bosch_raw_x\":0.0008994877773440588,\"Bosch_raw_x_odo\":0.0008994877773440588,\"Bosch_raw_y\":0.0006906610801896382,\"Bosch_raw_y_odo\":0.0006906610801896382,\"Bosch_raw_yaw\":0.00027109722292381746,\"Bosch_raw_yaw_odo\":0.0006906610801896382,\"Bosch_raw_z\":0.0,\"CAD_Or_TCS_Ctrl\":0,\"Car_Global_Theta\":-90.19221757272916,\"Car_Global_rx\":-1.0619603784858553,\"Car_Global_ry\":0.0020978358374357303,\"CurNodeID\":0,\"Cur_Stop_Info1_Authorized_Pass\":1,\"Cur_Stop_Info1_High_Precious_Enable\":1,\"Cur_Stop_Info1_Reached_Stop\":0,\"Cur_Stop_Info1_Set_Patht\":0.0,\"Cur_Stop_Info1_Set_Pathx\":0.0,\"Cur_Stop_Info1_Set_Pathy\":0.0,\"Cur_Stop_Info1_Single_Request_Sch\":0,\"Cur_Stop_Info1_Single_Stop_Sch\":0,\"Cur_Stop_Info1_StopEndNode\":0,\"Cur_Stop_Info1_StopStartNode\":0,\"Cur_Stop_Info1_Stop_Endt\":0.0,\"Cur_Stop_Info1_Stop_Endx\":0.0,\"Cur_Stop_Info1_Stop_Endy\":0.0,\"Cur_Stop_Info1_Stop_Num\":0,\"Cur_Stop_Info2_Authorized_Pass\":1,\"Cur_Stop_Info2_High_Precious_Enable\":1,\"Cur_Stop_Info2_Reached_Stop\":0,\"Cur_Stop_Info2_Set_Patht\":0.0,\"Cur_Stop_Info2_Set_Pathx\":0.0,\"Cur_Stop_Info2_Set_Pathy\":0.0,\"Cur_Stop_Info2_Single_Request_Sch\":0,\"Cur_Stop_Info2_Single_Stop_Sch\":0,\"Cur_Stop_Info2_StopEndNode\":0,\"Cur_Stop_Info2_StopStartNode\":0,\"Cur_Stop_Info2_Stop_Endt\":0.0,\"Cur_Stop_Info2_Stop_Endx\":0.0,\"Cur_Stop_Info2_Stop_Endy\":0.0,\"Cur_Stop_Info2_Stop_Num\":0,\"Curtis_Warning_Code_Pump\":0,\"Curtis_Warning_Code_Speed\":82,\"Curtis_Warning_Code_Steer\":0,\"EndNode\":0,\"Env_CustomName\":\"NobleLift\",\"Env_HMIUseJavaApp\":\"true\",\"Env_LearnEnable\":\"true\",\"Env_Lu_ROS_IP2\":\"\",\"Env_SoftwareVersion\":\"[Version]Magic4.1[Info]2023_09_21_20_41_37_Lu_ROS_magic4_waypointab_v31\",\"Env_VehicleType\":\"PS10LMT_HuaHai\",\"Get_Nav350_Curr_Layer\":0,\"Language\":1022739087,\"LastAltitudeExpectValue_mm\":0,\"LastGantryXExpectValue_mm\":0,\"LastGantryYExpectValue_mm\":0,\"Lateral_Deviation_m\":0.0,\"License_Info\":\"EC060800FFFBEBBF 6B7685747EBC EC060800FFFBEBBF 6B7685747EBC 2021/8/26 13:46:47 2021/8/26 13:46:47 1 UserClass5 Magic4_1\",\"LindeAgwSteerCenterPivotPlateAng\":0,\"LindeAgwSteerErrorFlag\":0,\"LindeAgwSteerModeSelectorState\":0,\"LindeAgwTracLiftErrorFlag\":0,\"LindeAgwTracLiftModeSelectorState\":0,\"LindeDriveErrCode1\":0,\"LindeDriveErrCode2\":0,\"LindeDriveErrCode3\":0,\"LindeDriveErrCode4\":0,\"LindeLiftErrCode1\":0,\"LindeLiftErrCode2\":0,\"LindeLiftErrCode3\":0,\"LindeLiftErrCode4\":0,\"LindeSteerErrCode1\":0,\"LindeSteerErrCode2\":0,\"LindeSteerErrCode3\":0,\"LindeSteerErrCode4\":0,\"Login_Info\":\"\",\"Min_Dist\":0.0,\"MissionCompleteAltitude_mm_RemoteOrHMI_FB\":0,\"MissionCompleteGantryX_mm_RemoteOrHMI_FB\":0,\"MissionCompleteGantryY_mm_RemoteOrHMI_FB\":0,\"Navi_Method\":3,\"ObstacleDetectState\":0,\"ObstacleTouchState\":0,\"Out_Of_Path_Times\":0,\"PFC_Sch\":0,\"PFC_State\":\"[PathFollow_Control_Handle_WLANJSON][PathFollow_Schedule_WLANJSON=0]\\n\",\"PLC_Warning_Code\":0,\"PWR_Percent\":100,\"PWR_Warn\":0,\"PathFollow_Enable\":0,\"PathFollow_Expect_AltitudeCtrlEnable\":0,\"PathFollow_Expect_GantryXCtrlEnable\":0,\"PathFollow_Expect_GantryYCtrlEnable\":0,\"Plate_Check_Err_Code\":0,\"ReachState\":0,\"RealAutoChargeState\":0,\"Ref_std_rt\":0.0,\"Ref_std_rx\":0.0,\"Ref_std_ry\":0.0,\"Remote_Or_HMI_Ctrl\":1,\"SVreal_angle\":0.0,\"Sche_JSON_Sche_Enable\":0,\"Speedm_Tmp\":0.0,\"StartNode\":0,\"Sub_Warning_Code0\":0,\"Sys_Mode\":4,\"Task_Sch\":0,\"Task_State\":\"\",\"Update_Sch\":0,\"Update_State\":\"\",\"VehicleCtrlExpThrottle\":0,\"VehicleCtrlRealAltitude_mm\":998,\"VehicleCtrlRealCustomStateByte0\":0,\"VehicleCtrlRealCustomStateByte1\":0,\"VehicleCtrlRealCustomStateByte2\":0,\"VehicleCtrlRealCustomStateByte3\":0,\"VehicleCtrlRealGantryX_mm\":0,\"VehicleCtrlRealGantryY_mm\":0,\"VehicleCtrlRealJoyEnable\":0,\"VehicleCtrlRealRCEnable\":0,\"VehicleCtrl_CAN_Err_Info\":0,\"Vertical_Deviation_deg\":0.0,\"Warning_Code\":754529,\"header\":{\"frame_id\":\"\",\"seq\":1904,\"stamp\":{\"nsec\":160948865,\"sec\":1695633231}}}}";
JSONObject json = JSONObject.parseObject(result1);
public Map<String,Object> queryHomePage(Map<String,String> jsonObject) {
String button_code = "";
String button_name = "";
String agvrun_status_name = "";
String automatic_status_name = "";
String device_info = "";
String task_name = "";
String task_info = "";
Integer electric = 0;
String speed = "";
String task_status = "无任务";
String error_name = "";
JSONObject returnjo = new JSONObject();
JSONObject row = new JSONObject();
try {
//String result = HttpUtil.get(urlInfo.get("javaUrl"));
//JSONObject json = JSONObject.parseObject(result);
JSONObject jo = JSONObject.parseObject(json.getString("Msg_DisplayState"));
debugInfoJson.put("Msg_Timestamp", jo.getJSONObject("header").getJSONObject("stamp").getString("sec"));
debugInfoJson.put("AGV_ID", jo.getString("AGV_ID"));
debugInfoJson.put("Sys_Mode", jo.getString("Sys_Mode"));
debugInfoJson.put("screen", jo.getString("Remote_Or_HMI_Ctrl"));
debugInfoJson.put("tcs", jo.getString("CAD_Or_TCS_Ctrl"));
debugInfoJson.put("sche", jo.getString("Sche_JSON_Sche_Enable"));
debugInfoJson.put("rc", jo.getString("VehicleCtrlRealRCEnable"));
debugInfoJson.put("joy", jo.getString("VehicleCtrlRealJoyEnable"));
debugInfoJson.put("VehicleCtrlExpThrottle", jo.getString("VehicleCtrlExpThrottle"));
debugInfoJson.put("Warning_Code", jo.getString("Warning_Code"));
debugInfoJson.put("Car_Global_rx", jo.getString("Car_Global_rx"));
debugInfoJson.put("Car_Global_ry", jo.getString("Car_Global_ry"));
debugInfoJson.put("Car_Global_Theta", jo.getString("Car_Global_Theta"));
debugInfoJson.put("Lateral_Deviation_m", jo.getString("Lateral_Deviation_m"));
debugInfoJson.put("Vertical_Deviation_deg", jo.getString("Vertical_Deviation_deg"));
debugInfoJson.put("Out_Of_Path_Times", jo.getString("Out_Of_Path_Times"));
debugInfoJson.put("PLC_Warning_Code", jo.getString("PLC_Warning_Code"));
debugInfoJson.put("Min_Dist", jo.getString("Min_Dist"));
debugInfoJson.put("Auto_In_Line_State", jo.getString("Auto_In_Line_State"));
debugInfoJson.put("PathFollow_Enable", jo.getString("PathFollow_Enable"));
debugInfoJson.put("StartNode", jo.getString("StartNode"));
debugInfoJson.put("EndNode", jo.getString("EndNode"));
debugInfoJson.put("RealAutoChargeState", jo.getString("RealAutoChargeState"));
debugInfoJson.put("PWR_Percent", jo.getString("PWR_Percent"));
debugInfoJson.put("SVreal_angle", jo.getString("SVreal_angle"));
debugInfoJson.put("Speedm_Tmp", jo.getString("Speedm_Tmp"));
debugInfoJson.put("VehicleCtrlRealAltitude_mm", jo.getString("VehicleCtrlRealAltitude_mm"));
debugInfoJson.put("ReachState", jo.getString("ReachState"));
debugInfoJson.put("ObstacleDetectState", jo.getString("ObstacleDetectState"));
debugInfoJson.put("ObstacleTouchState", jo.getString("ObstacleTouchState"));
debugInfoJson.put("PWR_Warn", jo.getString("PWR_Warn"));
debugInfoJson.put("VehicleCtrl_CAN_Err_Info", jo.getString("VehicleCtrl_CAN_Err_Info"));
debugInfoJson.put("Curtis_Warning_Code_Speed", jo.getString("Curtis_Warning_Code_Speed"));
debugInfoJson.put("Curtis_Warning_Code_Steer", jo.getString("Curtis_Warning_Code_Steer"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte0", jo.getString("VehicleCtrlRealCustomStateByte0"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte1", jo.getString("VehicleCtrlRealCustomStateByte1"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte2", jo.getString("VehicleCtrlRealCustomStateByte2"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte3", jo.getString("VehicleCtrlRealCustomStateByte3"));
debugInfoJson.put("LastAltitudeExpectValue_mm", jo.getString("LastAltitudeExpectValue_mm"));
debugInfoJson.put("Get_Nav350_Curr_Layer", jo.getString("Get_Nav350_Curr_Layer"));
debugInfoJson.put("Update_Sch", jo.getString("Update_Sch"));
debugInfoJson.put("Update_State", jo.getString("Update_State"));
debugInfoJson.put("Task_Sch", jo.getString("Task_Sch"));
debugInfoJson.put("Task_State", jo.getString("Task_State"));
debugInfoJson.put("PFC_Sch", jo.getString("PFC_Sch"));
debugInfoJson.put("PFC_State", jo.getString("PFC_State"));
debugInfoJson.put("License_Info", jo.getString("License_Info"));
debugInfoJson.put("Env_CustomName", jo.getString("Env_CustomName"));
debugInfoJson.put("Env_VehicleType", jo.getString("Env_VehicleType"));
debugInfoJson.put("Env_SoftwareVersion", jo.getString("Env_SoftwareVersion"));
debugInfoJson.put("Remote_Or_HMI_Ctrl", jo.getString("Remote_Or_HMI_Ctrl"));
debugInfoJson.put("CAD_Or_TCS_Ctrl", jo.getString("CAD_Or_TCS_Ctrl"));
debugInfoJson.put("Sche_JSON_Sche_Enable", jo.getString("Sche_JSON_Sche_Enable"));
debugInfoJson.put("VehicleCtrlRealRCEnable", jo.getString("VehicleCtrlRealRCEnable"));
debugInfoJson.put("VehicleCtrlRealJoyEnable", jo.getString("VehicleCtrlRealJoyEnable"));
String PathFollow_Enable = jo.getString("PathFollow_Enable");
if(StrUtil.equals("0", PathFollow_Enable)) {
JSONObject taskjo = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete='0'and task_status='01'").uniqueResult(0);
if(ObjectUtil.isNotEmpty(taskjo)) {
taskjo.put("task_status", "02");
taskjo.put("task_status_name", "任务完成");
taskjo.put("update_time", DateUtil.now());
WQLObject.getWQLObject("ST_TASK_INFO").update(taskjo);
CompletableFuture.runAsync(this::qeryDebuggerInfo, pool);
List<JSONObject> allTasks = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete= 0").getResultJSONArray(0).toJavaList(JSONObject.class);
// 执行中任务
Optional<JSONObject> taskingOptional = allTasks.stream().filter(task -> TaskStatusEnum.RUNNING.getCode().equals(task.getString("task_status")) && "1".equals(task.getString("task_type"))).findFirst();
//所有未执行任务的第一个任务
Optional<JSONObject> taskedOptional = allTasks.stream().filter(task -> TaskStatusEnum.CREATE.getCode().equals(task.getString("task_status")) && "1".equals(task.getString("task_type"))).min(Comparator.comparingInt(task -> task.getIntValue("seq_num")));
//需要人工介入的任务
Optional<JSONObject> unManFinishTaskOptional = allTasks.stream().filter(task -> TaskStatusEnum.END.getCode().equals(task.getString("task_status")) && "0".equals(task.getString("is_manualfinished")) && "1".equals(task.getString("task_type"))).findFirst();
if(taskingOptional.isPresent()) {
task_name = "任务号:" + taskingOptional.get().getString("task_code");
task_info = "目标点:" + taskingOptional.get().getString("next_point_code");
task_status = "执行中";
}
else if(taskedOptional.isPresent()) {
task_name = "任务号:" + taskedOptional.get().getString("task_code");
task_info = "目标点:" + taskedOptional.get().getString("next_point_code");
task_status = "有任务未执行";
}
if(unManFinishTaskOptional.isPresent() && !taskedOptional.isPresent()) {
button_code = "1";
button_name = "确认完成";
}
if(unManFinishTaskOptional.isPresent() && taskedOptional.isPresent()) {
button_code = "2";
button_name = "确认完成继续下个任务";
}
if(!unManFinishTaskOptional.isPresent() && taskedOptional.isPresent()) {
button_code = "3";
button_name = "继续搬运";
}
if(!unManFinishTaskOptional.isPresent() && !taskedOptional.isPresent()) {
button_code = "4";
button_name = "返回休息点";
//按更新时间降序
Optional<JSONObject> doingtaskjo = allTasks.stream().sorted(Comparator.comparing(o -> o.getString("update_time"), Comparator.reverseOrder())).findFirst();
if(doingtaskjo.isPresent() && "2".equals(doingtaskjo.get().getString("task_type"))) {
button_code = "";
button_name = "";
}
}
debugInfoJson.put("PathFollow_Enable", PathFollow_Enable);
Optional<JSONObject> tasking = allTasks.stream().filter(r -> TaskStatusEnum.RUNNING.getCode().equals(r.getString("task_status")) && "0".equals(r.getString("is_manualfinished"))).findFirst();
if(tasking.isPresent()) {
button_code = "";
button_name = "";
}
//查询今天待执行/今天所有任务
String task_num = determineTaskNum(allTasks);
if(debugInfoJson.size() > 0) {
//agv 运行状态获取名称
agvrun_status_name = getAgvRunStatusName(debugInfoJson.getString("PathFollow_Enable"));
// 根据自动/手动状态获取名称
automatic_status_name = getAutomaticStatusName(debugInfoJson.getString("Sys_Mode"));
speed = debugInfoJson.getString("Speedm_Tmp") == null ? "0" : debugInfoJson.getString("Speedm_Tmp");
BigDecimal e = new BigDecimal(speed).setScale(3, RoundingMode.HALF_UP);
row.put("speed", e + "m/s");
row.put("agvrun_status", debugInfoJson.getString("PathFollow_Enable"));
row.put("agvrun_status_name", agvrun_status_name);
row.put("automatic_status", debugInfoJson.getString("Sys_Mode"));
row.put("automatic_status_name", automatic_status_name);
electric = debugInfoJson.getInteger("PWR_Percent");
row.put("electric", electric);
if(electric < 30) {
button_code = "4";
button_name = "返回休息点";
}
device_info = debugInfoJson.getString("Env_CustomName") + debugInfoJson.getString("Env_VehicleType");
}
//获取错误代码
error_name = setErrorInfo();
row.put("error_name", error_name);
row.put("device_info", device_info);
row.put("task_status", task_status);
row.put("task_name", task_name);
row.put("task_info", task_info);
row.put("task_num", task_num);
row.put("button_code", button_code);
row.put("button_name", button_name);
returnjo.put("code", "1");
returnjo.put("desc", "操作成功");
returnjo.put("result", row);
return returnjo;
}
catch(Exception e) {
Log.error("通信失败:" + e.getMessage());
@@ -149,115 +175,48 @@ public class HomeServiceImpl implements HomeService{
}
}
public void QueryDebuggerInfo2() {
debugInfoJson = new JSONObject();
Ros ros = RosUtil.getRos();
Topic echoBack = new Topic(ros, "/Topic_Display_State", "lu_ps20l_msgs/Msg_DisplayState");
do {
echoBack.subscribe(new TopicCallback(){
@Override
public void handleMessage(Message message) {
JSONObject jo = JSONObject.parseObject(message.toString());
debugInfoJson.put("Msg_Timestamp", jo.getJSONObject("header").getJSONObject("stamp").getString("secs"));
debugInfoJson.put("AGV_ID", jo.getString("AGV_ID"));
debugInfoJson.put("Sys_Mode", jo.getString("Sys_Mode"));
debugInfoJson.put("VehicleCtrlExpThrottle", jo.getString("VehicleCtrlExpThrottle"));
debugInfoJson.put("Warning_Code", jo.getString("Warning_Code"));
debugInfoJson.put("Car_Global_rx", jo.getString("Car_Global_rx"));
debugInfoJson.put("Car_Global_ry", jo.getString("Car_Global_ry"));
debugInfoJson.put("Car_Global_Theta", jo.getString("Car_Global_Theta"));
debugInfoJson.put("Lateral_Deviation_m", jo.getString("Lateral_Deviation_m"));
debugInfoJson.put("Vertical_Deviation_deg", jo.getString("Vertical_Deviation_deg"));
debugInfoJson.put("Out_Of_Path_Times", jo.getString("Out_Of_Path_Times"));
debugInfoJson.put("PLC_Warning_Code", jo.getString("PLC_Warning_Code"));
debugInfoJson.put("Min_Dist", jo.getString("Min_Dist"));
debugInfoJson.put("Auto_In_Line_State", jo.getString("Auto_In_Line_State"));
debugInfoJson.put("PathFollow_Enable", jo.getString("PathFollow_Enable"));
debugInfoJson.put("StartNode", jo.getString("StartNode"));
debugInfoJson.put("EndNode", jo.getString("EndNode"));
debugInfoJson.put("RealAutoChargeState", jo.getString("RealAutoChargeState"));
debugInfoJson.put("PWR_Percent", jo.getString("PWR_Percent"));
debugInfoJson.put("SVreal_angle", jo.getString("SVreal_angle"));
debugInfoJson.put("Speedm_Tmp", jo.getString("Speedm_Tmp"));
debugInfoJson.put("VehicleCtrlRealAltitude_mm", jo.getString("VehicleCtrlRealAltitude_mm"));
debugInfoJson.put("ReachState", jo.getString("ReachState"));
debugInfoJson.put("ObstacleDetectState", jo.getString("ObstacleDetectState"));
debugInfoJson.put("ObstacleTouchState", jo.getString("ObstacleTouchState"));
debugInfoJson.put("PWR_Warn", jo.getString("PWR_Warn"));
debugInfoJson.put("VehicleCtrl_CAN_Err_Info", jo.getString("VehicleCtrl_CAN_Err_Info"));
debugInfoJson.put("Curtis_Warning_Code_Speed", jo.getString("Curtis_Warning_Code_Speed"));
debugInfoJson.put("Curtis_Warning_Code_Steer", jo.getString("Curtis_Warning_Code_Steer"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte0", jo.getString("VehicleCtrlRealCustomStateByte0"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte1", jo.getString("VehicleCtrlRealCustomStateByte1"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte2", jo.getString("VehicleCtrlRealCustomStateByte2"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte3", jo.getString("VehicleCtrlRealCustomStateByte3"));
debugInfoJson.put("LastAltitudeExpectValue_mm", jo.getString("LastAltitudeExpectValue_mm"));
debugInfoJson.put("Get_Nav350_Curr_Layer", jo.getString("Get_Nav350_Curr_Layer"));
debugInfoJson.put("Update_Sch", jo.getString("Update_Sch"));
debugInfoJson.put("Update_State", jo.getString("Update_State"));
debugInfoJson.put("Task_Sch", jo.getString("Task_Sch"));
debugInfoJson.put("Task_State", jo.getString("Task_State"));
debugInfoJson.put("PFC_Sch", jo.getString("PFC_Sch"));
debugInfoJson.put("PFC_State", jo.getString("PFC_State"));
debugInfoJson.put("License_Info", jo.getString("License_Info"));
debugInfoJson.put("Env_CustomName", jo.getString("Env_CustomName"));
debugInfoJson.put("Env_VehicleType", jo.getString("Env_VehicleType"));
debugInfoJson.put("Env_SoftwareVersion", jo.getString("Env_SoftwareVersion"));
String PathFollow_Enable = jo.getString("PathFollow_Enable");
if(StrUtil.equals("false", PathFollow_Enable)) {
JSONObject taskjo = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete='0'and task_status='01'").uniqueResult(0);
if(ObjectUtil.isNotEmpty(taskjo)) {
taskjo.put("task_status", "02");
taskjo.put("task_status_name", "任务完成");
taskjo.put("update_time", DateUtil.now());
WQLObject.getWQLObject("ST_TASK_INFO").update(taskjo);
}
}
debugInfoJson.put("PathFollow_Enable", PathFollow_Enable);
echoBack.unsubscribe();
}
});
private String setErrorInfo() {
ErrorServiceImpl errorServiceImpl = new ErrorServiceImpl();
Map error = errorServiceImpl.querryError(null);
JSONArray errorResult = JSONArray.parseArray(JSON.toJSONString(error.get("result")));
if(errorResult.size() > 0) {
return errorResult.getJSONObject(0).getString("error_name");
}
while(ObjectUtil.isEmpty(debugInfoJson));
return "正常运行";
}
@Override
public Map<String,Object> queryHead(Map<String,String> jsonObject) {
JSONObject returnjo = new JSONObject();
JSONObject result = new JSONObject();
String agvrun_status_name = "";
String automatic_status_name = "";
//车辆运行还是待机是PathFollow_Enable 1为运行 0为待机
String agvrun_status = debugInfoJson.getString("PathFollow_Enable");
if(StrUtil.equals(agvrun_status, "1")) {
automatic_status_name = "运行";
}
if(StrUtil.equals(agvrun_status, "0")) {
automatic_status_name = "待机";
}
//手自动是Sys_Mode 3 REMA手动 4自动 5 IO手持方式的手动这个车不装
String automatic_status = debugInfoJson.getString("Sys_Mode");
if(StrUtil.equals(automatic_status, "3")) {
agvrun_status_name = "手动";
}
if(StrUtil.equals(automatic_status, "4")) {
agvrun_status_name = "自动";
}
if(StrUtil.equals(automatic_status, "5")) {
agvrun_status_name = "IO手持方式的手动";
}
result.put("agvrun_status", agvrun_status);
result.put("agvrun_status_name", agvrun_status_name);
result.put("automatic_status", automatic_status);
result.put("automatic_status_name", automatic_status_name);
returnjo.put("code", "1");
returnjo.put("desc", "操作成功");
returnjo.put("result", result);
return returnjo;
private String determineTaskNum(List<JSONObject> allTasks) {
long allTasksCount = allTasks.stream().filter(task -> task.getString("date").equals(DateUtil.today())).count();
long todayUnfinishedTasksCount = allTasks.stream().filter(task -> task.getString("date").equals(DateUtil.today()) && task.getString("task_status").equals("00")).count();
return "待执行" + todayUnfinishedTasksCount + "/" + allTasksCount;
}
@Override
public Map<String,Object> queryHomePage(Map<String,String> jsonObject) {
//agv 运行状态获取名称
private String getAgvRunStatusName(String agvRunStatus) {
if(StrUtil.equals(agvRunStatus, "1")) {
return "运行";
}
else if(StrUtil.equals(agvRunStatus, "0")) {
return "待机";
}
return "";
}
// 根据自动/手动状态获取名称
private String getAutomaticStatusName(String automaticStatus) {
if(StrUtil.equals(automaticStatus, "3")) {
return "手动";
}
else if(StrUtil.equals(automaticStatus, "4")) {
return "自动";
}
else if(StrUtil.equals(automaticStatus, "5")) {
return "IO";
}
return "";
}
public Map<String,Object> queryHomePage1(Map<String,String> jsonObject) {
String button_code = "";
String button_name = "";
String agvrun_status_name = "";
@@ -276,12 +235,12 @@ public class HomeServiceImpl implements HomeService{
JSONObject tasking = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete= 0 and task_status='01' and task_type='1'").uniqueResult(0);
// 1 无任务 2 有任务未执行 3 执行中
String task_status = "";
//1确认完成 2确认完成继续下个任务 3继续搬运4返回休息点
//1确认完成 2确认完成继续下个任务3继续搬运4返回休息点
String date = DateUtil.today();
if(tasking == null) {
task_status = "无任务";
}
//JSONObject tasked = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete= 0 and task_status='00'and task_type='1' order by seq_num ").uniqueResult(0);
//JSONObject tasked = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete= 0 and task_status='00'and task_type='1'").uniqueResult(0);
JSONObject tasked = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete= 0 and task_status='00'and task_type='1' order by seq_num ").uniqueResult(0);
if(tasked != null) {
task_status = "有任务未执行";
@@ -297,10 +256,12 @@ public class HomeServiceImpl implements HomeService{
// task_info = "目标点:" + tasked.getString("next_point_code");
// }
JSONObject unManFinishTask = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete= 0 and task_status='02' and is_manualfinished='0'and task_type='1'").uniqueResult(0);
//没有未执行任务,且需要人工完成
if(unManFinishTask != null && tasked == null) {
button_code = "1";
button_name = "确认完成";
}
//存在未执行任务,且需要人工完成当前任务
if(unManFinishTask != null && tasked != null) {
button_code = "2";
button_name = "确认完成继续下个任务";
@@ -310,6 +271,7 @@ public class HomeServiceImpl implements HomeService{
button_code = "3";
button_name = "继续搬运";
}
//不存在需要人工完成的任务,且不存在未完成的任务
if(unManFinishTask == null && tasked == null) {
button_code = "4";
button_name = "返回休息点";
@@ -412,18 +374,20 @@ public class HomeServiceImpl implements HomeService{
@Override
public Map<String,Object> clickSave(Map<String,String> jsonObject) {
//1确认完成 2确认完成继续下个任务 3继续搬运4返回休息点
WQLObject taskTable = WQLObject.getWQLObject("ST_TASK_INFO");
String button_code = (String) jsonObject.get("button_code");
JSONObject returnjo = new JSONObject();
//1确认完成
if(StrUtil.equals(button_code, "1")) {
JSONObject taskjo = taskTable.query("is_delete='0' and task_status='02' and task_type ='1' and is_manualfinished='0'").uniqueResult(0);
if(ObjectUtil.isEmpty(taskjo)) {
throw new BadRequestException("未找到任务");
}
taskjo.put("is_manualfinished", "1");
taskjo.put("update_by", SecurityUtils.getCurrentNickName());
taskTable.update(taskjo);
}
// 2确认完成继续下个任务
if(StrUtil.equals(button_code, "2")) {
JSONObject taskjo = taskTable.query("is_delete='0' and task_status='02' and task_type ='1' and is_manualfinished='0'").uniqueResult(0);
if(ObjectUtil.isEmpty(taskjo)) {
@@ -432,6 +396,7 @@ public class HomeServiceImpl implements HomeService{
return returnjo;
}
taskjo.put("is_manualfinished", "1");
taskjo.put("update_by", SecurityUtils.getCurrentNickName());
taskTable.update(taskjo);
//下发下一个任务
JSONObject nexttaskjo = taskTable.query("is_delete='0' and task_status='00' and task_type ='1' ", "seq_num").uniqueResult(0);
@@ -448,6 +413,7 @@ public class HomeServiceImpl implements HomeService{
//改变任务的状态
nexttaskjo.put("task_status", "01");
nexttaskjo.put("task_status_name", "执行中");
nexttaskjo.put("update_by", SecurityUtils.getCurrentNickName());
WQLObject.getWQLObject("ST_TASK_INFO").update(nexttaskjo);
}
else{
@@ -456,6 +422,7 @@ public class HomeServiceImpl implements HomeService{
return returnjo;
}
}
//3继续搬运
if(StrUtil.equals(button_code, "3")) {
JSONObject nexttaskjo = taskTable.query("is_delete='0' and task_status='00' and task_type ='1' ", "seq_num").uniqueResult(0);
if(ObjectUtil.isEmpty(nexttaskjo)) {
@@ -470,6 +437,7 @@ public class HomeServiceImpl implements HomeService{
//改变任务的状态
nexttaskjo.put("task_status", "01");
nexttaskjo.put("task_status_name", "执行中");
nexttaskjo.put("update_by", SecurityUtils.getCurrentNickName());
WQLObject.getWQLObject("ST_TASK_INFO").update(nexttaskjo);
}
else{
@@ -478,6 +446,7 @@ public class HomeServiceImpl implements HomeService{
return returnjo;
}
}
//4返回休息点
if(StrUtil.equals(button_code, "4")) {
TaskServiceServiceImpl taskServiceServiceImpl = new TaskServiceServiceImpl();
//查询有没有正在执行的任务,假如有不能返回生成任务
@@ -497,6 +466,7 @@ public class HomeServiceImpl implements HomeService{
taskjo.put("task_type", "2");
taskjo.put("is_delete", "0");
taskjo.put("seq_num", "1");
taskjo.put("create_by", SecurityUtils.getCurrentNickName());
taskjo.put("date", DateUtil.today());
taskjo.put("create_time", DateUtil.now());
taskjo.put("is_agvfinished", "0");
@@ -509,6 +479,7 @@ public class HomeServiceImpl implements HomeService{
if(StrUtil.equals("0", resultflag)) {
//改变任务的状态
taskjo.put("task_status", "01");
taskjo.put("update_by", SecurityUtils.getCurrentNickName());
taskjo.put("task_status_name", "执行中");
}
else{
@@ -522,4 +493,205 @@ public class HomeServiceImpl implements HomeService{
returnjo.put("desc", "操作成功");
return returnjo;
}
/**
* 已合并至queryHomePage
*/
@Override
public Map<String,Object> queryHead(Map<String,String> jsonObject) {
JSONObject returnjo = new JSONObject();
JSONObject result = new JSONObject();
String agvrun_status_name = "";
String automatic_status_name = "";
//车辆运行还是待机是PathFollow_Enable 1为运行 0为待机
String agvrun_status = debugInfoJson.getString("PathFollow_Enable");
if(StrUtil.equals(agvrun_status, "1")) {
automatic_status_name = "运行";
}
if(StrUtil.equals(agvrun_status, "0")) {
automatic_status_name = "待机";
}
//手自动是Sys_Mode 3 REMA手动 4自动 5 IO手持方式的手动这个车不装
String automatic_status = debugInfoJson.getString("Sys_Mode");
if(StrUtil.equals(automatic_status, "3")) {
agvrun_status_name = "手动";
}
if(StrUtil.equals(automatic_status, "4")) {
agvrun_status_name = "自动";
}
if(StrUtil.equals(automatic_status, "5")) {
agvrun_status_name = "IO手持方式的手动";
}
result.put("agvrun_status", agvrun_status);
result.put("agvrun_status_name", agvrun_status_name);
result.put("automatic_status", automatic_status);
result.put("automatic_status_name", automatic_status_name);
returnjo.put("code", "1");
returnjo.put("desc", "操作成功");
returnjo.put("result", result);
return returnjo;
}
@Override
public void qeryDebuggerInfo() {
Map<String,String> urlInfo = RosUtil.getRosHostInfo();
//todo RosJons模拟数据用正式需改回
//String result1 = HttpUtil.get("http://localhost:8011/api/pcsIfPurchaseorder/queryApt");
//String result1 = "{\"Msg_DisplayState\":{\"AGV_ID\":255,\"Auto_In_Line_State\":0,\"Bosch_Car_Global_Theta\":-90.19221757272916,\"Bosch_Car_Global_rx\":-1.0619603784858553,\"Bosch_Car_Global_ry\":0.0020978358374357303,\"Bosch_Loc_State\":-2,\"Bosch_No_Rec_State\":0,\"Bosch_raw_age\":0.01389455795288086,\"Bosch_raw_epoch\":1,\"Bosch_raw_locState\":-2,\"Bosch_raw_qw\":0.9999999908132869,\"Bosch_raw_qx\":0.0,\"Bosch_raw_qy\":0.0,\"Bosch_raw_qz\":0.00013554861104682667,\"Bosch_raw_timestamp\":1695633231.1093392,\"Bosch_raw_uniqueId\":0,\"Bosch_raw_x\":0.0008994877773440588,\"Bosch_raw_x_odo\":0.0008994877773440588,\"Bosch_raw_y\":0.0006906610801896382,\"Bosch_raw_y_odo\":0.0006906610801896382,\"Bosch_raw_yaw\":0.00027109722292381746,\"Bosch_raw_yaw_odo\":0.0006906610801896382,\"Bosch_raw_z\":0.0,\"CAD_Or_TCS_Ctrl\":0,\"Car_Global_Theta\":-90.19221757272916,\"Car_Global_rx\":-1.0619603784858553,\"Car_Global_ry\":0.0020978358374357303,\"CurNodeID\":2,\"Cur_Stop_Info1_Authorized_Pass\":1,\"Cur_Stop_Info1_High_Precious_Enable\":1,\"Cur_Stop_Info1_Reached_Stop\":0,\"Cur_Stop_Info1_Set_Patht\":0.0,\"Cur_Stop_Info1_Set_Pathx\":0.0,\"Cur_Stop_Info1_Set_Pathy\":0.0,\"Cur_Stop_Info1_Single_Request_Sch\":0,\"Cur_Stop_Info1_Single_Stop_Sch\":0,\"Cur_Stop_Info1_StopEndNode\":0,\"Cur_Stop_Info1_StopStartNode\":0,\"Cur_Stop_Info1_Stop_Endt\":0.0,\"Cur_Stop_Info1_Stop_Endx\":0.0,\"Cur_Stop_Info1_Stop_Endy\":0.0,\"Cur_Stop_Info1_Stop_Num\":0,\"Cur_Stop_Info2_Authorized_Pass\":1,\"Cur_Stop_Info2_High_Precious_Enable\":1,\"Cur_Stop_Info2_Reached_Stop\":0,\"Cur_Stop_Info2_Set_Patht\":0.0,\"Cur_Stop_Info2_Set_Pathx\":0.0,\"Cur_Stop_Info2_Set_Pathy\":0.0,\"Cur_Stop_Info2_Single_Request_Sch\":0,\"Cur_Stop_Info2_Single_Stop_Sch\":0,\"Cur_Stop_Info2_StopEndNode\":0,\"Cur_Stop_Info2_StopStartNode\":0,\"Cur_Stop_Info2_Stop_Endt\":0.0,\"Cur_Stop_Info2_Stop_Endx\":0.0,\"Cur_Stop_Info2_Stop_Endy\":0.0,\"Cur_Stop_Info2_Stop_Num\":0,\"Curtis_Warning_Code_Pump\":0,\"Curtis_Warning_Code_Speed\":82,\"Curtis_Warning_Code_Steer\":0,\"EndNode\":0,\"Env_CustomName\":\"NobleLift\",\"Env_HMIUseJavaApp\":\"true\",\"Env_LearnEnable\":\"true\",\"Env_Lu_ROS_IP2\":\"\",\"Env_SoftwareVersion\":\"[Version]Magic4.1[Info]2023_09_21_20_41_37_Lu_ROS_magic4_waypointab_v31\",\"Env_VehicleType\":\"PS10LMT_HuaHai\",\"Get_Nav350_Curr_Layer\":0,\"Language\":1022739087,\"LastAltitudeExpectValue_mm\":0,\"LastGantryXExpectValue_mm\":0,\"LastGantryYExpectValue_mm\":0,\"Lateral_Deviation_m\":0.0,\"License_Info\":\"EC060800FFFBEBBF 6B7685747EBC EC060800FFFBEBBF 6B7685747EBC 2021/8/26 13:46:47 2021/8/26 13:46:47 1 UserClass5 Magic4_1\",\"LindeAgwSteerCenterPivotPlateAng\":0,\"LindeAgwSteerErrorFlag\":0,\"LindeAgwSteerModeSelectorState\":0,\"LindeAgwTracLiftErrorFlag\":0,\"LindeAgwTracLiftModeSelectorState\":0,\"LindeDriveErrCode1\":0,\"LindeDriveErrCode2\":0,\"LindeDriveErrCode3\":0,\"LindeDriveErrCode4\":0,\"LindeLiftErrCode1\":0,\"LindeLiftErrCode2\":0,\"LindeLiftErrCode3\":0,\"LindeLiftErrCode4\":0,\"LindeSteerErrCode1\":0,\"LindeSteerErrCode2\":0,\"LindeSteerErrCode3\":0,\"LindeSteerErrCode4\":0,\"Login_Info\":\"\",\"Min_Dist\":0.0,\"MissionCompleteAltitude_mm_RemoteOrHMI_FB\":0,\"MissionCompleteGantryX_mm_RemoteOrHMI_FB\":0,\"MissionCompleteGantryY_mm_RemoteOrHMI_FB\":0,\"Navi_Method\":3,\"ObstacleDetectState\":0,\"ObstacleTouchState\":0,\"Out_Of_Path_Times\":0,\"PFC_Sch\":0,\"PFC_State\":\"[PathFollow_Control_Handle_WLANJSON][PathFollow_Schedule_WLANJSON=0]\\n\",\"PLC_Warning_Code\":0,\"PWR_Percent\":100,\"PWR_Warn\":0,\"PathFollow_Enable\":1,\"PathFollow_Expect_AltitudeCtrlEnable\":0,\"PathFollow_Expect_GantryXCtrlEnable\":0,\"PathFollow_Expect_GantryYCtrlEnable\":0,\"Plate_Check_Err_Code\":0,\"ReachState\":0,\"RealAutoChargeState\":0,\"Ref_std_rt\":0.0,\"Ref_std_rx\":0.0,\"Ref_std_ry\":0.0,\"Remote_Or_HMI_Ctrl\":1,\"SVreal_angle\":0.0,\"Sche_JSON_Sche_Enable\":0,\"Speedm_Tmp\":0.0,\"StartNode\":0,\"Sub_Warning_Code0\":0,\"Sys_Mode\":4,\"Task_Sch\":0,\"Task_State\":\"\",\"Update_Sch\":0,\"Update_State\":\"\",\"VehicleCtrlExpThrottle\":0,\"VehicleCtrlRealAltitude_mm\":998,\"VehicleCtrlRealCustomStateByte0\":0,\"VehicleCtrlRealCustomStateByte1\":0,\"VehicleCtrlRealCustomStateByte2\":0,\"VehicleCtrlRealCustomStateByte3\":0,\"VehicleCtrlRealGantryX_mm\":0,\"VehicleCtrlRealGantryY_mm\":0,\"VehicleCtrlRealJoyEnable\":0,\"VehicleCtrlRealRCEnable\":0,\"VehicleCtrl_CAN_Err_Info\":0,\"Vertical_Deviation_deg\":0.0,\"Warning_Code\":754529,\"header\":{\"frame_id\":\"\",\"seq\":1904,\"stamp\":{\"nsec\":160948865,\"sec\":1695633231}}}}";
//JSONObject json = JSONObject.parseObject(result1);
try {
String result = HttpUtil.get(urlInfo.get("javaUrl"));
JSONObject json = JSONObject.parseObject(result);
JSONObject jo = JSONObject.parseObject(json.getString("Msg_DisplayState"));
debugInfoJson.put("Msg_Timestamp", jo.getJSONObject("header").getJSONObject("stamp").getString("sec"));
debugInfoJson.put("AGV_ID", jo.getString("AGV_ID"));
debugInfoJson.put("Sys_Mode", jo.getString("Sys_Mode"));
debugInfoJson.put("screen", jo.getString("Remote_Or_HMI_Ctrl"));
debugInfoJson.put("tcs", jo.getString("CAD_Or_TCS_Ctrl"));
debugInfoJson.put("sche", jo.getString("Sche_JSON_Sche_Enable"));
debugInfoJson.put("rc", jo.getString("VehicleCtrlRealRCEnable"));
debugInfoJson.put("joy", jo.getString("VehicleCtrlRealJoyEnable"));
debugInfoJson.put("VehicleCtrlExpThrottle", jo.getString("VehicleCtrlExpThrottle"));
debugInfoJson.put("Warning_Code", jo.getString("Warning_Code"));
debugInfoJson.put("Car_Global_rx", jo.getString("Car_Global_rx"));
debugInfoJson.put("Car_Global_ry", jo.getString("Car_Global_ry"));
debugInfoJson.put("Car_Global_Theta", jo.getString("Car_Global_Theta"));
debugInfoJson.put("Lateral_Deviation_m", jo.getString("Lateral_Deviation_m"));
debugInfoJson.put("Vertical_Deviation_deg", jo.getString("Vertical_Deviation_deg"));
debugInfoJson.put("Out_Of_Path_Times", jo.getString("Out_Of_Path_Times"));
debugInfoJson.put("PLC_Warning_Code", jo.getString("PLC_Warning_Code"));
debugInfoJson.put("Min_Dist", jo.getString("Min_Dist"));
debugInfoJson.put("Auto_In_Line_State", jo.getString("Auto_In_Line_State"));
debugInfoJson.put("PathFollow_Enable", jo.getString("PathFollow_Enable"));
debugInfoJson.put("StartNode", jo.getString("StartNode"));
debugInfoJson.put("EndNode", jo.getString("EndNode"));
debugInfoJson.put("RealAutoChargeState", jo.getString("RealAutoChargeState"));
debugInfoJson.put("PWR_Percent", jo.getString("PWR_Percent"));
debugInfoJson.put("SVreal_angle", jo.getString("SVreal_angle"));
debugInfoJson.put("Speedm_Tmp", jo.getString("Speedm_Tmp"));
debugInfoJson.put("VehicleCtrlRealAltitude_mm", jo.getString("VehicleCtrlRealAltitude_mm"));
debugInfoJson.put("ReachState", jo.getString("ReachState"));
debugInfoJson.put("ObstacleDetectState", jo.getString("ObstacleDetectState"));
debugInfoJson.put("ObstacleTouchState", jo.getString("ObstacleTouchState"));
debugInfoJson.put("PWR_Warn", jo.getString("PWR_Warn"));
debugInfoJson.put("VehicleCtrl_CAN_Err_Info", jo.getString("VehicleCtrl_CAN_Err_Info"));
debugInfoJson.put("Curtis_Warning_Code_Speed", jo.getString("Curtis_Warning_Code_Speed"));
debugInfoJson.put("Curtis_Warning_Code_Steer", jo.getString("Curtis_Warning_Code_Steer"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte0", jo.getString("VehicleCtrlRealCustomStateByte0"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte1", jo.getString("VehicleCtrlRealCustomStateByte1"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte2", jo.getString("VehicleCtrlRealCustomStateByte2"));
debugInfoJson.put("VehicleCtrlRealCustomStateByte3", jo.getString("VehicleCtrlRealCustomStateByte3"));
debugInfoJson.put("LastAltitudeExpectValue_mm", jo.getString("LastAltitudeExpectValue_mm"));
debugInfoJson.put("Get_Nav350_Curr_Layer", jo.getString("Get_Nav350_Curr_Layer"));
debugInfoJson.put("Update_Sch", jo.getString("Update_Sch"));
debugInfoJson.put("Update_State", jo.getString("Update_State"));
debugInfoJson.put("Task_Sch", jo.getString("Task_Sch"));
debugInfoJson.put("Task_State", jo.getString("Task_State"));
debugInfoJson.put("PFC_Sch", jo.getString("PFC_Sch"));
debugInfoJson.put("PFC_State", jo.getString("PFC_State"));
debugInfoJson.put("License_Info", jo.getString("License_Info"));
debugInfoJson.put("Env_CustomName", jo.getString("Env_CustomName"));
debugInfoJson.put("Env_VehicleType", jo.getString("Env_VehicleType"));
debugInfoJson.put("Env_SoftwareVersion", jo.getString("Env_SoftwareVersion"));
debugInfoJson.put("Remote_Or_HMI_Ctrl", jo.getString("Remote_Or_HMI_Ctrl"));
debugInfoJson.put("CAD_Or_TCS_Ctrl", jo.getString("CAD_Or_TCS_Ctrl"));
debugInfoJson.put("Sche_JSON_Sche_Enable", jo.getString("Sche_JSON_Sche_Enable"));
debugInfoJson.put("VehicleCtrlRealRCEnable", jo.getString("VehicleCtrlRealRCEnable"));
debugInfoJson.put("VehicleCtrlRealJoyEnable", jo.getString("VehicleCtrlRealJoyEnable"));
//小车当前点位,未到为起点,到达为终点
debugInfoJson.put("CurNodeID", jo.getString("CurNodeID"));
String PathFollow_Enable = jo.getString("PathFollow_Enable");
String curNodeId = jo.getString("CurNodeID");
if(StrUtil.equals("0", PathFollow_Enable)) {
JSONObject taskjo = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete='0'and task_status='01'").uniqueResult(0);
if(ObjectUtil.isNotEmpty(taskjo)) {
//小车停止,且已到达目标点位
if(curNodeId.equals(taskjo.getString("next_point_code"))) {
taskjo.put("task_status", TaskStatusEnum.END.getCode());
taskjo.put("task_status_name", "任务完成");
taskjo.put("update_time", DateUtil.now());
taskjo.put("update_by", SecurityUtils.getCurrentNickName());
WQLObject.getWQLObject("ST_TASK_INFO").update(taskjo);
}
}
}
debugInfoJson.put("PathFollow_Enable", PathFollow_Enable);
}
catch(Exception e) {
Log.error("通信失败:" + e.getMessage());
throw new BadRequestException(e.getMessage() == null ? "通信失败请检查系统参数中的Ros连接信息" : e.getMessage());
}
}
// public void QueryDebuggerInfo2() {
// debugInfoJson = new JSONObject();
// Ros ros = RosUtil.getRos();
// Topic echoBack = new Topic(ros, "/Topic_Display_State", "lu_ps20l_msgs/Msg_DisplayState");
// do {
// echoBack.subscribe(new TopicCallback(){
// @Override
// public void handleMessage(Message message) {
// JSONObject jo = JSONObject.parseObject(message.toString());
// debugInfoJson.put("Msg_Timestamp", jo.getJSONObject("header").getJSONObject("stamp").getString("secs"));
// debugInfoJson.put("AGV_ID", jo.getString("AGV_ID"));
// debugInfoJson.put("Sys_Mode", jo.getString("Sys_Mode"));
// debugInfoJson.put("VehicleCtrlExpThrottle", jo.getString("VehicleCtrlExpThrottle"));
// debugInfoJson.put("Warning_Code", jo.getString("Warning_Code"));
// debugInfoJson.put("Car_Global_rx", jo.getString("Car_Global_rx"));
// debugInfoJson.put("Car_Global_ry", jo.getString("Car_Global_ry"));
// debugInfoJson.put("Car_Global_Theta", jo.getString("Car_Global_Theta"));
// debugInfoJson.put("Lateral_Deviation_m", jo.getString("Lateral_Deviation_m"));
// debugInfoJson.put("Vertical_Deviation_deg", jo.getString("Vertical_Deviation_deg"));
// debugInfoJson.put("Out_Of_Path_Times", jo.getString("Out_Of_Path_Times"));
// debugInfoJson.put("PLC_Warning_Code", jo.getString("PLC_Warning_Code"));
// debugInfoJson.put("Min_Dist", jo.getString("Min_Dist"));
// debugInfoJson.put("Auto_In_Line_State", jo.getString("Auto_In_Line_State"));
// debugInfoJson.put("PathFollow_Enable", jo.getString("PathFollow_Enable"));
// debugInfoJson.put("StartNode", jo.getString("StartNode"));
// debugInfoJson.put("EndNode", jo.getString("EndNode"));
// debugInfoJson.put("RealAutoChargeState", jo.getString("RealAutoChargeState"));
// debugInfoJson.put("PWR_Percent", jo.getString("PWR_Percent"));
// debugInfoJson.put("SVreal_angle", jo.getString("SVreal_angle"));
// debugInfoJson.put("Speedm_Tmp", jo.getString("Speedm_Tmp"));
// debugInfoJson.put("VehicleCtrlRealAltitude_mm", jo.getString("VehicleCtrlRealAltitude_mm"));
// debugInfoJson.put("ReachState", jo.getString("ReachState"));
// debugInfoJson.put("ObstacleDetectState", jo.getString("ObstacleDetectState"));
// debugInfoJson.put("ObstacleTouchState", jo.getString("ObstacleTouchState"));
// debugInfoJson.put("PWR_Warn", jo.getString("PWR_Warn"));
// debugInfoJson.put("VehicleCtrl_CAN_Err_Info", jo.getString("VehicleCtrl_CAN_Err_Info"));
// debugInfoJson.put("Curtis_Warning_Code_Speed", jo.getString("Curtis_Warning_Code_Speed"));
// debugInfoJson.put("Curtis_Warning_Code_Steer", jo.getString("Curtis_Warning_Code_Steer"));
// debugInfoJson.put("VehicleCtrlRealCustomStateByte0", jo.getString("VehicleCtrlRealCustomStateByte0"));
// debugInfoJson.put("VehicleCtrlRealCustomStateByte1", jo.getString("VehicleCtrlRealCustomStateByte1"));
// debugInfoJson.put("VehicleCtrlRealCustomStateByte2", jo.getString("VehicleCtrlRealCustomStateByte2"));
// debugInfoJson.put("VehicleCtrlRealCustomStateByte3", jo.getString("VehicleCtrlRealCustomStateByte3"));
// debugInfoJson.put("LastAltitudeExpectValue_mm", jo.getString("LastAltitudeExpectValue_mm"));
// debugInfoJson.put("Get_Nav350_Curr_Layer", jo.getString("Get_Nav350_Curr_Layer"));
// debugInfoJson.put("Update_Sch", jo.getString("Update_Sch"));
// debugInfoJson.put("Update_State", jo.getString("Update_State"));
// debugInfoJson.put("Task_Sch", jo.getString("Task_Sch"));
// debugInfoJson.put("Task_State", jo.getString("Task_State"));
// debugInfoJson.put("PFC_Sch", jo.getString("PFC_Sch"));
// debugInfoJson.put("PFC_State", jo.getString("PFC_State"));
// debugInfoJson.put("License_Info", jo.getString("License_Info"));
// debugInfoJson.put("Env_CustomName", jo.getString("Env_CustomName"));
// debugInfoJson.put("Env_VehicleType", jo.getString("Env_VehicleType"));
// debugInfoJson.put("Env_SoftwareVersion", jo.getString("Env_SoftwareVersion"));
// String PathFollow_Enable = jo.getString("PathFollow_Enable");
// if(StrUtil.equals("false", PathFollow_Enable)) {
// JSONObject taskjo = WQLObject.getWQLObject("ST_TASK_INFO").query("is_delete='0'and task_status='01'").uniqueResult(0);
// if(ObjectUtil.isNotEmpty(taskjo)) {
// taskjo.put("task_status", "02");
// taskjo.put("task_status_name", "任务完成");
// taskjo.put("update_time", DateUtil.now());
// WQLObject.getWQLObject("ST_TASK_INFO").update(taskjo);
// }
// }
// debugInfoJson.put("PathFollow_Enable", PathFollow_Enable);
// echoBack.unsubscribe();
// }
// });
// }
// while(ObjectUtil.isEmpty(debugInfoJson));
// }
}

View File

@@ -33,6 +33,7 @@ import com.alibaba.fastjson.JSONObject;
import org.nl.agv.service.DevelopService;
import org.nl.agv.service.TaskService;
import org.nl.agv.unit.sendToAgvUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.WQL;
@@ -139,6 +140,7 @@ public class TaskServiceServiceImpl implements TaskService{
taskjo.put("create_time", DateUtil.now());
taskjo.put("is_agvfinished", "0");
taskjo.put("is_manualfinished", "0");
taskjo.put("create_by", SecurityUtils.getCurrentNickName());
WQLObject.getWQLObject("ST_TASK_INFO").insert(taskjo);
returnjo.put("code", "1");
returnjo.put("desc", "新增成功!");
@@ -164,6 +166,7 @@ public class TaskServiceServiceImpl implements TaskService{
WQLObject taskTable = WQLObject.getWQLObject("ST_TASK_INFO");
JSONObject taskjo = taskTable.query("task_code='" + task_num + "'").uniqueResult(0);
taskjo.put("is_delete", "1");
taskjo.put("update_by", SecurityUtils.getCurrentNickName());
taskTable.update(taskjo);
JSONObject returnjo = new JSONObject();
returnjo.put("code", "1");
@@ -188,6 +191,7 @@ public class TaskServiceServiceImpl implements TaskService{
JSONObject taskrow = taskTable.query("task_code='" + taskNum + "'").uniqueResult(0);
taskrow.put("seq_num", i + 1);
taskrow.put("is_delete", "0");
taskrow.put("update_by", SecurityUtils.getCurrentNickName());
taskTable.update(taskrow);
}
JSONObject returnjo = new JSONObject();

View File

@@ -1,60 +1,78 @@
server:
port: 8018
#配置数据源
##配置数据源
spring:
datasource:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#url: jdbc:log4jdbc:mysql://${DB_HOST:43.139.166.161}:${DB_PORT:3310}/${DB_NAME:nl_agv}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
url: jdbc:log4jdbc:mysql://${DB_HOST:43.139.166.161}:${DB_PORT:3310}/${DB_NAME:nl_agv}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
#url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
username: ${DB_USER:root}
#password: ${DB_PWD:P@ssw0rd}
password: ${DB_PWD:123456789}
#password: ${DB_PWD:Root.123456}
# 初始连接数
initial-size: 5
# 最小连接数
min-idle: 15
# 最大连接数
max-active: 30
# 是否自动回收超时连接
remove-abandoned: true
# 超时时间(以秒数为单位)
remove-abandoned-timeout: 180
# 获取连接超时时间
max-wait: 3000
# 连接有效性检测时间
time-between-eviction-runs-millis: 60000
# 连接在池中最小生存的时间
min-evictable-idle-time-millis: 300000
# 连接在池中最大生存的时间
max-evictable-idle-time-millis: 900000
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
test-while-idle: true
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
test-on-borrow: true
# 是否在归还到池中前进行检验
test-on-return: false
# 检测连接是否有效
validation-query: select 1
# 配置监控统计
webStatFilter:
enabled: true
stat-view-servlet:
enabled: true
url-pattern: /druid/*
reset-enable: false
filters:
DruidFilter,stat
#url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:nl_apt}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
#nl_agv 192.168.137.41 nl_apt
#url: jdbc:mysql://${DB_HOST:192.168.137.41}:${DB_PORT:3306}/${DB_NAME:nl_agv}
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:nl_agv}
#username: ${DB_USER:root}
username: ${DB_USER:generallu}
#password: ${DB_PWD:123456789}
password: ${DB_PWD:123456}
driver-class-name: com.mysql.cj.jdbc.Driver # 指定 MySQL 驱动
hikari:
pool-name: ConnectionPoolName # 连接池的名称
maximum-pool-size: 90 # 连接池的最大连接数
minimum-idle: 2 # 连接池的最小空闲连接数
connection-timeout: 30000 # 连接超时时间(单位:毫秒)
connection-test-query: SELECT 1 # 连接测试查询,用于保持连接的活性
connection-init-sql: SET NAMES utf8mb4 # 初始化 SQL用于设置连接字符集
#spring:
# datasource:
# druid:
# db-type: com.alibaba.druid.pool.DruidDataSource
# driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# #192.168.137.41
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.137.41}:${DB_PORT:3306}/${DB_NAME:nl_agv}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
# #url: jdbc:log4jdbc:mysql://${DB_HOST:43.139.166.161}:${DB_PORT:3310}/${DB_NAME:nl_agv}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
# #url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
# username: ${DB_USER:generallu}
# #password: ${DB_PWD:P@ssw0rd}
# password: ${DB_PWD:123456}
# #password: ${DB_PWD:Root.123456}
# # 初始连接数
# initial-size: 15
# # 最小连接数
# min-idle: 45
# # 最大连接数
# max-active: 90
# # 是否自动回收超时连接
# remove-abandoned: true
# # 超时时间(以秒数为单位)
# remove-abandoned-timeout: 180
# # 获取连接超时时间
# max-wait: 3000
# # 连接有效性检测时间
# time-between-eviction-runs-millis: 60000
# # 连接在池中最小生存的时间
# min-evictable-idle-time-millis: 300000
# # 连接在池中最大生存的时间
# max-evictable-idle-time-millis: 900000
# # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
# test-while-idle: true
# # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
# test-on-borrow: true
# # 是否在归还到池中前进行检验
# test-on-return: false
# # 检测连接是否有效
# validation-query: select 1
# # 配置监控统计
# webStatFilter:
# enabled: true
# stat-view-servlet:
# enabled: true
# url-pattern: /druid/*
# reset-enable: false
# filters:
# DruidFilter,stat
redis:
#数据库索引
database: ${REDIS_DB:1}
#host: ${REDIS_HOST:127.0.0.1}
host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6319}
database: ${REDIS_DB:6}
host: ${REDIS_HOST:127.0.0.1}
#host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
#连接超时时间
timeout: 5000
@@ -157,30 +175,29 @@ sa-token:
cookie:
# 配置 Cookie 作用域:根据二级域名实现sso登入如lms.sso.com;acs.sso.com
domain:
is-read-cookie: false
#jetcache:
# defaultCacheType: LOCAL
# statIntervalMinutes: 15
# areaInCacheName: false
# hiddenPackages: com.yb
# local:
# default:
# type: caffeine
# limit: 100
# keyConvertor: fastjson
# expireAfterWriteInMillis: 60000
# remote:
# default:
# type: redis.lettuce
# keyConvertor: fastjson
# valueEncoder: kryo
# valueDecoder: kryo
# poolConfig:
# minIdle: 5
# maxIdle: 200
# maxTotal: 1000
# uri:
# - redis://127.0.0.1:6379
jetcache:
defaultCacheType: LOCAL
statIntervalMinutes: 15
areaInCacheName: false
hiddenPackages: com.yb
local:
default:
type: caffeine
limit: 100
keyConvertor: fastjson
expireAfterWriteInMillis: 60000
remote:
default:
type: redis.lettuce
keyConvertor: fastjson
valueEncoder: kryo
valueDecoder: kryo
poolConfig:
minIdle: 5
maxIdle: 200
maxTotal: 1000
uri:
- redis://127.0.0.1:6379
es:
index: mes_log

View File

@@ -1,53 +1,72 @@
server:
port: 8018
#配置数据源
##配置数据源
spring:
datasource:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:nl_agv}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
#url: jdbc:log4jdbc:mysql://${DB_HOST:43.139.166.161}:${DB_PORT:3310}/${DB_NAME:nl_agv}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
#url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
username: ${DB_USER:generallu}
#password: ${DB_PWD:P@ssw0rd}
password: ${DB_PWD:123456}
#password: ${DB_PWD:Root.123456}
# 初始连接数
initial-size: 15
# 最小连接数
min-idle: 45
# 最大连接数
max-active: 90
# 是否自动回收超时连接
remove-abandoned: true
# 超时时间(以秒数为单位)
remove-abandoned-timeout: 180
# 获取连接超时时间
max-wait: 3000
# 连接有效性检测时间
time-between-eviction-runs-millis: 60000
# 连接在池中最小生存的时间
min-evictable-idle-time-millis: 300000
# 连接在池中最大生存的时间
max-evictable-idle-time-millis: 900000
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
test-while-idle: true
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
test-on-borrow: true
# 是否在归还到池中前进行检验
test-on-return: false
# 检测连接是否有效
validation-query: select 1
# 配置监控统计
webStatFilter:
enabled: true
stat-view-servlet:
enabled: true
url-pattern: /druid/*
reset-enable: false
filters:
DruidFilter,stat
#url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:nl_apt}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
#nl_agv 192.168.137.41 nl_apt
#url: jdbc:mysql://${DB_HOST:192.168.137.41}:${DB_PORT:3306}/${DB_NAME:nl_agv}
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:nl_agv}
#username: ${DB_USER:root}
username: ${DB_USER:generallu}
#password: ${DB_PWD:123456789}
password: ${DB_PWD:123456}
driver-class-name: com.mysql.cj.jdbc.Driver # 指定 MySQL 驱动
hikari:
pool-name: ConnectionPoolName # 连接池的名称
maximum-pool-size: 90 # 连接池的最大连接数
minimum-idle: 2 # 连接池的最小空闲连接数
connection-timeout: 30000 # 连接超时时间(单位:毫秒)
connection-test-query: SELECT 1 # 连接测试查询,用于保持连接的活性
connection-init-sql: SET NAMES utf8mb4 # 初始化 SQL用于设置连接字符集
#spring:
# datasource:
# druid:
# db-type: com.alibaba.druid.pool.DruidDataSource
# driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# #192.168.137.41
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.137.41}:${DB_PORT:3306}/${DB_NAME:nl_agv}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
# #url: jdbc:log4jdbc:mysql://${DB_HOST:43.139.166.161}:${DB_PORT:3310}/${DB_NAME:nl_agv}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
# #url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
# username: ${DB_USER:generallu}
# #password: ${DB_PWD:P@ssw0rd}
# password: ${DB_PWD:123456}
# #password: ${DB_PWD:Root.123456}
# # 初始连接数
# initial-size: 15
# # 最小连接数
# min-idle: 45
# # 最大连接数
# max-active: 90
# # 是否自动回收超时连接
# remove-abandoned: true
# # 超时时间(以秒数为单位)
# remove-abandoned-timeout: 180
# # 获取连接超时时间
# max-wait: 3000
# # 连接有效性检测时间
# time-between-eviction-runs-millis: 60000
# # 连接在池中最小生存的时间
# min-evictable-idle-time-millis: 300000
# # 连接在池中最大生存的时间
# max-evictable-idle-time-millis: 900000
# # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
# test-while-idle: true
# # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
# test-on-borrow: true
# # 是否在归还到池中前进行检验
# test-on-return: false
# # 检测连接是否有效
# validation-query: select 1
# # 配置监控统计
# webStatFilter:
# enabled: true
# stat-view-servlet:
# enabled: true
# url-pattern: /druid/*
# reset-enable: false
# filters:
# DruidFilter,stat
redis:
#数据库索引
database: ${REDIS_DB:6}

View File

@@ -28,6 +28,8 @@ task:
keep-alive-seconds: 60
# 队列容量
queue-capacity: 50
# 主线程等待子线程执行时间
awaitTerminationSeconds: 50
#七牛云
qiniu: