@@ -15,6 +15,7 @@
*/
package org.nl.agv.service.impl ;
import cn.hutool.core.date.StopWatch ;
import com.alibaba.fastjson.JSON ;
import com.alibaba.fastjson.JSONArray ;
import cn.hutool.core.date.DateUtil ;
@@ -22,6 +23,7 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil ;
import cn.hutool.core.util.StrUtil ;
import cn.hutool.http.HttpUtil ;
import com.mchange.lang.LongUtils ;
import edu.wpi.rail.jrosbridge.services.ServiceResponse ;
import lombok.RequiredArgsConstructor ;
import com.alibaba.fastjson.JSONObject ;
@@ -32,23 +34,28 @@ import org.nl.agv.enu.*;
import org.nl.agv.service.HomeService ;
import org.nl.agv.unit.RosUtil ;
import org.nl.agv.unit.sendToAgvUtil ;
import org.nl.agv.websocket.SendHomeWebSocketServer ;
import org.nl.common.utils.LangUtils ;
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 ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Qualifier ;
import org.springframework.beans.factory.annotation.Value ;
import org.springframework.scheduling.TaskScheduler ;
import org.springframework.scheduling.annotation.Async ;
import org.springframework.scheduling.annotation.Scheduled ;
import org.springframework.stereotype.Service ;
import org.springframework.transaction.annotation.Transactional ;
import javax.annotation.PostConstruct ;
import javax.annotation.Resource ;
import java.math.BigDecimal ;
import java.math.RoundingMode ;
import java.util.* ;
import java.util.concurrent.CompletableFuture ;
import java.util.concurrent.CopyOnWriteArraySet ;
import java.util.concurrent.ThreadPoolExecutor ;
import static org.nl.common.utils.LangUtils.getLanguage ;
@@ -61,19 +68,38 @@ import static org.nl.common.utils.LangUtils.getLanguage;
@Service
@RequiredArgsConstructor
public class HomeServiceImpl implements HomeService {
@Resource
private TaskScheduler scheduler ;
@Resource
@Qualifier ( " threadPool " )
private ThreadPoolExecutor pool ;
@Value ( " ${spring.profiles.active} " )
private String isProd ;
@Value ( " ${timer.syncAgvInfo} " )
private long syncAgvInfo ;
@Value ( " ${timer.sendHomeInfo} " )
private long sendHomeInfo ;
@Value ( " ${timer.handleTask} " )
private long handleTask ;
@Value ( " ${timer.deleteTask} " )
private long deleteTask ;
//定时器查询调试信息, 放入json其他地方直接调用;
public static JSONObject debugInfoJson = new JSONObject ( ) ;
//特定场景调试信息, 放入json其他地方直接调用;
public static JSONObject debugInfoJsonQuick = new JSONObject ( ) ;
public HomeServiceImpl ( ThreadPoolExecutor pool ) {
this . pool = pool ;
}
@Value ( " ${spring.profiles.active} " )
private String isProd ;
/**
* 优化获取主页及状态栏信息
@@ -94,14 +120,14 @@ public class HomeServiceImpl implements HomeService {
// }
// }, pool);
//执行任务操作
CompletableFuture. runAsync( ( ) - > {
try {
handleTaskStatus( ) ;
} catch ( Exception e ) {
//记录异常日志
log . error ( " queryHomePage-执行任务操作失败:{}" , e . getMessage ( ) ) ;
}
} , pool ) ;
// CompletableFuture. runAsync(() -> {
// try {
// handleTaskStatus() ;
// } catch (Exception e) {
// //记录异常日志
// log.error(" queryHomePage-执行任务操作失败:{}", e.getMessage()) ;
// }
// }, 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 " ) ) & & ! TaskTypeEnum . REST . getCode ( ) . equals ( task . getString ( " task_type " ) ) ) . findFirst ( ) ;
@@ -266,7 +292,6 @@ public class HomeServiceImpl implements HomeService {
@Override
public Map < String , Object > clickSave ( Map < String , String > jsonObject ) {
try {
WQLObject taskTable = WQLObject . getWQLObject ( " ST_TASK_INFO " ) ;
String button_code = jsonObject . get ( " button_code " ) ;
@@ -407,6 +432,7 @@ public class HomeServiceImpl implements HomeService {
}
/**
* 全局显示状态
*/
@@ -421,14 +447,15 @@ public class HomeServiceImpl implements HomeService {
String en_automatic_status_name = " " ;
String zh_automatic_status_name = " " ;
String electric = " 50 " ;
CompletableFuture. runAsync( ( ) - > {
try {
handleTaskStatus( ) ;
} catch ( Exception e ) {
e . printStackTrace( ) ;
//记录异常日志
}
} , pool ) ;
// CompletableFuture. runAsync(() -> {
// try {
// handleTaskStatus() ;
// } catch (Exception e) {
// e. printStackTrace() ;
// //记录异常日志
// }
// }, pool) ;
//qeryDebuggerInfo();
electric = debugInfoJson . getString ( " PWR_Percent " ) ;
//车辆运行还是待机是PathFollow_Enable 1为运行 0为待机
if ( StrUtil . equals ( debugInfoJson . getString ( " PathFollow_Enable " ) , " 1 " ) ) {
@@ -474,7 +501,7 @@ public class HomeServiceImpl implements HomeService {
if ( " prod " . equals ( isProd ) ) {
result = HttpUtil . get ( urlInfo . get ( " javaUrl " ) ) ;
} else {
result = " { \" 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 \" :11, \" 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 \" :2 9, \" 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 \" :1, \" Speedm_Tmp \" :0.0, \" StartNode \" :0, \" Sub_Warning_Code0 \" :0, \" Sys_Mode \" :4, \" Task_Sch \" :0, \" Task_State \" : \" \" , \" Update_Sch \" :1, \" 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}}}} " ;
result = " { \" 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 \" :11, \" 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\" , \" 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 \" :9 9, \" 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 \" :1, \" Speedm_Tmp \" :0.0, \" StartNode \" :0, \" Sub_Warning_Code0 \" :0, \" Sys_Mode \" :4, \" Task_Sch \" :0, \" Task_State \" : \" \" , \" Update_Sch \" :1, \" 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}}}} " ;
}
//String result = HttpUtil.get(urlInfo.get("javaUrl"));
JSONObject json = JSONObject . parseObject ( result ) ;
@@ -545,7 +572,7 @@ public class HomeServiceImpl implements HomeService {
if ( " prod " . equals ( isProd ) ) {
result = HttpUtil . get ( urlInfo . get ( " javaUrl " ) ) ;
} else {
result = " { \" 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 \" :11, \" 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 \" :2 9, \" 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 \" :1, \" 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}}}} " ;
result = " { \" 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 \" :11, \" 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\" , \" 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 \" :9 9, \" 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 \" :1, \" 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}}}} " ;
}
// String result = HttpUtil.get(urlInfo.get("javaUrl"));
JSONObject json = JSONObject . parseObject ( result ) ;
@@ -555,65 +582,6 @@ public class HomeServiceImpl implements HomeService {
}
@Transactional ( rollbackFor = Exception . class )
public void handleTaskStatus ( ) {
JSONObject taskjo = WQLObject . getWQLObject ( " ST_TASK_INFO " ) . query ( " is_delete='0'and task_status='01' " ) . uniqueResult ( 0 ) ;
qeryDebuggerInfo ( ) ;
//叉腿高度
String legHeight ;
//小车停止,且已到达目标点位
if ( ObjectUtil . isNotEmpty ( taskjo ) & & StrUtil . equals ( " 0 " , debugInfoJson . getString ( " PathFollow_Enable " ) ) & & debugInfoJson . getString ( " CurNodeID " ) . equals ( taskjo . getString ( " next_point_code " ) ) ) {
//普通任务
if ( TaskTypeEnum . COMMON . getCode ( ) . equals ( taskjo . getString ( " task_type " ) ) ) {
updateTaskStatus ( taskjo , TaskStatusEnum . END ) ;
} else if ( TaskTypeEnum . TAKE . getCode ( ) . equals ( taskjo . getString ( " task_type " ) ) | | TaskTypeEnum . PUT . getCode ( ) . equals ( taskjo . getString ( " task_type " ) ) ) {
//取货
if ( TaskTypeEnum . TAKE . getCode ( ) . equals ( taskjo . getString ( " task_type " ) ) ) {
//已到达目标点
if ( StringUtils . isBlank ( taskjo . getString ( " step " ) ) ) {
//取货
ServiceResponse send = sendToAgvUtil . send ( " HMIStepOrRTPathFollow:0;2;0# " ) ;
JSONObject resjo = JSONObject . parseObject ( send . toString ( ) ) ;
String resultflag = resjo . getString ( " result " ) ;
if ( StrUtil . equals ( " 0 " , resultflag ) ) {
//叉腿已抬升
taskjo . put ( " step " , " 0 " ) ;
updateTaskStatus ( taskjo , null ) ;
} else {
log . error ( " handleTaskStatus-叉抬升失败:{} " , TaskSendBackStatusEnum . getName ( resultflag ) ) ;
}
}
qeryDebuggerInfoQuick ( ) ;
//叉腿高度
legHeight = debugInfoJsonQuick . getString ( " MissionCompleteAltitude_mm_RemoteOrHMI_FB " ) = = null ? " 0 " : debugInfoJsonQuick . getString ( " MissionCompleteAltitude_mm_RemoteOrHMI_FB " ) ;
//叉腿抬高动作已下发, 且高度为10或20且待机, 发送返程任务
if ( ( ( Integer . parseInt ( legHeight ) = = 20 ) ) & & StrUtil . equals ( " 0 " , debugInfoJsonQuick . getString ( " PathFollow_Enable " ) ) & & " 0 " . equals ( taskjo . getString ( " step " ) ) ) {
createReturnTask ( taskjo ) ;
}
} else {
if ( StringUtils . isBlank ( taskjo . getString ( " step " ) ) ) {
//放货
ServiceResponse send = sendToAgvUtil . send ( " HMIStepOrRTPathFollow:0;1;0# " ) ;
JSONObject resjo = JSONObject . parseObject ( send . toString ( ) ) ;
String resultflag = resjo . getString ( " result " ) ;
if ( StrUtil . equals ( " 0 " , resultflag ) ) {
//叉腿已下降
taskjo . put ( " step " , " 0 " ) ;
updateTaskStatus ( taskjo , null ) ;
} else {
log . error ( " handleTaskStatus-叉腿下降失败:{} " , TaskSendBackStatusEnum . getName ( resultflag ) ) ;
}
}
qeryDebuggerInfoQuick ( ) ;
legHeight = debugInfoJsonQuick . getString ( " MissionCompleteAltitude_mm_RemoteOrHMI_FB " ) = = null ? " 0 " : debugInfoJsonQuick . getString ( " MissionCompleteAltitude_mm_RemoteOrHMI_FB " ) ;
//叉腿抬高动作已下发, 且高度为10或20且待机, 发送返程任务
if ( ( ( Integer . parseInt ( legHeight ) = = 10 ) ) & & StrUtil . equals ( " 0 " , debugInfoJsonQuick . getString ( " PathFollow_Enable " ) ) & & " 0 " . equals ( taskjo . getString ( " step " ) ) ) {
createReturnTask ( taskjo ) ;
}
}
}
}
}
private void createReturnTask ( JSONObject taskjo ) {
String a = " HMIStepOrRTPathFollow:0; " + taskjo . getString ( " next_point_code2 " ) + " ;1# " ;
@@ -626,7 +594,7 @@ public class HomeServiceImpl implements HomeService {
taskjo . put ( " is_manualfinished " , " 1 " ) ;
updateTaskStatus ( taskjo , TaskStatusEnum . END ) ;
} else {
log . error ( " handleTaskStatus-createReturnTask-返程指令执行失败:{} " , TaskSendBackStatusEnum . getName ( resultflag ) ) ;
log . error ( " handleTaskStatus-createReturnTask-返程指令执行失败:{} " , TaskSendBackStatusEnum . getName ( resultflag ) ) ;
}
}
@@ -663,20 +631,134 @@ public class HomeServiceImpl implements HomeService {
}
}
@PostConstruct
public void scheduleTask ( ) {
scheduler . scheduleAtFixedRate ( this : : sendHomeInfoTask , sendHomeInfo ) ;
scheduler . scheduleAtFixedRate ( this : : queryAgvInfo , syncAgvInfo ) ;
scheduler . scheduleAtFixedRate ( this : : handleTaskStatusTask , handleTask ) ;
scheduler . scheduleAtFixedRate ( this : : autoDeleteTask , deleteTask ) ;
}
/**
* 处理任务状态
* 首页及头部信息推送
*/
@Async ( " taskExecutor " )
@Scheduled ( cron = " 0/10 * * * * * " )
@Transactional ( rollbackFor = Exception . class )
public void handleTaskStatuss ( ) {
public void sendHomeInfoTask ( ) {
//StopWatch stopWatch = new StopWatch();
//stopWatch.start();
//handleTaskStatus();
CopyOnWriteArraySet < SendHomeWebSocketServer > webSocketSet =
SendHomeWebSocketServer . getWebSocketSet ( ) ;
if ( webSocketSet . size ( ) > 0 ) {
webSocketSet . forEach ( c - > {
Map < String , Object > homeInfoMap = new HashMap < > ( ) ;
homeInfoMap . put ( " head " , this . queryHead ( ) ) ;
homeInfoMap . put ( " home " , this . queryHomePage ( null ) ) ;
c . sendDataToClient ( homeInfoMap ) ;
} ) ;
}
//stopWatch.stop();
//System.out.println("花费时间------------------------------------------------------------------------------------------********************************* ****************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
//System.out.println("1task-首页及头部信息推送-sendHomeInfoTask- 花费时间----------------------------------------------------------------****************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
}
/**
* 查询小车状态
*/
@Async ( " taskExecutor " )
public void queryAgvInfo ( ) {
//StopWatch stopWatch = new StopWatch();
//stopWatch.start();
qeryDebuggerInfo ( ) ;
//stopWatch.stop();
//System.out.println("2task-查询agv信息-queryAgvInfo-花费时间----------------------------------------------------------------****************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
}
/**
* 处理自动取放货状态
*/
@Async ( " taskExecutor " )
@Transactional ( rollbackFor = Exception . class )
public void handleTaskStatusTask ( ) {
//更新小车状态参数
//qeryDebuggerInfo();
//叉腿高度
String legHeight ;
//StopWatch stopWatch = new StopWatch();
//stopWatch.start();
JSONObject taskjo = WQLObject . getWQLObject ( " ST_TASK_INFO " ) . query ( " is_delete='0'and task_status='01' " ) . uniqueResult ( 0 ) ;
//小车停止,且已到达目标点位
if ( ObjectUtil . isNotEmpty ( taskjo ) & & StrUtil . equals ( " 0 " , debugInfoJson . getString ( " PathFollow_Enable " ) ) & & debugInfoJson . getString ( " CurNodeID " ) . equals ( taskjo . getString ( " next_point_code " ) ) ) {
//普通任务
if ( TaskTypeEnum . COMMON . getCode ( ) . equals ( taskjo . getString ( " task_type " ) ) ) {
updateTaskStatus ( taskjo , TaskStatusEnum . END ) ;
} else if ( TaskTypeEnum . TAKE . getCode ( ) . equals ( taskjo . getString ( " task_type " ) ) | | TaskTypeEnum . PUT . getCode ( ) . equals ( taskjo . getString ( " task_type " ) ) ) {
//取货
if ( TaskTypeEnum . TAKE . getCode ( ) . equals ( taskjo . getString ( " task_type " ) ) ) {
//已到达目标点
if ( StringUtils . isBlank ( taskjo . getString ( " step " ) ) ) {
//取货
ServiceResponse send = sendToAgvUtil . send ( " HMIStepOrRTPathFollow:0;2;0# " ) ;
JSONObject resjo = JSONObject . parseObject ( send . toString ( ) ) ;
String resultflag = resjo . getString ( " result " ) ;
if ( StrUtil . equals ( " 0 " , resultflag ) ) {
//叉腿已抬升
taskjo . put ( " step " , " 0 " ) ;
updateTaskStatus ( taskjo , null ) ;
} else {
log . error ( " handleTaskStatus-叉抬升失败:{} " , TaskSendBackStatusEnum . getName ( resultflag ) ) ;
}
}
qeryDebuggerInfoQuick ( ) ;
//叉腿高度
legHeight = debugInfoJsonQuick . getString ( " MissionCompleteAltitude_mm_RemoteOrHMI_FB " ) = = null ? " 0 " : debugInfoJsonQuick . getString ( " MissionCompleteAltitude_mm_RemoteOrHMI_FB " ) ;
//叉腿抬高动作已下发, 且高度为10或20且待机, 发送返程任务
if ( ( ( Integer . parseInt ( legHeight ) = = 20 ) ) & & StrUtil . equals ( " 0 " , debugInfoJsonQuick . getString ( " PathFollow_Enable " ) ) & & " 0 " . equals ( taskjo . getString ( " step " ) ) ) {
createReturnTask ( taskjo ) ;
}
} else {
if ( StringUtils . isBlank ( taskjo . getString ( " step " ) ) ) {
//放货
ServiceResponse send = sendToAgvUtil . send ( " HMIStepOrRTPathFollow:0;1;0# " ) ;
JSONObject resjo = JSONObject . parseObject ( send . toString ( ) ) ;
String resultflag = resjo . getString ( " result " ) ;
if ( StrUtil . equals ( " 0 " , resultflag ) ) {
//叉腿已下降
taskjo . put ( " step " , " 0 " ) ;
updateTaskStatus ( taskjo , null ) ;
} else {
log . error ( " handleTaskStatus-叉腿下降失败:{} " , TaskSendBackStatusEnum . getName ( resultflag ) ) ;
}
}
qeryDebuggerInfoQuick ( ) ;
legHeight = debugInfoJsonQuick . getString ( " MissionCompleteAltitude_mm_RemoteOrHMI_FB " ) = = null ? " 0 " : debugInfoJsonQuick . getString ( " MissionCompleteAltitude_mm_RemoteOrHMI_FB " ) ;
//叉腿抬高动作已下发, 且高度为10或20且待机, 发送返程任务
if ( ( ( Integer . parseInt ( legHeight ) = = 10 ) ) & & StrUtil . equals ( " 0 " , debugInfoJsonQuick . getString ( " PathFollow_Enable " ) ) & & " 0 " . equals ( taskjo . getString ( " step " ) ) ) {
createReturnTask ( taskjo ) ;
}
}
}
}
//stopWatch.stop();
//System.out.println("3task-处理任务状态-handleTaskStatusTask-花费时间----------------------------------------------------------------****************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
}
/**
* 定时清空过期任务
*/
@Async ( " taskExecutor " )
public void autoDeleteTask ( ) {
//StopWatch stopWatch = new StopWatch();
//stopWatch.start();
WQLObject taskTable = WQLObject . getWQLObject ( " ST_TASK_INFO " ) ;
String sqlWhere = " TASK_CODE NOT IN ( SELECT TASK_CODE FROM ( SELECT TASK_CODE FROM ST_TASK_INFO WHERE TASK_STATUS = '02' ORDER BY CREATE_TIME LIMIT 300 ) AS RECENT_TASKS ) AND TASK_STATUS = '02' " ;
taskTable . delete ( sqlWhere ) ;
//stopWatch.stop();
//System.out.println("4task-删除任务-autoDeleteTask-花费时间----------------------------------------------------------------****************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
}
// public Map<String, Object> queryHomePage1(Map<String, String> jsonObject) {
// String button_code = "";
// String button_name = "";