提交 27d74f15 编写于 作者: ibiz4j's avatar ibiz4j

接口实体

上级 44178267
...@@ -73,6 +73,29 @@ public class ActionModel extends BaseModel{ ...@@ -73,6 +73,29 @@ public class ActionModel extends BaseModel{
return true; return true;
} }
public boolean isListReturn()
{
if(getDEAction().getPSDEActionReturn()==null)
return false;
if ("DTOS".equalsIgnoreCase(getDEAction().getPSDEActionReturn().getType())
||"OBJECTS".equalsIgnoreCase(getDEAction().getPSDEActionReturn().getType())
||"SIMPLES".equalsIgnoreCase(getDEAction().getPSDEActionReturn().getType()))
return true;
return false;
}
public String typeReturn()
{
if(isListReturn()) {
if ("SIMPLES".equalsIgnoreCase(getDEAction().getPSDEActionReturn().getType()))
return PropType.findType(this.getDEAction().getPSDEActionReturn().getStdDataType()).java;
else if ("DTOS".equalsIgnoreCase(getDEAction().getPSDEActionReturn().getType())
||"OBJECTS".equalsIgnoreCase(getDEAction().getPSDEActionReturn().getType()))
return this.getEntity().getCodeName();
}
return "";
}
public String getOutParam() public String getOutParam()
{ {
String param=this.getEntity().getCodeName(); String param=this.getEntity().getCodeName();
......
...@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/ */
public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) { public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) {
this.{{camelCase codeName}} = {{camelCase codeName}}; this.{{camelCase codeName}} = {{camelCase codeName}};
this.modify("{{lowerCase name}}", {{camelCase codeName}}); this.modify("{{jsonName}}", {{camelCase codeName}});
} }
{{/unless}} {{/unless}}
{{/unless}} {{/unless}}
......
...@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/ */
public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) { public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) {
this.{{camelCase codeName}} = {{camelCase codeName}}; this.{{camelCase codeName}} = {{camelCase codeName}};
this.modify("{{lowerCase name}}", {{camelCase codeName}}); this.modify("{{jsonName}}", {{camelCase codeName}});
} }
{{/unless}} {{/unless}}
{{/unless}} {{/unless}}
......
...@@ -114,7 +114,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -114,7 +114,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/ */
public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) { public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) {
this.{{camelCase codeName}} = {{camelCase codeName}}; this.{{camelCase codeName}} = {{camelCase codeName}};
this.modify("{{lowerCase name}}", {{camelCase codeName}}); this.modify("{{jsonName}}", {{camelCase codeName}});
} }
{{/unless}} {{/unless}}
{{/unless}} {{/unless}}
......
...@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable ...@@ -94,7 +94,7 @@ public class {{entity.codeName}} extends BaseData implements Serializable
*/ */
public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) { public void set{{pascalCase codeName}}({{type.java}} {{camelCase codeName}}) {
this.{{camelCase codeName}} = {{camelCase codeName}}; this.{{camelCase codeName}} = {{camelCase codeName}};
this.modify("{{lowerCase name}}", {{camelCase codeName}}); this.modify("{{jsonName}}", {{camelCase codeName}});
} }
{{/unless}} {{/unless}}
{{/unless}} {{/unless}}
......
...@@ -19,7 +19,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; ...@@ -19,7 +19,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import net.ibizsys.central.util.ISearchContextDTO; import net.ibizsys.central.util.ISearchContextDTO;
import net.ibizsys.model.dataentity.action.IPSDEAction; import net.ibizsys.model.dataentity.action.IPSDEAction;
import net.ibizsys.model.dataentity.ds.IPSDEDataSet; import net.ibizsys.model.dataentity.ds.IPSDEDataSet;
import net.ibizsys.central.plugin.boot.core.service.IBaseService; import net.ibizsys.central.plugin.boot.core.service.IServiceApiService;
import net.ibizsys.central.plugin.boot.core.helper.CachedBeanCopier; import net.ibizsys.central.plugin.boot.core.helper.CachedBeanCopier;
import net.ibizsys.central.plugin.boot.core.helper.SpringContextHolder; import net.ibizsys.central.plugin.boot.core.helper.SpringContextHolder;
import net.ibizsys.central.dataentity.IDataEntityRuntimeContext; import net.ibizsys.central.dataentity.IDataEntityRuntimeContext;
...@@ -35,7 +35,7 @@ import {{packageName}}.{{module}}.service.{{codeName}}Service; ...@@ -35,7 +35,7 @@ import {{packageName}}.{{module}}.service.{{codeName}}Service;
{{#dsName}} {{#dsName}}
@DS("{{entity.dataSource}}") @DS("{{entity.dataSource}}")
{{/dsName}} {{/dsName}}
public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeName}}, {{entity.codeName}}SearchContext> { public interface {{entity.codeName}}Service extends IServiceApiService<{{entity.codeName}}, {{entity.codeName}}SearchContext> {
@Override @Override
default String getDataEntityId() { default String getDataEntityId() {
...@@ -47,31 +47,31 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa ...@@ -47,31 +47,31 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
} }
default boolean create({{entity.codeName}} dto) throws Throwable { default boolean create({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.create(dto); return IServiceApiService.super.create(dto);
} }
default boolean onCreate({{entity.codeName}} dto) throws Throwable { default boolean onCreate({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.onCreate(dto); return IServiceApiService.super.onCreate(dto);
} }
{{#enableEntityCache}} {{#enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true) @CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}} {{/enableEntityCache}}
default boolean update({{entity.codeName}} dto) throws Throwable { default boolean update({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.update(dto); return IServiceApiService.super.update(dto);
} }
{{#enableEntityCache}} {{#enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true) @CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}} {{/enableEntityCache}}
default boolean onUpdate({{entity.codeName}} dto) throws Throwable { default boolean onUpdate({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.onUpdate(dto); return IServiceApiService.super.onUpdate(dto);
} }
{{#enableEntityCache}} {{#enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true) @CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}} {{/enableEntityCache}}
default boolean remove({{entity.keyField.type.java}} key) throws Throwable { default boolean remove({{entity.keyField.type.java}} key) throws Throwable {
return IBaseService.super.remove(key); return IServiceApiService.super.remove(key);
} }
{{#enableEntityCache}} {{#enableEntityCache}}
...@@ -80,81 +80,85 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa ...@@ -80,81 +80,85 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
default boolean onRemove({{entity.keyField.type.java}} key) throws Throwable { default boolean onRemove({{entity.keyField.type.java}} key) throws Throwable {
List keys=new ArrayList(); List keys=new ArrayList();
keys.add(key); keys.add(key);
return IBaseService.super.onRemove(keys); return IServiceApiService.super.onRemove(keys);
} }
{{#enableEntityCache}} {{#enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true) @CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}} {{/enableEntityCache}}
default boolean remove(List keys) throws Throwable { default boolean remove(List keys) throws Throwable {
return IBaseService.super.remove(keys); return IServiceApiService.super.remove(keys);
} }
{{#enableEntityCache}} {{#enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true) @CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}} {{/enableEntityCache}}
default boolean onRemove(List keys) throws Throwable { default boolean onRemove(List keys) throws Throwable {
return IBaseService.super.onRemove(keys); return IServiceApiService.super.onRemove(keys);
} }
default {{entity.codeName}} get({{entity.keyField.type.java}} key) throws Throwable { default {{entity.codeName}} get({{entity.keyField.type.java}} key) throws Throwable {
return IBaseService.super.get(key); return IServiceApiService.super.get(key);
} }
default {{entity.codeName}} onGet({{entity.keyField.type.java}} key) throws Throwable { default {{entity.codeName}} onGet({{entity.keyField.type.java}} key) throws Throwable {
return IBaseService.super.onGet(key); return IServiceApiService.super.onGet(key);
} }
default {{entity.codeName}} getDraft({{entity.codeName}} dto) throws Throwable { default {{entity.codeName}} getDraft({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.getDraft(dto); return IServiceApiService.super.getDraft(dto);
} }
default {{entity.codeName}} onGetDraft({{entity.codeName}} dto) throws Throwable { default {{entity.codeName}} onGetDraft({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.onGetDraft(dto); return IServiceApiService.super.onGetDraft(dto);
} }
default Integer checkKey({{entity.codeName}} dto) throws Throwable { default Integer checkKey({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.checkKey(dto); return IServiceApiService.super.checkKey(dto);
} }
default Integer onCheckKey({{entity.codeName}} dto) throws Throwable { default Integer onCheckKey({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.onCheckKey(dto); return IServiceApiService.super.onCheckKey(dto);
} }
{{#enableEntityCache}} {{#enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true) @CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}} {{/enableEntityCache}}
default boolean save({{entity.codeName}} dto) throws Throwable { default boolean save({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.save(dto); return IServiceApiService.super.save(dto);
} }
{{#enableEntityCache}} {{#enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true) @CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}} {{/enableEntityCache}}
default boolean onSave({{entity.codeName}} dto) throws Throwable { default boolean onSave({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.onSave(dto); return IServiceApiService.super.onSave(dto);
} }
{{#each entity.extActions}} {{#each entity.extActions}}
default {{outParam}} {{camelCase codeName}}({{inParam}} {{inParamName}}) throws Throwable { default {{outParam}} {{camelCase codeName}}({{inParam}} {{inParamName}}) throws Throwable {
{{#if voidReturn}} {{#if voidReturn}}
IBaseService.super.callAction("{{codeName}}",{{inParamName}}); IServiceApiService.super.callAction("{{codeName}}",{{inParamName}});
return {{inParamName}}; return {{inParamName}};
{{else}} {{else}}
IBaseService.super.beforeAction("{{codeName}}",{{inParamName}}); IServiceApiService.super.beforeAction("{{codeName}}",{{inParamName}});
{{outParam}} rt = ({{outParam}})IBaseService.super.forwardAction("{{name}}",{{inParamName}}); {{outParam}} rt = ({{outParam}})IServiceApiService.super.forwardAction("{{name}}",{{inParamName}});
if(rt!=null) if(rt!=null)
IBaseService.super.afterAction("{{codeName}}",rt); IServiceApiService.super.afterAction("{{codeName}}",rt);
return rt; return rt;
{{/if}} {{/if}}
} }
default {{outParam}} on{{pascalCase codeName}}({{inParam}} {{inParamName}}) throws Throwable { default {{outParam}} on{{pascalCase codeName}}({{inParam}} {{inParamName}}) throws Throwable {
{{#if voidReturn}} {{#if voidReturn}}
IBaseService.super.onRealAction("{{codeName}}",{{inParamName}}); IServiceApiService.super.onRealAction("{{codeName}}",{{inParamName}});
return {{inParamName}}; return {{inParamName}};
{{else}} {{else}}
return ({{outParam}})IBaseService.super.onRealAction("{{codeName}}",{{inParamName}}); {{#if listReturn}}
return IServiceApiService.super.onRealActionList("{{codeName}}",{{inParamName}},{{typeReturn}}.class);
{{else}}
return IServiceApiService.super.onRealAction("{{codeName}}",{{inParamName}},{{outParam}}.class);
{{/if}}
{{/if}} {{/if}}
} }
...@@ -162,12 +166,12 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa ...@@ -162,12 +166,12 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
{{#entity.dataSets}} {{#entity.dataSets}}
default Page<{{entity.codeName}}> fetch{{pascalCase codeName}}({{entity.codeName}}SearchContext dto) throws Throwable { default Page<{{entity.codeName}}> fetch{{pascalCase codeName}}({{entity.codeName}}SearchContext dto) throws Throwable {
IBaseService.super.beforeFetch("{{codeName}}",dto); IServiceApiService.super.beforeFetch("{{codeName}}",dto);
return (Page) IBaseService.super.forwardFetch("{{name}}",dto); return (Page) IServiceApiService.super.forwardFetch("{{name}}",dto);
} }
default Page<{{entity.codeName}}> onFetch{{pascalCase codeName}}({{entity.codeName}}SearchContext dto) throws Throwable { default Page<{{entity.codeName}}> onFetch{{pascalCase codeName}}({{entity.codeName}}SearchContext dto) throws Throwable {
return (Page) IBaseService.super.onRealFetch("{{name}}",dto); return (Page) IServiceApiService.super.onRealFetch("{{name}}",dto);
} }
{{/entity.dataSets}} {{/entity.dataSets}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册