Browse Source

REPORT-140453 【数据集替换】自定义校验的属性公式没有替换成功

release/11.0
Destiny.Lin 1 month ago
parent
commit
713c9f02db
  1. 20
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java

20
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java

@ -22,6 +22,7 @@ import com.fr.report.write.ReportWriteAttr;
import com.fr.report.write.SubmitVisitor;
import com.fr.report.write.ValueVerifier;
import com.fr.report.write.WClassSubmiter;
import com.fr.report.write.WClassVerifier;
import com.fr.stable.CommonUtils;
import com.fr.stable.ListMap;
@ -106,16 +107,31 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
//数据校验
for (int i = 0, len = attr.getVerifierCount(); i < len; i++) {
Verifier verifier = attr.getVerifier(i);
ITContent content = ITContent.copy(sheetContent);
content.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"));
if (verifier instanceof ValueVerifier) {
ITContent content = ITContent.copy(sheetContent);
content.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"));
dealValueVerifier4Formula(formulaInfos, content, (ValueVerifier) verifier);
} else if (verifier instanceof WClassVerifier) {
dealWClassVerifier(formulaInfos, content, (WClassVerifier)verifier);
}
}
}
}
private void dealWClassVerifier(List<FormulaInfo> formulaInfos, ITContent content, WClassVerifier verifier) {
if (verifier.getClassVerifyJob() != null) {
ListMap map = verifier.getClassVerifyJob().getPropertyMap();
for (Object value : map.values()) {
if (value instanceof Formula) {
ITContent formulaContent = ITContent.copy(content);
formulaContent.setReplaceObject(value);
formulaInfos.add(new FormulaInfo(formulaContent));
}
}
}
}
private void dealValueVerifier4Formula(List<FormulaInfo> formulaInfos, ITContent content, ValueVerifier verifier) {
ITContent verifyContent = ITContent.copy(content);
verifyContent.addOtherPos(verifier.getName());

Loading…
Cancel
Save