提交 80b9f8a6 编写于 作者: ibizdev's avatar ibizdev

MoneyQ 部署微服务应用 [后台服务,演示应用]

上级 dc0ae05d
<template>
<div class="view-container deeditview ibizsample0001-sf4-edit-view">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizsample0001sf4editview"></app-studioaction>
<card class='view-card view-no-toolbar' :disHover="true" :bordered="false">
<card class='view-card view-no-caption view-no-toolbar' :disHover="true" :bordered="false">
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
</div>
<div class='view-top-messages'>
</div>
......
......@@ -37,11 +37,11 @@
git clone -b master $para2 demosys/
export NODE_OPTIONS=--max-old-space-size=4096
cd demosys/
mvn clean package -Pdemoapi
cd demo-provider/demo-provider-demoapi
mvn -Pdemoapi docker:build
mvn -Pdemoapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/demo-provider-demoapi.yaml iBizDemo --with-registry-auth
mvn clean package -Pweb
cd demo-app/demo-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/demo-app-web.yaml iBizDemo --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 /demo-app-web.jar
EXPOSE 8080
EXPOSE 51001
ADD demo-app-web.jar /demo-app-web.jar
......@@ -3,9 +3,24 @@ services:
demo-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/demo-app-web:latest
ports:
- "8080:8080"
- "51001:51001"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=51001
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_df847bdfd
- SPRING_DATASOURCE_PASSWORD=3d6@460A
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_df847bdfd?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_df847bdfd
- NACOS=172.16.240.110:8848
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......@@ -120,6 +121,7 @@ public class IBIZOrder extends EntityMP implements Serializable {
/**
* 订单编号
*/
@DEField(dupCheck = DupCheck.ALL)
@TableField(value = "orderuid")
@JSONField(name = "orderuid")
@JsonProperty("orderuid")
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......@@ -83,6 +84,7 @@ public class IBIZSample0010 extends EntityMP implements Serializable {
/**
* 订单编号
*/
@DEField(dupCheck = DupCheck.ALL)
@TableField(value = "orderuid")
@JSONField(name = "orderuid")
@JsonProperty("orderuid")
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......@@ -62,6 +63,7 @@ public class IBIZSample0012 extends EntityMP implements Serializable {
/**
* 订单编号
*/
@DEField(dupCheck = DupCheck.ALL)
@TableField(value = "orderuid")
@JSONField(name = "orderuid")
@JsonProperty("orderuid")
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......@@ -45,6 +46,7 @@ public class IBIZSample0017 extends EntityMP implements Serializable {
/**
* 订单编号
*/
@DEField(dupCheck = DupCheck.ALL)
@TableField(value = "orderuid")
@JSONField(name = "orderuid")
@JsonProperty("orderuid")
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
......@@ -19,6 +19,7 @@ import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
......
package cn.ibizlab.core.sample.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 cn.ibizlab.util.helper.DataObject;
import cn.ibizlab.util.enums.DupCheck;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
/**
* 实体[视图消息源]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "T_IBIZVIEWMSG",resultMap = "IBIZViewMsgResultMap")
public class IBIZViewMsg extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 视图消息源标识
*/
@DEField(isKeyField=true)
@TableId(value= "ibizviewmsgid",type=IdType.ASSIGN_UUID)
@JSONField(name = "ibizviewmsgid")
@JsonProperty("ibizviewmsgid")
private String ibizviewmsgid;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 视图消息源名称
*/
@TableField(value = "ibizviewmsgname")
@JSONField(name = "ibizviewmsgname")
@JsonProperty("ibizviewmsgname")
private String ibizviewmsgname;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 设置 [视图消息源名称]
*/
public void setIbizviewmsgname(String ibizviewmsgname){
this.ibizviewmsgname = ibizviewmsgname ;
this.modify("ibizviewmsgname",ibizviewmsgname);
}
/**
* 复制当前对象数据到目标对象(粘贴重置)
* @param targetEntity 目标数据对象
* @param bIncEmpty 是否包括空值
* @param <T>
* @return
*/
@Override
public <T> T copyTo(T targetEntity, boolean bIncEmpty) {
this.reset("ibizviewmsgid");
return super.copyTo(targetEntity,bIncEmpty);
}
}
package cn.ibizlab.core.sample.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.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.sample.domain.IBIZViewMsg;
/**
* 关系型数据实体[IBIZViewMsg] 查询条件对象
*/
@Slf4j
@Data
public class IBIZViewMsgSearchContext extends QueryWrapperContext<IBIZViewMsg> {
private String n_ibizviewmsgname_like;//[视图消息源名称]
public void setN_ibizviewmsgname_like(String n_ibizviewmsgname_like) {
this.n_ibizviewmsgname_like = n_ibizviewmsgname_like;
if(!ObjectUtils.isEmpty(this.n_ibizviewmsgname_like)){
this.getSearchCond().like("ibizviewmsgname", n_ibizviewmsgname_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("ibizviewmsgname", query)
);
}
}
}
package cn.ibizlab.core.sample.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.core.sample.domain.IBIZViewMsg;
import cn.ibizlab.core.sample.filter.IBIZViewMsgSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface IBIZViewMsgMapper extends BaseMapper<IBIZViewMsg>{
Page<IBIZViewMsg> searchDefault(IPage page, @Param("srf") IBIZViewMsgSearchContext context, @Param("ew") Wrapper<IBIZViewMsg> wrapper) ;
@Override
IBIZViewMsg selectById(Serializable id);
@Override
int insert(IBIZViewMsg entity);
@Override
int updateById(@Param(Constants.ENTITY) IBIZViewMsg entity);
@Override
int update(@Param(Constants.ENTITY) IBIZViewMsg entity, @Param("ew") Wrapper<IBIZViewMsg> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
}
......@@ -8,10 +8,10 @@ import java.util.List;
public interface IBIZOrderImport {
@Mappings({
@Mapping(target = "ibizorderid",source = "ibizorderid"),
@Mapping(target = "ibizordername",source = "ibizordername"),
@Mapping(target = "ordertype",source = "ordertype"),
@Mapping(target = "ordertime",source = "ordertime"),
@Mapping(target = "orderuid",source = "orderuid"),
@Mapping(target = "ibizordername",source = "ibizordername"),
})
@BeanMapping(ignoreByDefault = true)
IBIZOrder toDomain(IBIZOrder entity);
......
package cn.ibizlab.core.sample.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.sample.domain.IBIZViewMsg;
import cn.ibizlab.core.sample.filter.IBIZViewMsgSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[IBIZViewMsg] 服务对象接口
*/
public interface IIBIZViewMsgService extends IService<IBIZViewMsg>{
boolean create(IBIZViewMsg et) ;
void createBatch(List<IBIZViewMsg> list) ;
boolean update(IBIZViewMsg et) ;
void updateBatch(List<IBIZViewMsg> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
IBIZViewMsg get(String key) ;
IBIZViewMsg getDraft(IBIZViewMsg et) ;
boolean checkKey(IBIZViewMsg et) ;
boolean save(IBIZViewMsg et) ;
void saveBatch(List<IBIZViewMsg> list) ;
Page<IBIZViewMsg> searchDefault(IBIZViewMsgSearchContext context) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<IBIZViewMsg> getIbizviewmsgByIds(List<String> ids) ;
List<IBIZViewMsg> getIbizviewmsgByEntities(List<IBIZViewMsg> entities) ;
}
......@@ -210,6 +210,7 @@ public class IBIZAccountServiceImpl extends ServiceImpl<IBIZAccountMapper, IBIZA
}
......
......@@ -230,6 +230,7 @@ public class IBIZCPUServiceImpl extends ServiceImpl<IBIZCPUMapper, IBIZCPU> impl
}
......
......@@ -210,6 +210,7 @@ public class IBIZCustomServiceImpl extends ServiceImpl<IBIZCustomMapper, IBIZCus
}
......
......@@ -191,6 +191,7 @@ public class IBIZCustomerMGServiceImpl extends ServiceImpl<IBIZCustomerMGMapper,
}
......
......@@ -213,6 +213,7 @@ public class IBIZCustomerServiceImpl extends ServiceImpl<IBIZCustomerMapper, IBI
}
......
......@@ -226,6 +226,7 @@ public class IBIZCustomer_INTFServiceImpl extends ServiceImpl<IBIZCustomer_INTFM
}
......
......@@ -239,6 +239,7 @@ public class IBIZHardwareServiceImpl extends ServiceImpl<IBIZHardwareMapper, IBI
}
......
......@@ -449,6 +449,7 @@ public class IBIZOrderDetailServiceImpl extends ServiceImpl<IBIZOrderDetailMappe
}
......
......@@ -677,6 +677,14 @@ public class IBIZOrderServiceImpl extends ServiceImpl<IBIZOrderMapper, IBIZOrder
}
/**
* 获取searchContext
* @return
*/
public IBIZOrderSearchContext getSearchContext(){
return new IBIZOrderSearchContext();
}
}
......
......@@ -217,6 +217,7 @@ public class IBIZOrderTypeServiceImpl extends ServiceImpl<IBIZOrderTypeMapper, I
}
......
......@@ -210,6 +210,7 @@ public class IBIZQJServiceImpl extends ServiceImpl<IBIZQJMapper, IBIZQJ> impleme
}
......
......@@ -210,6 +210,7 @@ public class IBIZSample0001ServiceImpl extends ServiceImpl<IBIZSample0001Mapper,
}
......
......@@ -210,6 +210,7 @@ public class IBIZSample0002ServiceImpl extends ServiceImpl<IBIZSample0002Mapper,
}
......
......@@ -272,6 +272,7 @@ public class IBIZSample0003ServiceImpl extends ServiceImpl<IBIZSample0003Mapper,
}
......
......@@ -230,6 +230,7 @@ public class IBIZSample0004ServiceImpl extends ServiceImpl<IBIZSample0004Mapper,
}
......
......@@ -230,6 +230,7 @@ public class IBIZSample0005ServiceImpl extends ServiceImpl<IBIZSample0005Mapper,
}
......
......@@ -235,6 +235,7 @@ public class IBIZSample0006ServiceImpl extends ServiceImpl<IBIZSample0006Mapper,
}
......
......@@ -288,6 +288,7 @@ public class IBIZSample0007ServiceImpl extends ServiceImpl<IBIZSample0007Mapper,
}
......
......@@ -230,6 +230,7 @@ public class IBIZSample0008ServiceImpl extends ServiceImpl<IBIZSample0008Mapper,
}
......
......@@ -210,6 +210,7 @@ public class IBIZSample0009ServiceImpl extends ServiceImpl<IBIZSample0009Mapper,
}
......
......@@ -215,6 +215,14 @@ public class IBIZSample0010ServiceImpl extends ServiceImpl<IBIZSample0010Mapper,
/**
* 获取searchContext
* @return
*/
public IBIZSample0010SearchContext getSearchContext(){
return new IBIZSample0010SearchContext();
}
}
......
......@@ -274,6 +274,7 @@ public class IBIZSample0011ServiceImpl extends ServiceImpl<IBIZSample0011Mapper,
}
......
......@@ -215,6 +215,14 @@ public class IBIZSample0012ServiceImpl extends ServiceImpl<IBIZSample0012Mapper,
/**
* 获取searchContext
* @return
*/
public IBIZSample0012SearchContext getSearchContext(){
return new IBIZSample0012SearchContext();
}
}
......
......@@ -279,6 +279,7 @@ public class IBIZSample0013ServiceImpl extends ServiceImpl<IBIZSample0013Mapper,
}
......
......@@ -259,6 +259,7 @@ public class IBIZSample0014ServiceImpl extends ServiceImpl<IBIZSample0014Mapper,
}
......
......@@ -213,6 +213,7 @@ public class IBIZSample0015ServiceImpl extends ServiceImpl<IBIZSample0015Mapper,
}
......
......@@ -277,6 +277,7 @@ public class IBIZSample0016ServiceImpl extends ServiceImpl<IBIZSample0016Mapper,
}
......
......@@ -219,6 +219,14 @@ public class IBIZSample0017ServiceImpl extends ServiceImpl<IBIZSample0017Mapper,
/**
* 获取searchContext
* @return
*/
public IBIZSample0017SearchContext getSearchContext(){
return new IBIZSample0017SearchContext();
}
}
......
......@@ -210,6 +210,7 @@ public class IBIZSample0018ServiceImpl extends ServiceImpl<IBIZSample0018Mapper,
}
......
......@@ -218,6 +218,7 @@ public class IBIZSample0019ServiceImpl extends ServiceImpl<IBIZSample0019Mapper,
}
......
......@@ -245,6 +245,7 @@ public class IBIZSample0020ServiceImpl extends ServiceImpl<IBIZSample0020Mapper,
}
......
......@@ -219,6 +219,7 @@ public class IBIZSampleServiceImpl extends ServiceImpl<IBIZSampleMapper, IBIZSam
}
......
......@@ -230,6 +230,7 @@ public class IBIZSoftwareSuitServiceImpl extends ServiceImpl<IBIZSoftwareSuitMap
}
......
......@@ -230,6 +230,7 @@ public class IBIZStorageServiceImpl extends ServiceImpl<IBIZStorageMapper, IBIZS
}
......
......@@ -210,6 +210,7 @@ public class IBIZSupplierServiceImpl extends ServiceImpl<IBIZSupplierMapper, IBI
}
......
......@@ -232,6 +232,7 @@ public class IBIZUNIProductServiceImpl extends ServiceImpl<IBIZUNIProductMapper,
}
......
package cn.ibizlab.core.sample.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.sample.domain.IBIZViewMsg;
import cn.ibizlab.core.sample.filter.IBIZViewMsgSearchContext;
import cn.ibizlab.core.sample.service.IIBIZViewMsgService;
import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.sample.mapper.IBIZViewMsgMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[视图消息源] 服务对象接口实现
*/
@Slf4j
@Service("IBIZViewMsgServiceImpl")
public class IBIZViewMsgServiceImpl extends ServiceImpl<IBIZViewMsgMapper, IBIZViewMsg> implements IIBIZViewMsgService {
protected int batchSize = 500;
@Override
@Transactional
public boolean create(IBIZViewMsg et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getIbizviewmsgid()),et);
return true;
}
@Override
@Transactional
public void createBatch(List<IBIZViewMsg> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(IBIZViewMsg et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("ibizviewmsgid",et.getIbizviewmsgid())))
return false;
CachedBeanCopier.copy(get(et.getIbizviewmsgid()),et);
return true;
}
@Override
@Transactional
public void updateBatch(List<IBIZViewMsg> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
@Transactional
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public IBIZViewMsg get(String key) {
IBIZViewMsg et = getById(key);
if(et==null){
et=new IBIZViewMsg();
et.setIbizviewmsgid(key);
}
else{
}
return et;
}
@Override
public IBIZViewMsg getDraft(IBIZViewMsg et) {
return et;
}
@Override
public boolean checkKey(IBIZViewMsg et) {
return (!ObjectUtils.isEmpty(et.getIbizviewmsgid()))&&(!Objects.isNull(this.getById(et.getIbizviewmsgid())));
}
@Override
@Transactional
public boolean save(IBIZViewMsg et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(IBIZViewMsg et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<IBIZViewMsg> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<IBIZViewMsg> list) {
saveOrUpdateBatch(list,batchSize);
}
/**
* 查询集合 数据集
*/
@Override
public Page<IBIZViewMsg> searchDefault(IBIZViewMsgSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBIZViewMsg> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<IBIZViewMsg>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<IBIZViewMsg> getIbizviewmsgByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<IBIZViewMsg> getIbizviewmsgByEntities(List<IBIZViewMsg> entities) {
List ids =new ArrayList();
for(IBIZViewMsg entity : entities){
Serializable id=entity.getIbizviewmsgid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -316,7 +316,7 @@
<!--输出实体[IBIZSAMPLE0001]数据结构 -->
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizsample0001-8-13">
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizsample0001-9-13">
<createTable tableName="T_IBIZSAMPLE0001">
<column name="FIELD01" remarks="" type="VARCHAR(100)">
</column>
......@@ -1018,6 +1018,26 @@
</createTable>
</changeSet>
<!--输出实体[IBIZVIEWMSG]数据结构 -->
<changeSet author="a_LAB01_df847bdfd" id="tab-ibizviewmsg-3-37">
<createTable tableName="T_IBIZVIEWMSG">
<column name="IBIZVIEWMSGID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_IBIZVIEWMSG_IBIZVIEWMSGID"/>
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="IBIZVIEWMSGNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[IBIZACCOUNT]外键关系 -->
<!--输出实体[IBIZCPU]外键关系 -->
<!--输出实体[IBIZCUSTOM]外键关系 -->
......@@ -1037,7 +1057,7 @@
<!--输出实体[IBIZSAMPLE0005]外键关系 -->
<!--输出实体[IBIZSAMPLE0006]外键关系 -->
<!--输出实体[IBIZSAMPLE0007]外键关系 -->
<changeSet author="a_LAB01_df847bdfd" id="fk-ibizsample0007-4-37">
<changeSet author="a_LAB01_df847bdfd" id="fk-ibizsample0007-4-38">
<addForeignKeyConstraint baseColumnNames="IBIZSAMPLE0006ID" baseTableName="T_IBIZSAMPLE0007" constraintName="DER1N_IBIZSAMPLE0007_IBIZSAMPL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="IBIZSAMPLE0006ID" referencedTableName="T_IBIZSAMPLE0006" validate="true"/>
</changeSet>
<!--输出实体[IBIZSAMPLE0008]外键关系 -->
......@@ -1053,12 +1073,13 @@
<!--输出实体[IBIZSAMPLE0018]外键关系 -->
<!--输出实体[IBIZSAMPLE0019]外键关系 -->
<!--输出实体[IBIZSAMPLE0020]外键关系 -->
<changeSet author="a_LAB01_df847bdfd" id="fk-ibizsample0020-4-38">
<changeSet author="a_LAB01_df847bdfd" id="fk-ibizsample0020-4-39">
<addForeignKeyConstraint baseColumnNames="IBIZSAMPLE0019ID" baseTableName="T_IBIZSAMPLE0020" constraintName="DER1N_IBIZSAMPLE0020_IBIZSAMPL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="IBIZSAMPLE0019ID" referencedTableName="T_IBIZSAMPLE0019" validate="true"/>
</changeSet>
<!--输出实体[IBIZSOFTWARESUIT]外键关系 -->
<!--输出实体[IBIZSTORAGE]外键关系 -->
<!--输出实体[IBIZSUPPLIER]外键关系 -->
<!--输出实体[IBIZUNIPRODUCT]外键关系 -->
<!--输出实体[IBIZVIEWMSG]外键关系 -->
</databaseChangeLog>
......@@ -67,7 +67,7 @@
</createView>
</changeSet>
<!--输出实体[IBIZSAMPLE0001]视图结构信息 runOnChange="true" 当视图发生变更时,通过liquibase强刷prod的视图,实现视图的同步-->
<changeSet author="a_LAB01_df847bdfd" id="view-ibizsample0001-8-13" runOnChange="true">
<changeSet author="a_LAB01_df847bdfd" id="view-ibizsample0001-9-13" runOnChange="true">
<createView fullDefinition="false" replaceIfExists="true" viewName="V_IBIZSAMPLE0001">
<![CDATA[ SELECT t1.[CREATEDATE], t1.[CREATEMAN], t1.[FIELD01], t1.[FIELD02], t1.[FIELD05], t1.[FIELD06], t1.[FIELD07], t1.[FIELD08], t1.[FIELD09], t1.[FIELD10], t1.[FIELD11], t1.[FIELD12], t1.[FIELD13], t1.[FIELD14], t1.[FIELD15], t1.[FIELD16], t1.[FIELD17], t1.[FIELD18], t1.[FIELD19], t1.[FIELD20], t1.[FIELD21], t1.[FIELD22], t1.[FIELD23], t1.[FIELD24], t1.[FIELD25], t1.[FIELD26], t1.[FIELD27], t1.[IBIZSAMPLE0001ID], t1.[IBIZSAMPLE0001NAME], t1.[UPDATEDATE], t1.[UPDATEMAN] FROM [T_IBIZSAMPLE0001] t1 ]]>
</createView>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ibizlab.core.sample.mapper.IBIZViewMsgMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="IBIZViewMsgResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`IBIZVIEWMSGID`, t1.`IBIZVIEWMSGNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_IBIZVIEWMSG` t1 ) t1 where ibizviewmsgid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="IBIZViewMsgResultMap" type="cn.ibizlab.core.sample.domain.IBIZViewMsg" autoMapping="true">
<id property="ibizviewmsgid" column="ibizviewmsgid" /><!--主键字段映射-->
</resultMap>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.sample.filter.IBIZViewMsgSearchContext" resultMap="IBIZViewMsgResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`IBIZVIEWMSGID`, t1.`IBIZVIEWMSGNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_IBIZVIEWMSG` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`IBIZVIEWMSGID`, t1.`IBIZVIEWMSGNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_IBIZVIEWMSG` t1
]]>
</sql>
</mapper>
......@@ -7025,6 +7025,111 @@
"parentEntitys":[
]
}
,
{
"entity_name":"IBIZVIEWMSG",
"logic_name":"视图消息源",
"code_name":"IBIZViewMsg",
"table_name":"T_IBIZVIEWMSG",
"system_id":"DemoSys",
"system_name":"DemoSys",
"fields":[
{
"fieldname":"IBIZVIEWMSGID" ,
"codename":"IBIZViewMsgId",
"field_logic_name":"视图消息源标识",
"entity_name":"IBIZViewMsg",
"field_type":"GUID",
"nullable":0,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":100,
"key_field":1,
"show_order":1000,
"major_field":0
},
{
"fieldname":"CREATEDATE" ,
"codename":"CreateDate",
"field_logic_name":"建立时间",
"entity_name":"IBIZViewMsg",
"field_type":"DATETIME",
"nullable":0,
"physical_field":1,
"data_type":"DATETIME",
"data_length":8,
"predefined":"CREATEDATE",
"key_field":0,
"show_order":1000,
"major_field":0
},
{
"fieldname":"UPDATEMAN" ,
"codename":"UpdateMan",
"field_logic_name":"更新人",
"entity_name":"IBIZViewMsg",
"field_type":"TEXT",
"dict":"SysOperator",
"nullable":0,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":60,
"predefined":"UPDATEMAN",
"key_field":0,
"show_order":1000,
"major_field":0
},
{
"fieldname":"IBIZVIEWMSGNAME" ,
"codename":"IBIZViewMsgName",
"field_logic_name":"视图消息源名称",
"entity_name":"IBIZViewMsg",
"field_type":"TEXT",
"nullable":1,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":200,
"key_field":0,
"show_order":1000,
"major_field":1
},
{
"fieldname":"CREATEMAN" ,
"codename":"CreateMan",
"field_logic_name":"建立人",
"entity_name":"IBIZViewMsg",
"field_type":"TEXT",
"dict":"SysOperator",
"nullable":0,
"physical_field":1,
"data_type":"VARCHAR",
"data_length":60,
"predefined":"CREATEMAN",
"key_field":0,
"show_order":1000,
"major_field":0
},
{
"fieldname":"UPDATEDATE" ,
"codename":"UpdateDate",
"field_logic_name":"更新时间",
"entity_name":"IBIZViewMsg",
"field_type":"DATETIME",
"nullable":0,
"physical_field":1,
"data_type":"DATETIME",
"data_length":8,
"predefined":"UPDATEDATE",
"key_field":0,
"show_order":1000,
"major_field":0
}
],
"subEntitys":[
],
"parentEntitys":[
]
}
]
}
......@@ -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 /demo-provider-demoapi.jar
EXPOSE 51000
EXPOSE 8081
ADD demo-provider-demoapi.jar /demo-provider-demoapi.jar
......@@ -3,24 +3,9 @@ services:
demo-provider-demoapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/demo-provider-demoapi:latest
ports:
- "51000:51000"
- "8081:8081"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=51000
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_df847bdfd
- SPRING_DATASOURCE_PASSWORD=3d6@460A
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_df847bdfd?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_df847bdfd
- NACOS=172.16.240.110:8848
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -2,6 +2,7 @@ package cn.ibizlab.util.annotation;
import cn.ibizlab.util.enums.DEFieldDefaultValueType;
import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.enums.DupCheck;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
......@@ -66,5 +67,14 @@ public @interface DEField
* @return
*/
String format() default "";
/**
* 重复性检查
* @return
*/
DupCheck dupCheck() default DupCheck.NONE;
/**
* 范围属性
*/
String dupCheckField() default "";
}
package cn.ibizlab.util.aspect;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.enums.DupCheck;
import cn.ibizlab.util.errors.BadRequestAlertException;
import cn.ibizlab.util.filter.QueryFilter;
import cn.ibizlab.util.filter.SearchContextBase;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.data.domain.Page;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.Map;
/**
* 属性重复值检查切面
*/
@Aspect
@Component
@Slf4j
public class DupCheckAspect {
private final ExpressionParser parser = new SpelExpressionParser();
/**
* 实体[IBIZOrder]
*
* @param point
*/
@AfterReturning(value = "(execution(* cn.ibizlab.core.*.service.*IBIZOrder*.create*(..))||execution(* cn.ibizlab.core.*.service.*IBIZOrder*.update*(..))||execution(* cn.ibizlab.core.*.service.*IBIZOrder*.save*(..)) ) && !execution(* cn.ibizlab.core.es.service.*.create*(..)) && !execution(* cn.ibizlab.core.es.service.*.update*(..)) && !execution(* cn.ibizlab.core.es.service.*.save*(..)) ")
public void checkIbizorder(JoinPoint point) {
check(point, "searchDefault");
}
/**
* 实体[IBIZSample0010]
*
* @param point
*/
@AfterReturning(value = "(execution(* cn.ibizlab.core.*.service.*IBIZSample0010*.create*(..))||execution(* cn.ibizlab.core.*.service.*IBIZSample0010*.update*(..))||execution(* cn.ibizlab.core.*.service.*IBIZSample0010*.save*(..)) ) && !execution(* cn.ibizlab.core.es.service.*.create*(..)) && !execution(* cn.ibizlab.core.es.service.*.update*(..)) && !execution(* cn.ibizlab.core.es.service.*.save*(..)) ")
public void checkIbizsample0010(JoinPoint point) {
check(point, "searchDefault");
}
/**
* 实体[IBIZSample0012]
*
* @param point
*/
@AfterReturning(value = "(execution(* cn.ibizlab.core.*.service.*IBIZSample0012*.create*(..))||execution(* cn.ibizlab.core.*.service.*IBIZSample0012*.update*(..))||execution(* cn.ibizlab.core.*.service.*IBIZSample0012*.save*(..)) ) && !execution(* cn.ibizlab.core.es.service.*.create*(..)) && !execution(* cn.ibizlab.core.es.service.*.update*(..)) && !execution(* cn.ibizlab.core.es.service.*.save*(..)) ")
public void checkIbizsample0012(JoinPoint point) {
check(point, "searchDefault");
}
/**
* 实体[IBIZSample0017]
*
* @param point
*/
@AfterReturning(value = "(execution(* cn.ibizlab.core.*.service.*IBIZSample0017*.create*(..))||execution(* cn.ibizlab.core.*.service.*IBIZSample0017*.update*(..))||execution(* cn.ibizlab.core.*.service.*IBIZSample0017*.save*(..)) ) && !execution(* cn.ibizlab.core.es.service.*.create*(..)) && !execution(* cn.ibizlab.core.es.service.*.update*(..)) && !execution(* cn.ibizlab.core.es.service.*.save*(..)) ")
public void checkIbizsample0017(JoinPoint point) {
check(point, "searchDefault");
}
/**
* 实体属性重复值检查
* @param point 切点
* @param defaultDS 实体默认数据集名称
*/
private void check(JoinPoint point, String defaultDS) {
Object[] args = point.getArgs();
if (args.length > 0) {
Object entity = args[0];
Object service = point.getTarget();
Map<String, DEField> deFields = DEFieldCacheMap.getDEFields(entity.getClass());
for (Map.Entry<String, DEField> deField : deFields.entrySet()) {
String fieldName = deField.getKey();
DEField fieldAnnotation = deField.getValue();
DupCheck dupCheck = fieldAnnotation.dupCheck();
String dupCheckField=fieldAnnotation.dupCheckField();
if (dupCheck == DupCheck.ALL) {
Object newValue =getDEFieldValue(entity,fieldName);
//获取searchContext
EvaluationContext searchContextCtx = new StandardEvaluationContext();
searchContextCtx.setVariable("service", service);
Expression searchContextExp = parser.parseExpression("#service.getSearchContext()");
SearchContextBase searchContext = searchContextExp.getValue(searchContextCtx, SearchContextBase.class);
//设置检查属性值
QueryFilter filter = new QueryFilter();
setValue(entity,filter,fieldName,newValue);
//设定重复值检查范围
if(!StringUtils.isEmpty(dupCheckField)){
Object dupFieldValue=getDEFieldValue(entity,dupCheckField);
setValue(entity,filter,dupCheckField,dupFieldValue);
}
searchContext.setFilter(filter);
//使用当前值到数据库中进行查询,判断是否重复
EvaluationContext oldValueMappingCtx = new StandardEvaluationContext();
oldValueMappingCtx.setVariable("service", service);
oldValueMappingCtx.setVariable("searchContext", searchContext);
Expression oldValueMappingExp = parser.parseExpression(String.format("#service.%s(#searchContext)",defaultDS));
Page oldData = oldValueMappingExp.getValue(oldValueMappingCtx, Page.class);
if (!ObjectUtils.isEmpty(oldData) && !ObjectUtils.isEmpty(oldData.getContent()) && oldData.getContent().size() > 1) {
throw new BadRequestAlertException(String.format("数据保存失败,属性[%s]:值[%s]已存在!", fieldName, newValue), "DupCheckAspect", "DupCheck");
}
}
}
}
}
/**
* 获取实体属性值
* @param entity
* @param fieldName
* @return
*/
private Object getDEFieldValue(Object entity, String fieldName){
EvaluationContext exMappingCtx = new StandardEvaluationContext();
exMappingCtx.setVariable("entity", entity);
Expression esMappingExp = parser.parseExpression(String.format("#entity.get(\"%s\")", fieldName));
return esMappingExp.getValue(exMappingCtx);
}
/**
* 设置filter
* @param entity
* @param filter
* @param value
*/
private void setValue(Object entity , QueryFilter filter, String fieldName, Object value){
if(ObjectUtils.isEmpty(value))
filter.isnull(DEFieldCacheMap.getFieldColumnName(entity.getClass(), fieldName));
else
filter.eq(DEFieldCacheMap.getFieldColumnName(entity.getClass(), fieldName),value);
}
}
package cn.ibizlab.util.enums;
/**
* 属性重复值检查
*/
public enum DupCheck {
/**
* 不检查
*/
NONE,
/**
* 全部检查
*/
ALL,
/**
* 非空检查
*/
NOTNULL,
/**
* 指定范围检查
*/
RANGE,
}
package cn.ibizlab.util.errors;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.dao.*;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
......@@ -90,6 +90,15 @@ public class ExceptionTranslator implements ProblemHandling {
return create(ex, problem, request);
}
@ExceptionHandler(DataAccessException.class)
public ResponseEntity<Problem> handlerDataAccessFailure(DataAccessException ex, NativeWebRequest request){
Problem problem = Problem.builder()
.withStatus(Status.INTERNAL_SERVER_ERROR)
.with("message", ex.getMessage())
.build();
return create(ex, problem, request,createFailureAlert(ex.getClass().getSimpleName(), ex.getClass().getSimpleName(), ex.getMessage()));
}
public static HttpHeaders createFailureAlert(String entityName, String errorKey, String defaultMessage) {
HttpHeaders headers = new HttpHeaders();
headers.add("X-ibz-error", "error." + errorKey);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册