提交 8cf03901 编写于 作者: sq3536's avatar sq3536

129

上级 8c0967f8
...@@ -45,7 +45,7 @@ public class SystemModel extends BaseModel { ...@@ -45,7 +45,7 @@ public class SystemModel extends BaseModel {
} }
if (this.pub != null) { if (this.pub != null) {
this.setCodeName(this.pub.getCodeName()); this.setCodeName(this.pub.getCodeName());
this.setName(this.pub.getName()); this.setName(system.getName());
this.setProjectName(this.pub.getCodeName().toLowerCase()); this.setProjectName(this.pub.getCodeName().toLowerCase());
this.setProjectDesc(this.pub.getName()); this.setProjectDesc(this.pub.getName());
this.setPackageName(this.pub.getPKGCodeName()); this.setPackageName(this.pub.getPKGCodeName());
......
...@@ -11,10 +11,13 @@ ...@@ -11,10 +11,13 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>net.ibizsys.plugin</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>ibiz-boot-starter-parent</artifactId>
<version>2.4.0</version> <version>2.4.0-SNAPSHOT</version>
</parent> </parent>
<properties>
<ibiz.cloud.version>8.1.0.133</ibiz.cloud.version>
</properties>
<modules> <modules>
<module>{{projectName}}-core</module> <module>{{projectName}}-core</module>
<!-- boot --> <!-- boot -->
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
<dependency> <dependency>
<groupId>net.ibizsys.plugin</groupId> <groupId>net.ibizsys.plugin</groupId>
<artifactId>ibiz-boot-starter</artifactId> <artifactId>ibiz-boot-starter</artifactId>
<version>2.4.0.132</version>
</dependency> </dependency>
<!-- Liquibase --> <!-- Liquibase -->
...@@ -35,6 +34,10 @@ ...@@ -35,6 +34,10 @@
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
</properties>
<profiles> <profiles>
<profile> <profile>
<id>diff</id> <id>diff</id>
......
package {{packageName}}.runtime;
import net.ibizsys.central.plugin.boot.core.runtime.IBootSystemRuntime;
public interface ISystemRuntime extends IBootSystemRuntime {
}
package {{packageName}}.runtime; package {{packageName}}.runtime;
import net.ibizsys.central.dataentity.IDataEntityRuntime; public class SystemRuntime extends SystemRuntimeBase {
import net.ibizsys.central.dataentity.service.IDEService;
import net.ibizsys.model.IPSDynaInstService;
import net.ibizsys.model.IPSSystemService;
import net.ibizsys.model.PSModelServiceImpl;
import net.ibizsys.model.res.IPSSysUtil;
import net.ibizsys.central.sysutil.SysUtilRuntimeBase;
import net.ibizsys.runtime.res.ISysUtilRuntime;
import net.ibizsys.central.plugin.boot.core.runtime.BootSystemRuntime;
public class SystemRuntime extends BootSystemRuntime {
@Override
public String getName() {
return "{{system.name}}";
}
@Override
protected IPSSystemService createPSSystemService() throws Exception {
PSModelServiceImpl psModelServiceImpl = new PSModelServiceImpl();
psModelServiceImpl.setPSModelFolderPath("/model/{{replace packageName "." "/"}}", true);
return psModelServiceImpl;
}
{{#if system.allPSSysUtils}}
@Override
protected ISysUtilRuntime createDefaultSysUtilRuntime(IPSSysUtil iPSSysUtil) {
{{#each system.allPSSysUtils as |sysUtil|}}
{{#if (and (eq sysUtil.utilType "USER")) (unless sysUtil.pSSysSFPlugin)}}
if(iPSSysUtil.getCodeName().equals("{{sysUtil.codeName}}"))
return new {{packageName}}.runtime.sysutil.{{sysUtil.codeName}}();
{{/if}}
{{/each}}
return super.createDefaultSysUtilRuntime(iPSSysUtil);
}
{{/if}}
} }
package {{packageName}}.runtime;
import net.ibizsys.central.dataentity.IDataEntityRuntime;
import net.ibizsys.central.dataentity.service.IDEService;
import net.ibizsys.model.IPSDynaInstService;
import net.ibizsys.model.IPSSystemService;
import net.ibizsys.model.PSModelServiceImpl;
import net.ibizsys.model.res.IPSSysUtil;
import net.ibizsys.central.sysutil.SysUtilRuntimeBase;
import net.ibizsys.runtime.res.ISysUtilRuntime;
import net.ibizsys.central.plugin.boot.core.runtime.BootSystemRuntime;
public class SystemRuntimeBase extends BootSystemRuntime implements ISystemRuntime{
@Override
public String getName() {
return "{{system.name}}";
}
@Override
protected IPSSystemService createPSSystemService() throws Exception {
PSModelServiceImpl psModelServiceImpl = new PSModelServiceImpl();
psModelServiceImpl.setPSModelFolderPath("/model/{{replace packageName "." "/"}}", true);
return psModelServiceImpl;
}
{{#if system.allPSSysUtils}}
@Override
protected ISysUtilRuntime createDefaultSysUtilRuntime(IPSSysUtil iPSSysUtil) {
{{#each system.allPSSysUtils as |sysUtil|}}
{{#if (and (eq sysUtil.utilType "USER")) (unless sysUtil.pSSysSFPlugin)}}
if(iPSSysUtil.getCodeName().equals("{{sysUtil.codeName}}"))
return new {{packageName}}.runtime.sysutil.{{sysUtil.codeName}}();
{{/if}}
{{/each}}
return super.createDefaultSysUtilRuntime(iPSSysUtil);
}
{{/if}}
}
...@@ -135,8 +135,23 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa ...@@ -135,8 +135,23 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
} }
{{#each entity.extActions}} {{#each entity.extActions}}
{{#if action}}
default {{entity.codeName}} {{camelCase codeName}}({{entity.keyField.type.java}} key) {
{{entity.codeName}} dto = this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{key}, true);
if(dto!=null)
afterAction("{{codeName}}",dto);
return dto;
}
default {{entity.codeName}} on{{pascalCase codeName}}({{entity.keyField.type.java}} key) {
return this.getDataEntityRuntimeContext().executeActionReal("{{name}}", null, new Object[]{key}, null);;
}
{{else}}
default boolean {{camelCase codeName}}({{entity.codeName}} dto) throws Throwable { default boolean {{camelCase codeName}}({{entity.codeName}} dto) throws Throwable {
IBaseService.super.beforeAction("{{codeName}}",dto);
this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{dto}, true); this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{dto}, true);
IBaseService.super.afterAction("{{codeName}}",dto);
return true; return true;
} }
...@@ -145,24 +160,13 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa ...@@ -145,24 +160,13 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
return true; return true;
} }
{{#if action}}
default {{entity.codeName}} {{camelCase codeName}}({{entity.keyField.type.java}} key) {
{{entity.codeName}} dto = new {{entity.codeName}}();
dto.set{{pascalCase entity.keyField.codeName}}(key);
return {{camelCase codeName}}(dto);
}
default {{entity.codeName}} on{{pascalCase codeName}}({{entity.keyField.type.java}} key) {
{{entity.codeName}} dto = new {{entity.codeName}}();
dto.set{{pascalCase entity.keyField.codeName}}(key);
return on{{pascalCase codeName}}(dto);
}
{{/if}} {{/if}}
{{/each}} {{/each}}
{{#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);
return (Page) this.getRuntimeService().getDataEntityRuntime().fetchDataSet("{{name}}", dto.getDataSet(), new Object[]{dto}, true); return (Page) this.getRuntimeService().getDataEntityRuntime().fetchDataSet("{{name}}", dto.getDataSet(), new Object[]{dto}, true);
} }
......
...@@ -136,8 +136,23 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName ...@@ -136,8 +136,23 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName
} }
{{#each entity.extActions}} {{#each entity.extActions}}
{{#if action}}
default {{entity.codeName}} {{camelCase codeName}}({{entity.keyField.type.java}} key) {
{{entity.codeName}} dto = this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{key}, true);
if(dto!=null)
afterAction("{{codeName}}",dto);
return dto;
}
default {{entity.codeName}} on{{pascalCase codeName}}({{entity.keyField.type.java}} key) {
return this.getDataEntityRuntimeContext().executeActionReal("{{name}}", null, new Object[]{key}, null);;
}
{{else}}
default boolean {{camelCase codeName}}({{entity.codeName}} dto) throws Throwable { default boolean {{camelCase codeName}}({{entity.codeName}} dto) throws Throwable {
IMPService.super.beforeAction("{{codeName}}",dto);
this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{dto}, true); this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{dto}, true);
IMPService.super.afterAction("{{codeName}}",dto);
return true; return true;
} }
...@@ -146,24 +161,13 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName ...@@ -146,24 +161,13 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName
return true; return true;
} }
{{#if action}}
default {{entity.codeName}} {{camelCase codeName}}({{entity.keyField.type.java}} key) {
{{entity.codeName}} dto = new {{entity.codeName}}();
dto.set{{pascalCase entity.keyField.codeName}}(key);
return {{camelCase codeName}}(dto);
}
default {{entity.codeName}} on{{pascalCase codeName}}({{entity.keyField.type.java}} key) {
{{entity.codeName}} dto = new {{entity.codeName}}();
dto.set{{pascalCase entity.keyField.codeName}}(key);
return on{{pascalCase codeName}}(dto);
}
{{/if}} {{/if}}
{{/each}} {{/each}}
{{#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 {
IMPService.super.beforeFetch("{{codeName}}",dto);
return (Page) this.getRuntimeService().getDataEntityRuntime().fetchDataSet("{{name}}", dto.getDataSet(), new Object[]{dto}, true); return (Page) this.getRuntimeService().getDataEntityRuntime().fetchDataSet("{{name}}", dto.getDataSet(), new Object[]{dto}, true);
} }
......
...@@ -135,8 +135,23 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa ...@@ -135,8 +135,23 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
} }
{{#each entity.extActions}} {{#each entity.extActions}}
{{#if action}}
default {{entity.codeName}} {{camelCase codeName}}({{entity.keyField.type.java}} key) {
{{entity.codeName}} dto = this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{key}, true);
if(dto!=null)
afterAction("{{codeName}}",dto);
return dto;
}
default {{entity.codeName}} on{{pascalCase codeName}}({{entity.keyField.type.java}} key) {
return this.getDataEntityRuntimeContext().executeActionReal("{{name}}", null, new Object[]{key}, null);;
}
{{else}}
default boolean {{camelCase codeName}}({{entity.codeName}} dto) throws Throwable { default boolean {{camelCase codeName}}({{entity.codeName}} dto) throws Throwable {
IBaseService.super.beforeAction("{{codeName}}",dto);
this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{dto}, true); this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{dto}, true);
IBaseService.super.afterAction("{{codeName}}",dto);
return true; return true;
} }
...@@ -145,24 +160,13 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa ...@@ -145,24 +160,13 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
return true; return true;
} }
{{#if action}}
default {{entity.codeName}} {{camelCase codeName}}({{entity.keyField.type.java}} key) {
{{entity.codeName}} dto = new {{entity.codeName}}();
dto.set{{pascalCase entity.keyField.codeName}}(key);
return {{camelCase codeName}}(dto);
}
default {{entity.codeName}} on{{pascalCase codeName}}({{entity.keyField.type.java}} key) {
{{entity.codeName}} dto = new {{entity.codeName}}();
dto.set{{pascalCase entity.keyField.codeName}}(key);
return on{{pascalCase codeName}}(dto);
}
{{/if}} {{/if}}
{{/each}} {{/each}}
{{#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);
return (Page) this.getRuntimeService().getDataEntityRuntime().fetchDataSet("{{name}}", dto.getDataSet(), new Object[]{dto}, true); return (Page) this.getRuntimeService().getDataEntityRuntime().fetchDataSet("{{name}}", dto.getDataSet(), new Object[]{dto}, true);
} }
......
spring:
cloud:
nacos:
discovery:
server-addr: nacos.ibizcloud.cn:8848
group: ibiz_config_group
config:
server-addr: nacos.ibizcloud.cn:8848
group: ibiz_config_group
file-extension: yaml
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
public class XXXServiceImpl extends MPServiceImpl<XXX,XXXSearchContext,XXXMapper> implements XXXService { public class XXXServiceImpl extends MPServiceImpl<XXX,XXXSearchContext,XXXMapper> implements XXXService {
//示例1:整体重写create方法 //示例1:整体重写create方法
public boolean create(XXX et) { public boolean create(XXX et) throws Throwable {
if(!XXXService.supper.create(et)) if(!XXXService.super.create(et))
return false; return false;
return true; return true;
} }
...@@ -27,8 +27,8 @@ public class XXXServiceImpl extends MPServiceImpl<XXX,XXXSearchContext,XXXMapper ...@@ -27,8 +27,8 @@ public class XXXServiceImpl extends MPServiceImpl<XXX,XXXSearchContext,XXXMapper
public void beforeUpdate(XXX et) { public void beforeUpdate(XXX et) {
et.setMemo("示例"); et.setMemo("示例");
} }
public boolean onUpdate(XXX et) { public boolean onUpdate(XXX et) throws Throwable {
if(!XXXService.supper.onUpdate(et)) if(!XXXService.super.onUpdate(et))
return false; return false;
return true; return true;
} }
...@@ -41,8 +41,8 @@ public class XXXServiceImpl extends MPServiceImpl<XXX,XXXSearchContext,XXXMapper ...@@ -41,8 +41,8 @@ public class XXXServiceImpl extends MPServiceImpl<XXX,XXXSearchContext,XXXMapper
public void beforeFetchDefault(XXXSearchContext dto) { public void beforeFetchDefault(XXXSearchContext dto) {
dto.eq("field1","条件值"); dto.eq("field1","条件值");
} }
public Page<XXX> onFetchDefault(XXXSearchContext dto) { public Page<XXX> onFetchDefault(XXXSearchContext dto) throws Throwable {
return XXXService.supper.onFetchDefault(dto); return XXXService.super.onFetchDefault(dto);
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册