提交 4ba5435e 编写于 作者: zhouweidong's avatar zhouweidong

补充值规则异常信息

上级 874d7ea6
......@@ -188,41 +188,10 @@ public class ${item.getCodeName()}DTO extends ${dtoBase} implements Serializable
<#assign ruleName=(de.codeName+"_"+deRule.getPSDEField().codeName+"_"+deRule.codeName)?lower_case>
<#assign ruleField=(deRule.getPSDEField().codeName)?lower_case>
<#assign group=deRule.getPSDEFVRGroupCondition()>
<#assign ruleMsg=getGroupCond(group)>
@ValueRuleCheck(field = "${ruleField}", rule = "${ruleName}"),
</#if>
</#if>
</#list>
})
</#if>
</#macro>
<#comment>获取group规则信息</#comment>
<#function getGroupCond group>
<#assign strRuleCond="(">
<#if group.getPSDEFVRConditions()??>
<#assign condOp=group.getCondOp()?replace("AND","并且")?replace("OR","或者")>
<#list group.getPSDEFVRConditions() as childRule>
<#assign childRuleType=childRule.getCondType()>
<#if childRuleType=='GROUP'>
<#assign strRuleCond=strRuleCond+getGroupCond(childRule)>
<#else>
<#assign strRuleCond=strRuleCond+getFieldCond(childRule)>
</#if>
<#if childRule_has_next>
<#assign strRuleCond=strRuleCond+condOp>
</#if>
</#list>
</#if>
<#assign strRuleCond=strRuleCond+")">
<#return strRuleCond/>
</#function>
<#comment>获取field规则信息</#comment>
<#function getFieldCond fieldRule>
<#assign fieldCond="">
<#if fieldRule.getRuleInfo?? && fieldRule.getRuleInfo()??>
<#assign fieldCond=fieldRule.getRuleInfo()>
</#if>
<#return fieldCond/>
</#function>
\ No newline at end of file
</#macro>
\ No newline at end of file
......@@ -64,7 +64,8 @@ public class ValueRuleValidator implements ConstraintValidator<ValueRuleCheck, D
<#assign group=deRule.getPSDEFVRGroupCondition()>
<#assign ruleName=(de.codeName+"_"+deRule.getPSDEField().codeName+"_"+deRule.codeName)?lower_case>
<#assign ruleCond=getGroupCond(group)>
sysRule.put("${ruleName}", "${ruleCond}");
<#assign ruleMessage=getGroupMessage(group)>
sysRule.put("${ruleName}", new ValueRule("${ruleCond}","${ruleMessage}"));
</#if>
</#if>
</#list>
......@@ -117,4 +118,34 @@ public class ValueRuleValidator implements ConstraintValidator<ValueRuleCheck, D
<#assign fieldCond=fieldCond+condBody >
<#assign fieldCond=fieldCond+")" >
<#return fieldCond/>
</#function>
<#comment>获取group规则信息</#comment>
<#function getGroupMessage group>
<#assign strRuleCond="(">
<#if group.getPSDEFVRConditions()??>
<#assign condOp=group.getCondOp()?replace("AND","并且")?replace("OR","或者")>
<#list group.getPSDEFVRConditions() as childRule>
<#assign childRuleType=childRule.getCondType()>
<#if childRuleType=='GROUP'>
<#assign strRuleCond=strRuleCond+getGroupCond(childRule)>
<#else>
<#assign strRuleCond=strRuleCond+getFieldCond(childRule)>
</#if>
<#if childRule_has_next>
<#assign strRuleCond=strRuleCond+condOp>
</#if>
</#list>
</#if>
<#assign strRuleCond=strRuleCond+")">
<#return strRuleCond/>
</#function>
<#comment>获取field规则信息</#comment>
<#function getFieldMessage fieldRule>
<#assign fieldCond="">
<#if fieldRule.getRuleInfo?? && fieldRule.getRuleInfo()??>
<#assign fieldCond=fieldRule.getRuleInfo()>
</#if>
<#return fieldCond/>
</#function>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册