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

129

上级 8c0967f8
......@@ -45,7 +45,7 @@ public class SystemModel extends BaseModel {
}
if (this.pub != null) {
this.setCodeName(this.pub.getCodeName());
this.setName(this.pub.getName());
this.setName(system.getName());
this.setProjectName(this.pub.getCodeName().toLowerCase());
this.setProjectDesc(this.pub.getName());
this.setPackageName(this.pub.getPKGCodeName());
......
......@@ -11,10 +11,13 @@
<packaging>pom</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.0</version>
<groupId>net.ibizsys.plugin</groupId>
<artifactId>ibiz-boot-starter-parent</artifactId>
<version>2.4.0-SNAPSHOT</version>
</parent>
<properties>
<ibiz.cloud.version>8.1.0.133</ibiz.cloud.version>
</properties>
<modules>
<module>{{projectName}}-core</module>
<!-- boot -->
......
......@@ -17,7 +17,6 @@
<dependency>
<groupId>net.ibizsys.plugin</groupId>
<artifactId>ibiz-boot-starter</artifactId>
<version>2.4.0.132</version>
</dependency>
<!-- Liquibase -->
......@@ -35,6 +34,10 @@
</dependency>
</dependencies>
<properties>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
</properties>
<profiles>
<profile>
<id>diff</id>
......
package {{packageName}}.runtime;
import net.ibizsys.central.plugin.boot.core.runtime.IBootSystemRuntime;
public interface ISystemRuntime extends IBootSystemRuntime {
}
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 SystemRuntime extends SystemRuntimeBase {
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
}
{{#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 {
IBaseService.super.beforeAction("{{codeName}}",dto);
this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{dto}, true);
IBaseService.super.afterAction("{{codeName}}",dto);
return true;
}
......@@ -145,24 +160,13 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
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}}
{{/each}}
{{#entity.dataSets}}
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);
}
......
......@@ -136,8 +136,23 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName
}
{{#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 {
IMPService.super.beforeAction("{{codeName}}",dto);
this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{dto}, true);
IMPService.super.afterAction("{{codeName}}",dto);
return true;
}
......@@ -146,24 +161,13 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName
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}}
{{/each}}
{{#entity.dataSets}}
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);
}
......
......@@ -135,8 +135,23 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
}
{{#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 {
IBaseService.super.beforeAction("{{codeName}}",dto);
this.getRuntimeService().getDataEntityRuntime().executeAction("{{name}}", null, new Object[]{dto}, true);
IBaseService.super.afterAction("{{codeName}}",dto);
return true;
}
......@@ -145,24 +160,13 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
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}}
{{/each}}
{{#entity.dataSets}}
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);
}
......
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 @@
public class XXXServiceImpl extends MPServiceImpl<XXX,XXXSearchContext,XXXMapper> implements XXXService {
//示例1:整体重写create方法
public boolean create(XXX et) {
if(!XXXService.supper.create(et))
public boolean create(XXX et) throws Throwable {
if(!XXXService.super.create(et))
return false;
return true;
}
......@@ -27,8 +27,8 @@ public class XXXServiceImpl extends MPServiceImpl<XXX,XXXSearchContext,XXXMapper
public void beforeUpdate(XXX et) {
et.setMemo("示例");
}
public boolean onUpdate(XXX et) {
if(!XXXService.supper.onUpdate(et))
public boolean onUpdate(XXX et) throws Throwable {
if(!XXXService.super.onUpdate(et))
return false;
return true;
}
......@@ -41,8 +41,8 @@ public class XXXServiceImpl extends MPServiceImpl<XXX,XXXSearchContext,XXXMapper
public void beforeFetchDefault(XXXSearchContext dto) {
dto.eq("field1","条件值");
}
public Page<XXX> onFetchDefault(XXXSearchContext dto) {
return XXXService.supper.onFetchDefault(dto);
public Page<XXX> onFetchDefault(XXXSearchContext dto) throws Throwable {
return XXXService.super.onFetchDefault(dto);
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册