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

接口实体

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