Commit b412c554 by Java - 段鹏举

代码判断改为正则表达式

parent 2a5ed293
...@@ -379,21 +379,13 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -379,21 +379,13 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
dao.updateVerifStatys(bean); dao.updateVerifStatys(bean);
} }
if (!"00".equals(bean.getCommandStatus())) { if (!"00".equals(bean.getCommandStatus())) {
Pattern pattern = Pattern.compile("(?<=routeNo\" value=\")(.+?)(?=\"/>)"); // 该input标签不一定以 / 结尾
Pattern pattern = Pattern.compile("(?<=routeNo\" value=\")(.+?)(?=\"/?>)");
Matcher matcher = pattern.matcher(bean.getSailingText()); Matcher matcher = pattern.matcher(bean.getSailingText());
while (matcher.find()) { while (matcher.find()) {
routeNo = matcher.group(); routeNo = matcher.group();
break; break;
} }
// 该input标签不一定以 / 结尾
if (StringUtils.isBlank(routeNo)) {
pattern = Pattern.compile("(?<=routeNo\" value=\")(.+?)(?=\">)");
matcher = pattern.matcher(bean.getSailingText());
while (matcher.find()) {
routeNo = matcher.group();
break;
}
}
if (StringUtils.isBlank(routeNo)) { if (StringUtils.isBlank(routeNo)) {
verifType = dao.getVerifType(bean); verifType = dao.getVerifType(bean);
...@@ -676,21 +668,13 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -676,21 +668,13 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
// dao.updateVerifStatys(bean); // dao.updateVerifStatys(bean);
// } // }
// if(!"00".equals(bean.getCommandStatus())){ // if(!"00".equals(bean.getCommandStatus())){
Pattern pattern = Pattern.compile("(?<=routeNo\" value=\")(.+?)(?=\"/>)"); // 该input标签不一定以 / 结尾
Pattern pattern = Pattern.compile("(?<=routeNo\" value=\")(.+?)(?=\"/?>)");
Matcher matcher = pattern.matcher(bean.getSailingText()); Matcher matcher = pattern.matcher(bean.getSailingText());
while (matcher.find()) { while (matcher.find()) {
routeNo = matcher.group(); routeNo = matcher.group();
break; break;
} }
// 该input标签不一定以 / 结尾
if (StringUtils.isBlank(routeNo)) {
pattern = Pattern.compile("(?<=routeNo\" value=\")(.+?)(?=\">)");
matcher = pattern.matcher(bean.getSailingText());
while (matcher.find()) {
routeNo = matcher.group();
break;
}
}
if (StringUtils.isBlank(routeNo)) { if (StringUtils.isBlank(routeNo)) {
verifType = dao.getVerifType(bean); verifType = dao.getVerifType(bean);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment