|
|
|
@ -63,6 +63,7 @@ import com.fr.report.utils.ElementCaseHelper;
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.util.HashSet; |
|
|
|
|
import java.util.Iterator; |
|
|
|
|
import java.util.List; |
|
|
|
@ -127,13 +128,7 @@ public class ReplaceUtils {
|
|
|
|
|
Set<String> ans = new HashSet<>(); |
|
|
|
|
FormElementCaseProvider provider = elementCaseEditor.getElementCase(); |
|
|
|
|
if (provider instanceof ElementCase) { |
|
|
|
|
// 非公式部分
|
|
|
|
|
ans.addAll(searchTableDataWithOutFormula((ElementCase)provider)); |
|
|
|
|
// 公式部分——理论上就只有单元格和控件(超链那些都包含)
|
|
|
|
|
List<FormulaInfo> formulaInfos = getElementCaseFormulas((ElementCase) provider); |
|
|
|
|
ans.addAll(searchFormulaInfos(formulaInfos)); |
|
|
|
|
// 超链部分
|
|
|
|
|
ans.addAll(searchElementCasJs((ElementCase)provider)); |
|
|
|
|
ans.addAll(searchElementCaseDependenceTables((ElementCase) provider)); |
|
|
|
|
} |
|
|
|
|
return ans; |
|
|
|
|
} |
|
|
|
@ -168,10 +163,10 @@ public class ReplaceUtils {
|
|
|
|
|
String tableName = iterator.next(); |
|
|
|
|
ans.add(tableName); |
|
|
|
|
} |
|
|
|
|
ans.addAll(searchReport(workBook)); |
|
|
|
|
} |
|
|
|
|
return ans; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取CPT里使用的公式 |
|
|
|
|
* |
|
|
|
@ -860,5 +855,32 @@ public class ReplaceUtils {
|
|
|
|
|
return ans; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static Set<String> searchReport(WorkBook workBook) { |
|
|
|
|
Set<String> ans = new HashSet<>(); |
|
|
|
|
for (int i = 0; i < workBook.getReportCount(); i++) { |
|
|
|
|
Report report = workBook.getReport(i); |
|
|
|
|
if (report != null) { |
|
|
|
|
Iterator it = report.iteratorOfElementCase(); |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
ElementCase elementCase = (ElementCase) it.next(); |
|
|
|
|
ans.addAll(searchElementCaseDependenceTables(elementCase)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return ans; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Collection<String> searchElementCaseDependenceTables(ElementCase provider) { |
|
|
|
|
Set<String> ans = new HashSet<>(); |
|
|
|
|
// 非公式部分
|
|
|
|
|
ans.addAll(searchTableDataWithOutFormula(provider)); |
|
|
|
|
// 公式部分——理论上就只有单元格和控件(超链那些都包含)
|
|
|
|
|
List<FormulaInfo> formulaInfos = getElementCaseFormulas( provider); |
|
|
|
|
ans.addAll(searchFormulaInfos(formulaInfos)); |
|
|
|
|
// 超链部分
|
|
|
|
|
ans.addAll(searchElementCasJs(provider)); |
|
|
|
|
return ans; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|