提交 226656b2 编写于 作者: sq3536's avatar sq3536

action

上级 239662ae
......@@ -156,7 +156,7 @@
<dependency>
<groupId>net.ibizsys.model</groupId>
<artifactId>ibiz-model</artifactId>
<version>0.2.2</version>
<version>0.2.3</version>
<exclusions>
<exclusion>
<artifactId>slf4j-simple</artifactId>
......
......@@ -11,6 +11,9 @@ import lombok.Setter;
import lombok.experimental.Accessors;
import net.ibizsys.model.dataentity.ds.IPSDEDataSet;
import java.util.ArrayList;
import java.util.List;
/**
* 实体[数据集]
*/
......@@ -46,6 +49,9 @@ public class DataSetModel extends BaseModel{
this.setId(String.format("%1$s-%2$s",entity.getCodeName(),codeName));
return this;
}
private String dsType;
/**
* 代码
*/
......@@ -60,6 +66,24 @@ public class DataSetModel extends BaseModel{
return (IPSDEDataSet)opt;
}
private String select="";
private String from="";
private String groupBy="";
private String orderBy="";
private List<String> queries;
public DataSetModel addQueries(String queryCodeName)
{
if(queries==null)
queries=new ArrayList<>();
queries.add(queryCodeName);
return this;
}
}
......@@ -7,6 +7,7 @@ import lombok.Setter;
import lombok.experimental.Accessors;
import net.ibizsys.model.dataentity.defield.IPSDEField;
import net.ibizsys.model.dataentity.der.IPSDERBase;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
......@@ -20,18 +21,29 @@ public class RelationshipModel extends BaseModel{
public RelationshipModel(EntityModel entityModel, IPSDERBase der)
{
this.opt=der;
this.entity=entityModel;
this.ownerEntity=entityModel;
this.setName(der.getName());
}
@Override
public RelationshipModel setCodeName(String codeName) {
super.setCodeName(codeName);
this.setId(String.format("%1$s-%2$s",entity.getCodeName(),codeName));
this.setId(String.format("%1$s-%2$s",ownerEntity.getCodeName(),codeName));
return this;
}
private EntityModel entity;
private EntityModel ownerEntity;
private EntityModel relEntity;
public EntityModel getRelEntity()
{
if(relEntity==null&&ownerEntity!=null&&(!StringUtils.isEmpty(entityCodeName)))
{
relEntity=ownerEntity.getSystem().getEntity(entityCodeName);
}
return relEntity;
}
private String entityName;
......
......@@ -16,6 +16,7 @@ import net.ibizsys.model.dataentity.ds.IPSDEDataQueryCode;
import net.ibizsys.model.dataentity.ds.IPSDEDataQueryCodeCond;
import net.ibizsys.model.dataentity.ds.IPSDEDataSetGroupParam;
import net.ibizsys.model.dataentity.ds.PSDEDataSetGroupParamImpl;
import net.ibizsys.model.pub.IPSSysSFPub;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
......@@ -33,12 +34,32 @@ public class SystemModel extends BaseModel {
public SystemModel(IPSSystem system)
{
this.opt=system;
this.setCodeName(system.getCodeName());
this.setName(system.getName());
getEntitiesMap();
system.getAllPSSystemModules().forEach(item->{
});
if(!ObjectUtils.isEmpty(system.getAllPSSysSFPubs()))
{
system.getAllPSSysSFPubs().forEach(pub->{
if(pub.isMainPSSysSFPub())
this.pub=pub;
});
if(this.pub==null)
this.pub=system.getAllPSSysSFPubs().get(0);
}
if(this.pub!=null)
{
this.setCodeName(this.pub.getCodeName());
this.setName(this.pub.getName());
this.setPackageName(this.pub.getPKGCodeName());
}
else
{
this.setCodeName(system.getCodeName());
this.setName(system.getName());
this.setPackageName(system.getCodeName().toLowerCase());
}
getEntitiesMap();
}
public IPSSystem getSystem()
......@@ -48,18 +69,15 @@ public class SystemModel extends BaseModel {
public String getProjectName()
{
return getSystem().getCodeName().toLowerCase();
return this.codeName.toLowerCase();
}
public String getProjectDesc()
{
return getSystem().getName();
return this.name;
}
public String getPackageName()
{
return getSystem().getCodeName().toLowerCase();
}
private String packageName;
private boolean enableDS=false;
private boolean enableES=false;
......@@ -72,6 +90,8 @@ public class SystemModel extends BaseModel {
private boolean enablePostgreSQL=false;
private boolean enableDyna=false;
private IPSSysSFPub pub;
private Map<String,EntityModel> entitiesMap;
public synchronized Map<String, EntityModel> getEntitiesMap() {
if(entitiesMap==null) {
......
......@@ -283,10 +283,10 @@ public class TransUtils {
order++;
}
if(entityModel.getDataSets()!=null)
if(entityModel.getQueries()!=null)
{
entityModel.getDataSets().forEach(dataSet->{
entityModel.getQueries().forEach(dataSet->{
if(dataSet.getDatasetId().startsWith(entityModel.getEntityName().toLowerCase()+"-")&&dataSet.getDatasetId().endsWith(dataSourceType))
{
......
......@@ -21,9 +21,9 @@ impott om.baomidou.dynamic.datasource.annotation.DS;
import {{packageName}}.{{entity.module}}.domain.{{entity.codeName}};
import {{packageName}}.{{entity.module}}.filter.{{entity.codeName}}SearchContext;
{{#dataSource}}
{{#dsName}}
@DS("{{entity.dataSource}}")
{{/dataSource}}
{{/dsName}}
public interface I{{entity.codeName}}Service extends IService<{{entity.codeName}}> {
{{entity.codeName}} get({{entity.keyField.type.java}} key);
......@@ -63,14 +63,21 @@ public interface I{{entity.codeName}}Service extends IService<{{entity.codeName}
boolean {{codeName.camelCase}}Batch(List<{{entity.codeName}}> list);
{{/entity.actions}}
{{#entity.dataSets}}
Page<{{entity.codeName}}> search{{codeName}}({{entity.codeName}}SearchContext context);
List<{{entity.codeName}}> list{{codeName}}({{entity.codeName}}SearchContext context);
{{/entity.dataSets}}
{{#entity.references}}
List<{{entity.codeName}}> selectBy{{fkField.codeName.pascalCase}}({{fkField.type.java}} {{fkField.codeName.camelCase}});
{{#enableEntityCache}}
@CacheEvict(value = "{{entity.codeName.lowerCase}}", allEntries = true)
{{/enableEntityCache}}
boolean removeBy{{fkField.codeName.pascalCase}}({{fkField.type.java}} {{fkField.codeName.camelCase}});
{{#enableEntityCache}}
@CacheEvict(value = "{{entity.codeName.lowerCase}}", allEntries = true)
{{/enableEntityCache}}
boolean saveBy{{fkField.codeName.pascalCase}}({{fkField.type.java}} {{fkField.codeName.camelCase}},List<{{entity.codeName}}> list);
{{/entity.references}}
}
\ No newline at end of file
package {{packageName}}.core.{{entity.module}}.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import {{packageName}}.util.errors.BadRequestAlertException;
<#system.enableGlobalTransaction>
import io.seata.spring.annotation.GlobalTransactional;
</system.enableGlobalTransaction>
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import {{packageName}}.core.{{entity.module}}.domain.{{entity.codeName}};
import {{packageName}}.core.{{entity.module}}.filter.{{entity.codeName}}SearchContext;
import {{packageName}}.core.{{entity.module}}.service.I{{entity.codeName}}Service;
import {{packageName}}.core.{{entity.module}}.mapper.${item.getCodeName()}Mapper;
import {{packageName}}.util.helper.CachedBeanCopier;
import {{packageName}}.util.helper.DEFieldCacheMap;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
public class {{entity.codeName}}ServiceImpl implements I{{entity.codeName}}Service
{
}
\ No newline at end of file
......@@ -346,31 +346,63 @@
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
</dependency>
{{/system.enableDS}}
{{/system.enableDS}}
{{#system.enableES}}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
{{/system.enableES}}
{{/system.enableES}}
{{#system.enableMQ}}
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId>
<version>${rocketmq.version}</version>
</dependency>
{{/system.enableMQ}}
{{/system.enableMQ}}
{{#system.enableGlobalTransaction}}
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>${r'${alibaba-seata.version}'}</version>
<exclusions>
<exclusion>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
<version>${r'${spring-cloud-alibaba.version}'}</version>
<exclusions>
<exclusion>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
{{/system.enableGlobalTransaction}}
{{#system.enableOAuth2}}
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.6.RELEASE</version>
</dependency>
{{/system.enableGlobalTransaction}}
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.0.10.RELEASE</version>
</dependency>
{{/system.enableOAuth2}}
{{#system.enableOracle}}
<!-- Oracle驱动包 -->
<dependency>
......@@ -378,11 +410,13 @@
<artifactId>ojdbc8</artifactId>
<version>${oracle.version}</version>
</dependency>
<dependency>
<groupId>com.oracle.database.nls</groupId>
<artifactId>orai18n</artifactId>
<version>${oracle.version}</version>
</dependency>
{{/system.enableOracle}}
{{#system.enablePostgreSQL}}
<!-- PostgreSQL驱动包 -->
......@@ -391,6 +425,7 @@
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
{{/system.enablePostgreSQL}}
{{#system.enableMysql}}
<!-- MySQL驱动包 -->
......@@ -398,6 +433,7 @@
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
{{/system.enableMysql}}
</dependencies>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册