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

test行为用户扩展

上级 418c74c5
......@@ -2210,7 +2210,7 @@ ${deaction.getRender().code}
<#comment>输出测试行为</#comment>
<#macro outputTestAction deaction actionParam>
<#if deaction.getTestActionMode?? && deaction.getTestActionMode()?? && (deaction.getTestActionMode() ==1 || deaction.getTestActionMode() ==3 ) >
<#if deaction.getTestActionMode() ==1 || deaction.getTestActionMode() ==3 >
<#if (deaction.getActionType()=='USERCUSTOM')>
test${srfmethodname(deaction.getCodeName())?cap_first}(et);
<#elseif deaction.getActionType()=='DELOGIC'>
......@@ -2259,7 +2259,7 @@ ${deaction.getRender().code}
<#comment>输出测试行为</#comment>
<#macro outputTestActionDetail deaction>
<#if deaction.getTestActionMode?? && deaction.getTestActionMode()?? && (deaction.getTestActionMode() ==1 || deaction.getTestActionMode() ==3 ) >
<#if deaction.getTestActionMode() ==1 || deaction.getTestActionMode() ==3 >
<#if (deaction.getActionType()=='USERCUSTOM')>
@Transactional
public ${item.getCodeName()} test${srfmethodname(deaction.getCodeName())?cap_first}(${item.getCodeName()} et) {
......@@ -2342,12 +2342,7 @@ ${deaction.getRender().code}
public boolean testCheckKey(${item.getCodeName()} et) {
return true;
}
<#comment>用户扩展新建、更新</#comment>
<#elseif deaction.getActionType()== "USERCREATE" || deaction.getActionType()== "USERUPDATE">
@Transactional
public ${item.getCodeName()} test${srfmethodname(deaction.getCodeName())?cap_first}(${item.getCodeName()} et) {
return et;
}
<#else>
@Transactional
public ${item.getCodeName()} test${srfmethodname(deaction.getCodeName())?cap_first}(${item.getCodeName()} et) {
......
......@@ -5,7 +5,7 @@ TARGET=PSDATAENTITY
<#assign hasServiceEx=false>
<#if item.getAllPSDEActions()??>
<#list item.getAllPSDEActions() as deaction>
<#if deaction.isEnableBackend() && deaction.getActionType()=='USERCUSTOM'>
<#if deaction.isEnableBackend() && (deaction.getActionType()=='USERCUSTOM' || deaction.getTestActionMode() ==1 || deaction.getTestActionMode() ==3 )>
<#assign hasServiceEx=true>
<#break>
</#if>
......@@ -40,7 +40,8 @@ public class ${item.codeName}ServiceEx extends ${item.codeName}ServiceImpl {
<#comment>输出实体行为</#comment>
<#if item.getAllPSDEActions()??>
<#list item.getAllPSDEActions() as deaction>
<#if deaction.isEnableBackend() && deaction.getActionType()=='USERCUSTOM'>
<#if deaction.isEnableBackend()>
<#if deaction.getActionType()=='USERCUSTOM'>
/**
* 自定义行为[${deaction.getCodeName()}]用户扩展
* @param et
......@@ -52,9 +53,126 @@ public class ${item.codeName}ServiceEx extends ${item.codeName}ServiceImpl {
return super.${srfmethodname(deaction.getCodeName())}(et);
}
</#if>
<#comment>输出测试行为</#comment>
<@ outputTestActionDetail deaction />
</#if>
</#list>
</#if>
}
</#if>
<#comment>输出测试行为</#comment>
<#macro outputTestActionDetail deaction>
<#if deaction.getTestActionMode() ==1 || deaction.getTestActionMode() ==3 >
<#if (deaction.getActionType()=='USERCUSTOM')>
@Override
@Transactional
public ${item.getCodeName()} test${srfmethodname(deaction.getCodeName())?cap_first}(${item.getCodeName()} et) {
return et;
}
<#elseif deaction.getActionType()=='DELOGIC'>
@Override
@Transactional
public ${item.getCodeName()} test${srfmethodname(deaction.getCodeName())?cap_first}(${item.getCodeName()} et) {
return et ;
}
<#elseif deaction.getCodeName()?lower_case == 'get'>
@Override
@Transactional
public ${item.getCodeName()} testGet(${srfjavatype(keyfield.stdDataType)} key) {
return et;
}
<#elseif deaction.getCodeName()?lower_case == "createbatch">
<#elseif deaction.getCodeName()?lower_case == "updatebatch">
<#elseif deaction.getCodeName()?lower_case == "removebatch">
<#elseif deaction.getCodeName()?lower_case == "savebatch">
<#elseif deaction.getCodeName()?lower_case == "create">
@Override
@Transactional
public boolean testCreate(${item.getCodeName()} et) {
return true;
}
@Override
public void testCreateBatch(List<${item.getCodeName()}> list) {
}
<#elseif deaction.getCodeName()?lower_case == "update">
@Override
@Transactional
public boolean testUpdate(${item.getCodeName()} et) {
return true;
}
@Override
public void testUpdateBatch(List<${item.getCodeName()}> list) {
}
<#elseif deaction.getCodeName()?lower_case == "save">
@Override
@Transactional
public boolean testSave(${item.getCodeName()} et) {
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
@Override
public boolean testSaveOrUpdate(${item.getCodeName()} et) {
return true;
}
@Override
public boolean testSaveBatch(Collection<${item.getCodeName()}> list) {
return true;
}
@Override
public void testSaveBatch(List<${item.getCodeName()}> list) {
}
<#elseif deaction.getCodeName()?lower_case == "remove">
@Override
@Transactional
public boolean testRemove(${srfjavatype(keyfield.stdDataType)} key) {
return result ;
}
@Override
public void testRemoveBatch(Collection<${srfjavatype(keyfield.stdDataType)}> idList) {
}
<#elseif deaction.getCodeName()?lower_case == "getdraft">
@Override
public ${item.getCodeName()} testGetDraft(${item.getCodeName()} et) {
return et;
}
<#elseif deaction.getCodeName()?lower_case == "checkkey">
@Override
public boolean testCheckKey(${item.getCodeName()} et) {
return true;
}
<#else>
@Override
@Transactional
public ${item.getCodeName()} test${srfmethodname(deaction.getCodeName())?cap_first}(${item.getCodeName()} et) {
return et;
}
</#if>
</#if>
</#macro>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册