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

版本检查

上级 ae276416
...@@ -57,16 +57,6 @@ public interface I${item.codeName}Service extends IService<${item.codeName}>{ ...@@ -57,16 +57,6 @@ public interface I${item.codeName}Service extends IService<${item.codeName}>{
List<${de.codeName}> get${deCodeNameCamel}ByIds(List<String> ids) ; List<${de.codeName}> get${deCodeNameCamel}ByIds(List<String> ids) ;
List<${de.codeName}> get${deCodeNameCamel}ByEntities(List<${de.codeName}> entities) ; List<${de.codeName}> get${deCodeNameCamel}ByEntities(List<${de.codeName}> entities) ;
</#if> </#if>
<#comment>暂时只在sql发布test行为</#comment>
<#if item.getAllPSDEActions()??>
<#list item.getAllPSDEActions() as deaction>
<#if deaction.isEnableBackend()>
<@outputTestActionDetail deaction />
</#if>
</#list>
</#if>
} }
<#comment>NoSQL存储-MongoDB</#comment> <#comment>NoSQL存储-MongoDB</#comment>
<#elseif de.getStorageMode()==2> <#elseif de.getStorageMode()==2>
...@@ -155,6 +145,7 @@ public interface I${item.codeName}Service{ ...@@ -155,6 +145,7 @@ public interface I${item.codeName}Service{
<#else> <#else>
${item.codeName} ${srfmethodname(deaction.getCodeName())}(${item.codeName} et) ; ${item.codeName} ${srfmethodname(deaction.getCodeName())}(${item.codeName} et) ;
</#if> </#if>
<@outputTestActionDetail deaction />
</#if> </#if>
</#list> </#list>
</#if> </#if>
......
...@@ -919,6 +919,7 @@ ${deaction.getRender().code} ...@@ -919,6 +919,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) { public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) {
<@outputTestAction deaction "usercustom"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
//自定义代码 //自定义代码
...@@ -931,6 +932,7 @@ ${deaction.getRender().code} ...@@ -931,6 +932,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) { public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) {
<@outputTestAction deaction "delogic"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
${deaction.getPSDELogic().getCodeName()?lower_case}Logic.execute(et); ${deaction.getPSDELogic().getCodeName()?lower_case}Logic.execute(et);
...@@ -943,6 +945,7 @@ ${deaction.getRender().code} ...@@ -943,6 +945,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public ${item.getCodeName()} get(${srfjavatype(keyfield.stdDataType)} key) { public ${item.getCodeName()} get(${srfjavatype(keyfield.stdDataType)} key) {
<@outputTestAction deaction "get"/>
<@buildEntityParam deaction/> <@buildEntityParam deaction/>
<@addGetActionBoforeLogic deaction/> <@addGetActionBoforeLogic deaction/>
Optional<${item.getCodeName()}> result = repository.findById(key); Optional<${item.getCodeName()}> result = repository.findById(key);
...@@ -991,6 +994,7 @@ ${deaction.getRender().code} ...@@ -991,6 +994,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public boolean create(${item.getCodeName()} et) { public boolean create(${item.getCodeName()} et) {
<@outputTestAction deaction "create"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
repository.insert(et); repository.insert(et);
...@@ -1027,6 +1031,7 @@ ${deaction.getRender().code} ...@@ -1027,6 +1031,7 @@ ${deaction.getRender().code}
@Override @Override
public void createBatch(List<${item.getCodeName()}> list) { public void createBatch(List<${item.getCodeName()}> list) {
<@outputTestAction deaction "createBatch"/>
<#comment>联合主键,走SaveOrUpdateBatch,防止因主键冲突导致后续数据无法保存</#comment> <#comment>联合主键,走SaveOrUpdateBatch,防止因主键冲突导致后续数据无法保存</#comment>
<#if item.getUnionKeyValuePSDEFields()??> <#if item.getUnionKeyValuePSDEFields()??>
repository.saveAll(list); repository.saveAll(list);
...@@ -1039,6 +1044,7 @@ ${deaction.getRender().code} ...@@ -1039,6 +1044,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public boolean update(${item.getCodeName()} et) { public boolean update(${item.getCodeName()} et) {
<@outputTestAction deaction "update"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
<#if de.getKeyPSDEField()??> <#if de.getKeyPSDEField()??>
...@@ -1079,6 +1085,7 @@ ${deaction.getRender().code} ...@@ -1079,6 +1085,7 @@ ${deaction.getRender().code}
@Override @Override
public void updateBatch(List<${item.getCodeName()}> list) { public void updateBatch(List<${item.getCodeName()}> list) {
<@outputTestAction deaction "updateBatch"/>
repository.saveAll(list); repository.saveAll(list);
} }
...@@ -1086,6 +1093,7 @@ ${deaction.getRender().code} ...@@ -1086,6 +1093,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public boolean save(${item.getCodeName()} et) { public boolean save(${item.getCodeName()} et) {
<@outputTestAction deaction "save"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
<#if de.getKeyPSDEField()??> <#if de.getKeyPSDEField()??>
...@@ -1127,6 +1135,7 @@ ${deaction.getRender().code} ...@@ -1127,6 +1135,7 @@ ${deaction.getRender().code}
@Override @Override
public void saveBatch(List<${item.getCodeName()}> list) { public void saveBatch(List<${item.getCodeName()}> list) {
<@outputTestAction deaction "saveBatch"/>
repository.saveAll(list); repository.saveAll(list);
} }
...@@ -1134,6 +1143,7 @@ ${deaction.getRender().code} ...@@ -1134,6 +1143,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public boolean remove(${srfjavatype(keyfield.stdDataType)} key) { public boolean remove(${srfjavatype(keyfield.stdDataType)} key) {
<@outputTestAction deaction "remove"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@buildEntityParam deaction/> <@buildEntityParam deaction/>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
...@@ -1154,12 +1164,14 @@ ${deaction.getRender().code} ...@@ -1154,12 +1164,14 @@ ${deaction.getRender().code}
@Override @Override
public void removeBatch(Collection<${srfjavatype(keyfield.stdDataType)}> idList) { public void removeBatch(Collection<${srfjavatype(keyfield.stdDataType)}> idList) {
<@outputTestAction deaction "removeBatch"/>
repository.deleteAll(repository.findAllById(idList)); repository.deleteAll(repository.findAllById(idList));
} }
<#elseif deaction.getCodeName()?lower_case == "getdraft"> <#elseif deaction.getCodeName()?lower_case == "getdraft">
@Override @Override
public ${item.getCodeName()} getDraft(${item.getCodeName()} et) { public ${item.getCodeName()} getDraft(${item.getCodeName()} et) {
<@outputTestAction deaction "getdraft"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
<#comment>附加数据逻辑-操作后</#comment> <#comment>附加数据逻辑-操作后</#comment>
...@@ -1170,6 +1182,7 @@ ${deaction.getRender().code} ...@@ -1170,6 +1182,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == "checkkey"> <#elseif deaction.getCodeName()?lower_case == "checkkey">
@Override @Override
public boolean checkKey(${item.getCodeName()} et) { public boolean checkKey(${item.getCodeName()} et) {
<@outputTestAction deaction "checkkey"/>
return repository.findById(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()).isPresent(); return repository.findById(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()).isPresent();
} }
...@@ -1177,7 +1190,7 @@ ${deaction.getRender().code} ...@@ -1177,7 +1190,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) { public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) {
//自定义代码 <@outputTestAction deaction "other"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
<#comment>附加数据逻辑-操作后</#comment> <#comment>附加数据逻辑-操作后</#comment>
...@@ -1186,6 +1199,8 @@ ${deaction.getRender().code} ...@@ -1186,6 +1199,8 @@ ${deaction.getRender().code}
} }
</#if> </#if>
<#comment>输出测试实体行为</#comment>
<@outputTestActionDetail deaction/>
</#if> </#if>
</#if> </#if>
</#list> </#list>
...@@ -1368,6 +1383,7 @@ ${deaction.getRender().code} ...@@ -1368,6 +1383,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) { public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) {
<@outputTestAction deaction "usercustom"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
//自定义代码 //自定义代码
...@@ -1380,6 +1396,7 @@ ${deaction.getRender().code} ...@@ -1380,6 +1396,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) { public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) {
<@outputTestAction deaction "delogic"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
${deaction.getPSDELogic().getCodeName()?lower_case}Logic.execute(et); ${deaction.getPSDELogic().getCodeName()?lower_case}Logic.execute(et);
...@@ -1391,6 +1408,7 @@ ${deaction.getRender().code} ...@@ -1391,6 +1408,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == 'get'> <#elseif deaction.getCodeName()?lower_case == 'get'>
@Override @Override
public ${item.getCodeName()} get(${srfjavatype(keyfield.stdDataType)} ${keyfield.getCodeName()?lower_case}) { public ${item.getCodeName()} get(${srfjavatype(keyfield.stdDataType)} ${keyfield.getCodeName()?lower_case}) {
<@outputTestAction deaction "get"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
<#--<#comment>附加数据逻辑-操作前</#comment>--> <#--<#comment>附加数据逻辑-操作前</#comment>-->
...@@ -1443,6 +1461,7 @@ ${deaction.getRender().code} ...@@ -1443,6 +1461,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == "create"> <#elseif deaction.getCodeName()?lower_case == "create">
@Override @Override
public boolean create(${item.getCodeName()} et) { public boolean create(${item.getCodeName()} et) {
<@outputTestAction deaction "create"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
...@@ -1488,6 +1507,7 @@ ${deaction.getRender().code} ...@@ -1488,6 +1507,7 @@ ${deaction.getRender().code}
} }
public void createBatch(List<${item.codeName}> list){ public void createBatch(List<${item.codeName}> list){
<@outputTestAction deaction "createBatch"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
${subSysServiceApiDECodeName?uncap_first}FeignClient.createBatch(list) ; ${subSysServiceApiDECodeName?uncap_first}FeignClient.createBatch(list) ;
...@@ -1498,6 +1518,7 @@ ${deaction.getRender().code} ...@@ -1498,6 +1518,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == "update"> <#elseif deaction.getCodeName()?lower_case == "update">
@Override @Override
public boolean update(${item.getCodeName()} et) { public boolean update(${item.getCodeName()} et) {
<@outputTestAction deaction "update"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
...@@ -1544,6 +1565,7 @@ ${deaction.getRender().code} ...@@ -1544,6 +1565,7 @@ ${deaction.getRender().code}
} }
public void updateBatch(List<${item.codeName}> list){ public void updateBatch(List<${item.codeName}> list){
<@outputTestAction deaction "updateBatch"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
${subSysServiceApiDECodeName?uncap_first}FeignClient.updateBatch(list) ; ${subSysServiceApiDECodeName?uncap_first}FeignClient.updateBatch(list) ;
...@@ -1555,6 +1577,7 @@ ${deaction.getRender().code} ...@@ -1555,6 +1577,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public boolean save(${item.getCodeName()} et) { public boolean save(${item.getCodeName()} et) {
<@outputTestAction deaction "save"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
...@@ -1600,6 +1623,7 @@ ${deaction.getRender().code} ...@@ -1600,6 +1623,7 @@ ${deaction.getRender().code}
@Override @Override
public void saveBatch(List<${item.getCodeName()}> list) { public void saveBatch(List<${item.getCodeName()}> list) {
<@outputTestAction deaction "saveBatch"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
${subSysServiceApiDECodeName?uncap_first}FeignClient.saveBatch(list) ; ${subSysServiceApiDECodeName?uncap_first}FeignClient.saveBatch(list) ;
...@@ -1610,6 +1634,7 @@ ${deaction.getRender().code} ...@@ -1610,6 +1634,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == "remove"> <#elseif deaction.getCodeName()?lower_case == "remove">
@Override @Override
public boolean remove(${srfjavatype(keyfield.stdDataType)} ${keyfield.getCodeName()?lower_case}) { public boolean remove(${srfjavatype(keyfield.stdDataType)} ${keyfield.getCodeName()?lower_case}) {
<@outputTestAction deaction "remove"/>
<#if de.getMajorPSDERs()??> <#if de.getMajorPSDERs()??>
<#list de.getMajorPSDERs() as der> <#list de.getMajorPSDERs() as der>
<#if der.getDERType() =='DER1N' && der.isNestedRS() && der.getMinorPSDataEntity()?? && (der.getMinorPSDataEntity().getStorageMode()==1||der.getMinorPSDataEntity().getStorageMode()==2) > <#if der.getDERType() =='DER1N' && der.isNestedRS() && der.getMinorPSDataEntity()?? && (der.getMinorPSDataEntity().getStorageMode()==1||der.getMinorPSDataEntity().getStorageMode()==2) >
...@@ -1637,6 +1662,7 @@ ${deaction.getRender().code} ...@@ -1637,6 +1662,7 @@ ${deaction.getRender().code}
} }
public void removeBatch(Collection<${srfjavatype(keyfield.stdDataType)}> idList){ public void removeBatch(Collection<${srfjavatype(keyfield.stdDataType)}> idList){
<@outputTestAction deaction "removeBatch"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
${subSysServiceApiDECodeName?uncap_first}FeignClient.removeBatch(idList); ${subSysServiceApiDECodeName?uncap_first}FeignClient.removeBatch(idList);
...@@ -1647,6 +1673,7 @@ ${deaction.getRender().code} ...@@ -1647,6 +1673,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == "getdraft"> <#elseif deaction.getCodeName()?lower_case == "getdraft">
@Override @Override
public ${item.getCodeName()} getDraft(${item.getCodeName()} et) { public ${item.getCodeName()} getDraft(${item.getCodeName()} et) {
<@outputTestAction deaction "getdraft"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
...@@ -1666,6 +1693,7 @@ ${deaction.getRender().code} ...@@ -1666,6 +1693,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == "checkkey"> <#elseif deaction.getCodeName()?lower_case == "checkkey">
@Override @Override
public boolean checkKey(${item.getCodeName()} et) { public boolean checkKey(${item.getCodeName()} et) {
<@outputTestAction deaction "checkkey"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
return ${subSysServiceApiDECodeName?uncap_first}FeignClient.checkKey(et); return ${subSysServiceApiDECodeName?uncap_first}FeignClient.checkKey(et);
...@@ -1679,6 +1707,7 @@ ${deaction.getRender().code} ...@@ -1679,6 +1707,7 @@ ${deaction.getRender().code}
<#else> <#else>
@Override @Override
public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) { public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) {
<@outputTestAction deaction "other"/>
<#if item.isEnableAPIStorage()> <#if item.isEnableAPIStorage()>
<#if deaction.getPSSubSysServiceAPIDEMethod()?? > <#if deaction.getPSSubSysServiceAPIDEMethod()?? >
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
...@@ -1690,11 +1719,13 @@ ${deaction.getRender().code} ...@@ -1690,11 +1719,13 @@ ${deaction.getRender().code}
<#else> <#else>
return null; return null;
</#if> </#if>
<#else> <#else>
return null; return null;
</#if> </#if>
} }
</#if> </#if>
<#comment>输出测试实体行为</#comment>
<@outputTestActionDetail deaction/>
</#if> </#if>
</#if> </#if>
</#list> </#list>
...@@ -1864,6 +1895,7 @@ ${deaction.getRender().code} ...@@ -1864,6 +1895,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) { public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) {
<@outputTestAction deaction "usercustom"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
//自定义代码 //自定义代码
...@@ -1876,6 +1908,7 @@ ${deaction.getRender().code} ...@@ -1876,6 +1908,7 @@ ${deaction.getRender().code}
@Override @Override
@Transactional @Transactional
public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) { public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) {
<@outputTestAction deaction "delogic"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
${deaction.getPSDELogic().getCodeName()?lower_case}Logic.execute(et); ${deaction.getPSDELogic().getCodeName()?lower_case}Logic.execute(et);
...@@ -1887,6 +1920,7 @@ ${deaction.getRender().code} ...@@ -1887,6 +1920,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == 'get'> <#elseif deaction.getCodeName()?lower_case == 'get'>
@Override @Override
public ${item.getCodeName()} get(${srfjavatype(keyfield.stdDataType)} key) { public ${item.getCodeName()} get(${srfjavatype(keyfield.stdDataType)} key) {
<@outputTestAction deaction "get"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@buildEntityParam deaction/> <@buildEntityParam deaction/>
<@addGetActionBoforeLogic deaction/> <@addGetActionBoforeLogic deaction/>
...@@ -1904,6 +1938,7 @@ ${deaction.getRender().code} ...@@ -1904,6 +1938,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == "create"> <#elseif deaction.getCodeName()?lower_case == "create">
@Override @Override
public boolean create(${item.getCodeName()} et) { public boolean create(${item.getCodeName()} et) {
<@outputTestAction deaction "create"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
//代码实现 //代码实现
...@@ -1913,12 +1948,13 @@ ${deaction.getRender().code} ...@@ -1913,12 +1948,13 @@ ${deaction.getRender().code}
} }
public void createBatch(List<${item.codeName}> list){ public void createBatch(List<${item.codeName}> list){
<@outputTestAction deaction "createBatch"/>
} }
<#elseif deaction.getCodeName()?lower_case == "update"> <#elseif deaction.getCodeName()?lower_case == "update">
@Override @Override
public boolean update(${item.getCodeName()} et) { public boolean update(${item.getCodeName()} et) {
<@outputTestAction deaction "update"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
//代码实现 //代码实现
...@@ -1928,13 +1964,14 @@ ${deaction.getRender().code} ...@@ -1928,13 +1964,14 @@ ${deaction.getRender().code}
} }
public void updateBatch(List<${item.codeName}> list){ public void updateBatch(List<${item.codeName}> list){
<@outputTestAction deaction "updateBatch"/>
} }
<#elseif deaction.getCodeName()?lower_case == "save"> <#elseif deaction.getCodeName()?lower_case == "save">
@Override @Override
@Transactional @Transactional
public boolean save(${item.getCodeName()} et) { public boolean save(${item.getCodeName()} et) {
<@outputTestAction deaction "save"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
//代码实现 //代码实现
...@@ -1945,12 +1982,13 @@ ${deaction.getRender().code} ...@@ -1945,12 +1982,13 @@ ${deaction.getRender().code}
@Override @Override
public void saveBatch(List<${item.getCodeName()}> list) { public void saveBatch(List<${item.getCodeName()}> list) {
<@outputTestAction deaction "saveBatch"/>
} }
<#elseif deaction.getCodeName()?lower_case == "remove"> <#elseif deaction.getCodeName()?lower_case == "remove">
@Override @Override
public boolean remove(${srfjavatype(keyfield.stdDataType)} key) { public boolean remove(${srfjavatype(keyfield.stdDataType)} key) {
<@outputTestAction deaction "remove"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@buildEntityParam deaction/> <@buildEntityParam deaction/>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
...@@ -1960,12 +1998,13 @@ ${deaction.getRender().code} ...@@ -1960,12 +1998,13 @@ ${deaction.getRender().code}
} }
public void removeBatch(Collection<${srfjavatype(keyfield.stdDataType)}> idList){ public void removeBatch(Collection<${srfjavatype(keyfield.stdDataType)}> idList){
<@outputTestAction deaction "removeBatch"/>
} }
<#elseif deaction.getCodeName()?lower_case == "getdraft"> <#elseif deaction.getCodeName()?lower_case == "getdraft">
@Override @Override
public ${item.getCodeName()} getDraft(${item.getCodeName()} et) { public ${item.getCodeName()} getDraft(${item.getCodeName()} et) {
<@outputTestAction deaction "getdraft"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
<#comment>附加数据逻辑-操作后</#comment> <#comment>附加数据逻辑-操作后</#comment>
...@@ -1976,6 +2015,7 @@ ${deaction.getRender().code} ...@@ -1976,6 +2015,7 @@ ${deaction.getRender().code}
<#elseif deaction.getCodeName()?lower_case == "checkkey"> <#elseif deaction.getCodeName()?lower_case == "checkkey">
@Override @Override
public boolean checkKey(${item.getCodeName()} et) { public boolean checkKey(${item.getCodeName()} et) {
<@outputTestAction deaction "checkkey"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
<#comment>附加数据逻辑-操作后</#comment> <#comment>附加数据逻辑-操作后</#comment>
...@@ -1985,6 +2025,7 @@ ${deaction.getRender().code} ...@@ -1985,6 +2025,7 @@ ${deaction.getRender().code}
<#else> <#else>
@Override @Override
public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) { public ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}(${item.getCodeName()} et) {
<@outputTestAction deaction "other"/>
<#comment>附加数据逻辑-操作前</#comment> <#comment>附加数据逻辑-操作前</#comment>
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
<#comment>附加数据逻辑-操作后</#comment> <#comment>附加数据逻辑-操作后</#comment>
...@@ -1992,6 +2033,8 @@ ${deaction.getRender().code} ...@@ -1992,6 +2033,8 @@ ${deaction.getRender().code}
return et; return et;
} }
</#if> </#if>
<#comment>输出测试实体行为</#comment>
<@outputTestActionDetail deaction/>
</#if> </#if>
</#if> </#if>
</#list> </#list>
......
...@@ -664,9 +664,19 @@ public class ${itemCodeName}Resource { ...@@ -664,9 +664,19 @@ public class ${itemCodeName}Resource {
<#comment>数据库版本检查注解</#comment> <#comment>数据库版本检查注解</#comment>
<#macro VersionCheckAnnotation> <#macro VersionCheckAnnotation>
<#if de.getPSDEFieldByPDT('UPDATEDATE',true)??> <#if item.getPSDEServiceAPIFields()??>
<#assign updatedateField=srfcaseformat(de.getPSDEFieldByPDT('UPDATEDATE',true).codeName,'l_u2lC')> <#list item.getPSDEServiceAPIFields() as apifield>
<#if apifield.getPSDEField?? && apifield.getPSDEField()??>
<#assign defield=apifield.getPSDEField()>
<#if defield.getPredefinedType?? && defield.getPredefinedType()??>
<#if defield.getPredefinedType()=='UPDATEDATE'>
<#assign updatedateField=srfcaseformat(defield.codeName,'l_u2lC')>
@VersionCheck(entity = "${deCodeNameLC}" , versionfield = "${updatedateField}") @VersionCheck(entity = "${deCodeNameLC}" , versionfield = "${updatedateField}")
<#break>
</#if>
</#if>
</#if>
</#list>
</#if> </#if>
</#macro> </#macro>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册