提交 2f5d80cf 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码

上级 170e9e6f
......@@ -115,13 +115,6 @@
</app-form-item>
</i-col>
<i-col v-show="detailsModel.lookup.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-item name='lookup' :itemRules="this.rules().lookup" class='' :caption="$t('entities.metarelationship.main_form.details.lookup')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.lookup.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.lookup" :textareaId="this.$util.createUUID()" :disabled="detailsModel.lookup.disabled" type='textarea' textareaStyle="height:200px;" ></input-box>
</app-form-item>
</i-col>
</row>
......
......@@ -83,7 +83,7 @@ export default class MainModel {
{
name: 'lookup',
prop: 'lookup',
dataType: 'LONGTEXT_1000',
dataType: 'ONE2MANYDATA',
},
{
name: 'refentityid',
......
......@@ -37,11 +37,6 @@
git clone -b master $para2 ibzlite/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzlite/
mvn clean package -Pweb
cd ibzlite-app/ibzlite-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzlite-app-web.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzlite-app-web.jar
EXPOSE 30010
EXPOSE 8080
ADD ibzlite-app-web.jar /ibzlite-app-web.jar
......@@ -3,22 +3,9 @@ services:
ibzlite-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzlite-app-web:latest
ports:
- "30010:30010"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
- SERVER_PORT=30010
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
- SPRING_DATASOURCE_PASSWORD=@6dEfb3@
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
- NACOS=172.16.102.211:8848
deploy:
resources:
limits:
......
package cn.ibizlab.core.lite.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
/**
* [lookup] 对象
*/
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class DstLookup extends EntityBase implements Serializable {
/**
* 标识
*/
@DEField(isKeyField=true)
@JSONField(name = "id")
@JsonProperty("id")
private String id;
/**
* 关系标识
*/
@JSONField(name = "relationId")
@JsonProperty("relationId")
private String relationid;
/**
* 属性名称
*/
@JSONField(name = "fieldName")
@JsonProperty("fieldName")
private String fieldname;
/**
* 引用属性名称
*/
@JSONField(name = "refFieldName")
@JsonProperty("refFieldName")
private String reffieldname;
/**
*
*/
@JSONField(name = "relation")
@JsonProperty("relation")
private cn.ibizlab.core.lite.domain.MetaRelationship relation;
}
......@@ -114,13 +114,6 @@ public class MetaRelationship extends EntityMP implements Serializable {
@JSONField(name = "system_id")
@JsonProperty("system_id")
private String systemId;
/**
* Lookup
*/
@TableField(value = "lookup")
@JSONField(name = "lookup")
@JsonProperty("lookup")
private String lookup;
/**
*
......@@ -139,6 +132,21 @@ public class MetaRelationship extends EntityMP implements Serializable {
private cn.ibizlab.core.lite.domain.MetaEntity reference;
/**
* lookup
*/
@JSONField(name = "lookups")
@JsonProperty("lookups")
@TableField(value = "lookup" , typeHandler = cn.ibizlab.core.lite.domain.handlers.DstLookupTypeHandler.class)
private List<cn.ibizlab.core.lite.domain.DstLookup> lookup;
/**
* 设置 [lookup]
*/
public void setLookup(List<cn.ibizlab.core.lite.domain.DstLookup> lookup){
this.lookup = lookup ;
this.modify("lookup",(lookup!=null)?lookup:(new ArrayList()));
}
/**
* 设置 [关系名称]
......@@ -204,14 +212,6 @@ public class MetaRelationship extends EntityMP implements Serializable {
this.modify("nestedname",nestedName);
}
/**
* 设置 [Lookup]
*/
public void setLookup(String lookup){
this.lookup = lookup ;
this.modify("lookup",lookup);
}
/**
* 获取 [关系标识]
......
package cn.ibizlab.core.lite.domain.handlers;
import cn.ibizlab.core.lite.domain.DstLookup;
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@MappedTypes({List.class})
@MappedJdbcTypes(JdbcType.VARCHAR)
public class DstLookupTypeHandler extends AbstractJsonTypeHandler<List>
{
private static ObjectMapper objectMapper = new ObjectMapper();
private JavaType type;
public DstLookupTypeHandler(Class<List> type) {
this.type = objectMapper.getTypeFactory().constructParametricType(ArrayList.class, DstLookup.class);
}
@Override
protected List parse(String json) {
try {
return objectMapper.readValue(json, type);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Override
protected String toJson(List obj) {
try {
return objectMapper.writeValueAsString(obj);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
public static void setObjectMapper(ObjectMapper objectMapper) {
DstLookupTypeHandler.objectMapper = objectMapper;
}
}
package cn.ibizlab.core.lite.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.SearchContextBase;
/**
* ServiceApi数据实体[DstLookup] 查询条件对象
*/
@Slf4j
@Data
public class DstLookupSearchContext extends SearchContextBase {
private String n_relationid_eq;//[关系标识]
}
package cn.ibizlab.core.lite.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.core.lite.domain.DstLookup;
import cn.ibizlab.core.lite.filter.DstLookupSearchContext;
/**
* 实体[DstLookup] 服务对象接口
*/
public interface IDstLookupService{
boolean create(DstLookup et) ;
void createBatch(List<DstLookup> list) ;
boolean update(DstLookup et) ;
void updateBatch(List<DstLookup> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
DstLookup get(String key) ;
DstLookup getDraft(DstLookup et) ;
boolean checkKey(DstLookup et) ;
boolean save(DstLookup et) ;
void saveBatch(List<DstLookup> list) ;
Page<DstLookup> searchDefault(DstLookupSearchContext context) ;
List<DstLookup> selectByRelationid(String id) ;
void removeByRelationid(String id) ;
void saveByRelationid(String id,List<DstLookup> list) ;
}
package cn.ibizlab.core.lite.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.beans.factory.annotation.Value;
import cn.ibizlab.util.errors.BadRequestAlertException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.core.lite.domain.DstLookup;
import cn.ibizlab.core.lite.filter.DstLookupSearchContext;
import cn.ibizlab.core.lite.service.IDstLookupService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
/**
* 实体[lookup] 无存储服务对象接口实现
*/
@Slf4j
@Service
public class DstLookupServiceImpl implements IDstLookupService {
@Override
public boolean create(DstLookup et) {
//代码实现
return true;
}
public void createBatch(List<DstLookup> list){
}
@Override
public boolean update(DstLookup et) {
//代码实现
return true;
}
public void updateBatch(List<DstLookup> list){
}
@Override
public boolean remove(String key) {
return true;
}
public void removeBatch(Collection<String> idList){
}
@Override
public DstLookup get(String key) {
DstLookup et = new DstLookup();
et.setId(key);
return et;
}
@Override
public DstLookup getDraft(DstLookup et) {
return et;
}
@Override
public boolean checkKey(DstLookup et) {
return false;
}
@Override
@Transactional
public boolean save(DstLookup et) {
//代码实现
return true;
}
@Override
public void saveBatch(List<DstLookup> list) {
}
@Override
public List<DstLookup> selectByRelationid(String id) {
return null;
}
@Override
public void removeByRelationid(String id) {
Set<String> delIds=new HashSet<String>();
for(DstLookup before:selectByRelationid(id)){
delIds.add(before.getId());
}
if(delIds.size()>0)
this.removeBatch(delIds);
}
@Autowired
@Lazy
IDstLookupService proxyService;
@Override
public void saveByRelationid(String id,List<DstLookup> list) {
if(list==null)
return;
Set<String> delIds=new HashSet<String>();
List<DstLookup> _update=new ArrayList<DstLookup>();
List<DstLookup> _create=new ArrayList<DstLookup>();
for(DstLookup before:selectByRelationid(id)){
delIds.add(before.getId());
}
for(DstLookup sub:list) {
sub.setRelationid(id);
if(ObjectUtils.isEmpty(sub.getId()))
sub.setId((String)sub.getDefaultKey(true));
if(delIds.contains(sub.getId())) {
delIds.remove(sub.getId());
_update.add(sub);
}
else
_create.add(sub);
}
if(_update.size()>0)
proxyService.updateBatch(_update);
if(_create.size()>0)
proxyService.createBatch(_create);
if(delIds.size()>0)
proxyService.removeBatch(delIds);
}
/**
* 查询集合 数据集
*/
@Override
public Page<DstLookup> searchDefault(DstLookupSearchContext context) {
return new PageImpl<DstLookup>(new ArrayList(),context.getPageable(),0);
}
}
......@@ -71,6 +71,8 @@
<!--输出实体[DST_ROUTER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-dst_router-30-4">
<createTable tableName="IBZROUTER">
......@@ -270,7 +272,7 @@
<!--输出实体[META_RELATION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-meta_relation-72-12">
<changeSet author="a_A_5d9d78509" id="tab-meta_relation-77-12">
<createTable tableName="IBZRELATION">
<column name="RELATIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_META_RELATION_RELATIONID"/>
......@@ -291,7 +293,7 @@
</column>
<column name="NESTEDNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="LOOKUP" remarks="" type="VARCHAR(1000)">
<column name="LOOKUP" remarks="" type="TEXT(1000)">
</column>
</createTable>
</changeSet>
......
......@@ -19,6 +19,7 @@
<result property="entityId" column="entityid" />
<result property="refEntityId" column="refentityid" />
<result property="lookup" column="lookup" typeHandler="cn.ibizlab.core.lite.domain.handlers.DstLookupTypeHandler" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="entity" javaType="cn.ibizlab.core.lite.domain.MetaEntity" column="entityid" select="cn.ibizlab.core.lite.mapper.MetaEntityMapper.selectById" fetchType="lazy"></association>
......@@ -52,7 +53,7 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CODENAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`LOOKUP`, t1.`NESTEDNAME`, t1.`REFENTITYID`, t1.`REFENTITYNAME`, t1.`RELATIONID`, t1.`RELATIONNAME`, t1.`RELTYPE`, t11.`SYSTEMID` FROM `IBZRELATION` t1 LEFT JOIN IBZENTITY t11 ON t1.ENTITYID = t11.ENTITYID
<![CDATA[ SELECT t1.`CODENAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`NESTEDNAME`, t1.`REFENTITYID`, t1.`REFENTITYNAME`, t1.`RELATIONID`, t1.`RELATIONNAME`, t1.`RELTYPE`, t11.`SYSTEMID` FROM `IBZRELATION` t1 LEFT JOIN IBZENTITY t11 ON t1.ENTITYID = t11.ENTITYID
]]>
</sql>
<!--数据查询[Default]-->
......
......@@ -659,6 +659,83 @@
],
"parentEntitys":[
]
}
,
{
"entity_name":"DST_LOOKUP",
"logic_name":"lookup",
"code_name":"DstLookup",
"table_name":"IBZLOOKUP",
"system_id":"ibzlite",
"system_name":"ibzlite",
"fields":[
{
"fieldname":"ID" ,
"codename":"Id",
"field_logic_name":"标识",
"entity_name":"DstLookup",
"field_type":"TEXT",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":1,
"major_field":0
},
{
"fieldname":"RELATIONID" ,
"codename":"RelationId",
"field_logic_name":"关系标识",
"entity_name":"DstLookup",
"ref_de":"META_RELATION",
"ref_field_name":"RELATIONID",
"relation_name":"DER1N_DST_LOOKUP_META_RELATION_RELATIONID",
"relation_codename":"Relation",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":1
},
{
"fieldname":"FIELDNAME" ,
"codename":"FieldName",
"field_logic_name":"属性名称",
"entity_name":"DstLookup",
"field_type":"TEXT",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
},
{
"fieldname":"REFFIELDNAME" ,
"codename":"RefFieldName",
"field_logic_name":"引用属性名称",
"entity_name":"DstLookup",
"field_type":"TEXT",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
}
],
"subEntitys":[
],
"parentEntitys":[
{"name":"DER1N_DST_LOOKUP_META_RELATION_RELATIONID",
"relation_type":"DER1N",
"code_name":"Relation",
"entity_name":"META_RELATION",
"ref_entity_name":"DST_LOOKUP"
}
]
}
,
{
......@@ -2317,16 +2394,22 @@
"codename":"Lookup",
"field_logic_name":"Lookup",
"entity_name":"MetaRelationship",
"field_type":"LONGTEXT_1000",
"field_type":"ONE2MANYDATA",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_type":"TEXT",
"data_length":1000,
"key_field":0,
"major_field":0
}
],
"subEntitys":[
{"name":"DER1N_DST_LOOKUP_META_RELATION_RELATIONID",
"relation_type":"DER1N",
"code_name":"Relation",
"entity_name":"META_RELATION",
"ref_entity_name":"DST_LOOKUP"
},
{"name":"DER1N_META_FIELD_META_RELATION_RELATIONID",
"relation_type":"DER1N",
"code_name":"Relation",
......
......@@ -118,15 +118,6 @@ public class MetaRelationshipDTO extends DTOBase implements Serializable {
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String systemId;
/**
* 属性 [LOOKUP]
*
*/
@JSONField(name = "lookup")
@JsonProperty("lookup")
@Size(min = 0, max = 1000, message = "内容长度必须小于等于[1000]")
private String lookup;
/**
* 设置 [RELATIONNAME]
......@@ -192,14 +183,6 @@ public class MetaRelationshipDTO extends DTOBase implements Serializable {
this.modify("nestedname",nestedName);
}
/**
* 设置 [LOOKUP]
*/
public void setLookup(String lookup){
this.lookup = lookup ;
this.modify("lookup",lookup);
}
}
......
......@@ -149,6 +149,7 @@ public class SearchContextBase implements ISearchContext{
* 获取用户上下文
* @return
*/
@JsonIgnore
public Map<String,Object> getSessioncontext() {
return AuthenticationUser.getAuthenticationUser().getSessionParams();
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册