opt:修改远程码数值提取。
This commit is contained in:
@@ -61,18 +61,18 @@ public class DevelopServiceImpl implements DevelopService {
|
||||
String teamViewerId = "";
|
||||
String serviceResponse = "";
|
||||
String rosStringOutput = "";
|
||||
// ServiceResponse response = sendToAgvUtil.send("HMISettingGetRemoteID");
|
||||
// serviceResponse = response.toString();
|
||||
// rosStringOutput = JSONObject.parseObject(response.toString()).getString("ROS_String_Output");
|
||||
String resultInfo = "GetRemotelD:1514937762 [1m TeamViewer ID:[Om 1469530530";
|
||||
if (StringUtils.isNotBlank(resultInfo)) {
|
||||
String regex = "GetRemotelD:(\\d+) \\[1m TeamViewer ID:\\[Om (\\d+)";
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(resultInfo);
|
||||
// 查找匹配项
|
||||
ServiceResponse response = sendToAgvUtil.send("HMISettingGetRemoteID");
|
||||
serviceResponse = response.toString();
|
||||
rosStringOutput = JSONObject.parseObject(response.toString()).getString("ROS_String_Output");
|
||||
String resultInfo = "GetRemotelD:1514937762 [212m TeamViewer ID:[321m 1469530530";
|
||||
if (StringUtils.isNotBlank(rosStringOutput)) {
|
||||
Pattern pattern = Pattern.compile("\\b(?!\\d+m)\\d+\\b");
|
||||
Matcher matcher = pattern.matcher(rosStringOutput);
|
||||
if (matcher.find()) {
|
||||
anyDeskId = matcher.group(1);
|
||||
teamViewerId = matcher.group(2);
|
||||
anyDeskId = matcher.group(0);
|
||||
if (matcher.find()) {
|
||||
teamViewerId = matcher.group(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
Reference in New Issue
Block a user