Commit 3e8faf8b by 林永健

fix bug

1 parent 0cdd01e7
......@@ -217,10 +217,10 @@ public class SopDataService {
for (SopDataConditionDTO subCondition : condition.getSubConditions()) {
subCondStrList.add(parseSQLWithOperator(subCondition));
}
String subCondStr = joinWithDelimiter(" and ", subCondStrList);
if (condition.getSql().toLowerCase().contains("(select ")) {
subCondStrList.add(")");
subCondStr += ")";
}
String subCondStr = joinWithDelimiter(" and ", subCondStrList);
condStr = sqlAnd(condStr, subCondStr);
}
condStrList.add(condStr);
......@@ -229,17 +229,24 @@ public class SopDataService {
if (!StringUtils.hasLength(res.trim())) {
return "";
}
res = res.replaceAll("&lt;", "<")
.replaceAll("&gt;", ">")
.replaceAll("&eq;", "=")
.replaceAll("&ne;", "!=");
return String.format(updateStagePrefix, StageName) + res + ";";
}
private String parseSQLWithOperator(SopDataConditionDTO condition) {
String condStr = condition.getSql();
if (CollectionUtils.isEmpty(condition.getOperators())) {
return condStr;
return CollectionUtils.isEmpty(condition.getSubConditions()) ? "" : condStr;
}
// 针对“页面配置”等这种条件(type=1)进行特殊处理,对value值进行拆分,放在sql的占位中
if ("页面配置".equals(condition.getName())) {
SopDataOperatorDTO operator = condition.getOperators().get(0);
if (!StringUtils.hasLength(operator.getValue())) {
return "";
}
String[] vals = operator.getValue().split("\\+");
if (vals.length == 0) {
return "";
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!