update
This commit is contained in:
@@ -15,9 +15,6 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import org.opentcs.access.KernelServicePortal;
|
||||
import org.opentcs.access.rmi.KernelServicePortalBuilder;
|
||||
import org.opentcs.common.GuestUserCredentials;
|
||||
import org.opentcs.components.kernel.services.RouterService;
|
||||
import org.opentcs.components.kernel.services.VehicleService;
|
||||
import org.opentcs.data.ObjectUnknownException;
|
||||
@@ -74,8 +71,12 @@ public class VehicleHandler {
|
||||
System.out.println("jsonObject-----ssss: " + data.toString());
|
||||
|
||||
//截取平台响应的字符串
|
||||
String jsonStr = data.toString().split("=", 2)[1];
|
||||
// String jsonStr = data.toString();
|
||||
String jsonStr;
|
||||
try {
|
||||
jsonStr = data.toString().split("=", 2)[1];
|
||||
} catch (Exception e) {
|
||||
jsonStr = data.toString();
|
||||
}
|
||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||
String name = jsonObject.getString("vehicle_name");
|
||||
Integer type = jsonObject.getInteger("type");
|
||||
|
||||
Reference in New Issue
Block a user