|
|
@@ -46,16 +46,15 @@ public class KanbanParser {
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
/**
|
|
|
- * 替换看板中的参数为实际值
|
|
|
+ * 替换内容中的参数为实际值
|
|
|
*
|
|
|
* @param content 看板内容
|
|
|
* @param parameters 参数
|
|
|
* @param needSingleQuote 参数值是否以单引号括起来(用于 sql)
|
|
|
- * @param jdbc NewbieJdbcSupport 对象
|
|
|
- * @return 替换后的看板内容
|
|
|
+ * @return 替换后的内容
|
|
|
*/
|
|
|
private String replaceParameters(@NotEmpty("content") String content, List<Parameter> parameters,
|
|
|
- @NotEmpty("needSingleQuote") Boolean needSingleQuote, @NotEmpty("jdbc") NewbieJdbcSupport jdbc) throws SQLException {
|
|
|
+ @NotEmpty("needSingleQuote") Boolean needSingleQuote) throws SQLException {
|
|
|
if (CollectionUtils.isEmpty(parameters)) {
|
|
|
return content;
|
|
|
}
|
|
|
@@ -103,8 +102,8 @@ public class KanbanParser {
|
|
|
throws DocumentException, TransformerException, IOException, IllegalStateException, SQLException {
|
|
|
content = processSql(content);
|
|
|
// 替换标题中的参数
|
|
|
- if (!com.uas.kanban.util.StringUtils.isEmpty(title)) {
|
|
|
- title = replaceParameters(title, parameters, false, jdbc);
|
|
|
+ if (!StringUtils.isEmpty(title)) {
|
|
|
+ title = replaceParameters(title, parameters, false);
|
|
|
}
|
|
|
content = processForm(content, jdbc, parameters);
|
|
|
content = processGrid(content, jdbc, parameters);
|
|
|
@@ -155,7 +154,7 @@ public class KanbanParser {
|
|
|
if (StringUtils.isEmpty(sql)) {
|
|
|
continue;
|
|
|
}
|
|
|
- sql = replaceParameters(sql, parameters, true, jdbc);
|
|
|
+ sql = replaceParameters(sql, parameters, true);
|
|
|
// 获取 field 节点
|
|
|
List<Element> fieldElements = element.elements("field");
|
|
|
if (CollectionUtils.isEmpty(fieldElements)) {
|
|
|
@@ -196,7 +195,7 @@ public class KanbanParser {
|
|
|
if (StringUtils.isEmpty(sql)) {
|
|
|
continue;
|
|
|
}
|
|
|
- sql = replaceParameters(sql, parameters, true, jdbc);
|
|
|
+ sql = replaceParameters(sql, parameters, true);
|
|
|
// 获取 field 节点
|
|
|
List<Element> fieldElements = element.elements("field");
|
|
|
if (CollectionUtils.isEmpty(fieldElements)) {
|
|
|
@@ -251,7 +250,7 @@ public class KanbanParser {
|
|
|
if (StringUtils.isEmpty(sql)) {
|
|
|
continue;
|
|
|
}
|
|
|
- sql = replaceParameters(sql, parameters, true, jdbc);
|
|
|
+ sql = replaceParameters(sql, parameters, true);
|
|
|
checkCount(jdbc.getDataSource().getConnection(), sql);
|
|
|
Map<String, List<Object>> map = convert(jdbc.listMap(sql));
|
|
|
if (CollectionUtils.isEmpty(map)) {
|
|
|
@@ -312,7 +311,7 @@ public class KanbanParser {
|
|
|
if (StringUtils.isEmpty(sql)) {
|
|
|
continue;
|
|
|
}
|
|
|
- sql = replaceParameters(sql, parameters, true, jdbc);
|
|
|
+ sql = replaceParameters(sql, parameters, true);
|
|
|
checkCount(jdbc.getDataSource().getConnection(), sql);
|
|
|
List<Map<String, Object>> listMap = jdbc.listMap(sql);
|
|
|
if (CollectionUtils.isEmpty(listMap)) {
|