3 Commits
Author SHA1 Message Date
Alawn 74ca64d4ff add fact rest 2022-11-07 09:44:52 +08:00
Alawn fa7ae03290 ignore startKit,cleanTarget 2022-09-06 10:55:33 +08:00
Alawn f4566b0628 add index module 2022-09-06 10:33:11 +08:00
65 changed files with 2868 additions and 37 deletions
+2
View File
@@ -7,3 +7,5 @@
/application.pid
.github/*
.jpb/*
startKit.sh
cleanTarget.sh
@@ -22,19 +22,4 @@ public class BaseDTO implements Serializable {
private Timestamp createTime;
private Timestamp updateTime;
@Override
public String toString() {
ToStringBuilder builder = new ToStringBuilder(this);
Field[] fields = this.getClass().getDeclaredFields();
try {
for (Field f : fields) {
f.setAccessible(true);
builder.append(f.getName(), f.get(this)).append("\n");
}
} catch (Exception e) {
builder.append("toString builder encounter an error");
}
return builder.toString();
}
}
}
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
@@ -42,6 +43,7 @@ import java.sql.Timestamp;
@Setter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@ToString
public class BaseEntity implements Serializable {
@CreatedBy
@@ -74,18 +76,18 @@ public class BaseEntity implements Serializable {
/* 分组校验 */
public @interface Update {}
@Override
public String toString() {
ToStringBuilder builder = new ToStringBuilder(this);
Field[] fields = this.getClass().getDeclaredFields();
try {
for (Field f : fields) {
f.setAccessible(true);
builder.append(f.getName(), f.get(this)).append("\n");
}
} catch (Exception e) {
builder.append("toString builder encounter an error");
}
return builder.toString();
}
// @Override
// public String toString() {
// ToStringBuilder builder = new ToStringBuilder(this);
// Field[] fields = this.getClass().getDeclaredFields();
// try {
// for (Field f : fields) {
// f.setAccessible(true);
// builder.append(f.getName(), f.get(this)).append("\n");
// }
// } catch (Exception e) {
// builder.append("toString builder encounter an error");
// }
// return builder.toString();
// }
}
@@ -5,6 +5,7 @@ import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import priv.alawn.aladmin.utils.SecurityUtils;
import java.sql.Timestamp;
import java.time.LocalDateTime;
@Component
@@ -12,8 +13,8 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
this.strictInsertFill(metaObject, "createTime", () -> LocalDateTime.now(), LocalDateTime.class);
this.strictInsertFill(metaObject, "updateTime", () -> LocalDateTime.now(), LocalDateTime.class);
this.strictInsertFill(metaObject, "createTime", () -> Timestamp.valueOf(LocalDateTime.now()), Timestamp.class);
this.strictInsertFill(metaObject, "updateTime", () -> Timestamp.valueOf(LocalDateTime.now()), Timestamp.class);
this.strictInsertFill(metaObject, "updateBy", () -> SecurityUtils.getCurrentUsername(), String.class);
this.strictInsertFill(metaObject, "createBy", () -> SecurityUtils.getCurrentUsername(), String.class);
}
@@ -21,7 +22,7 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
@Override
public void updateFill(MetaObject metaObject) {
this.strictInsertFill(metaObject, "updateTime", () -> LocalDateTime.now(), LocalDateTime.class);
this.strictInsertFill(metaObject, "updateTime", () -> Timestamp.valueOf(LocalDateTime.now()), Timestamp.class);
this.strictInsertFill(metaObject, "updateBy", () -> SecurityUtils.getCurrentUsername(), String.class);
}
}
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>aladmin</artifactId>
<groupId>priv.alawn</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>aladmin-index</artifactId>
<name>指标管理模块</name>
<properties>
</properties>
<dependencies>
<!-- 同时需要common模块和logging模块只需要引入logging模块即可 -->
<dependency>
<groupId>priv.alawn</groupId>
<artifactId>aladmin-logging</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,80 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Entity
@Getter
@Setter
@Table(name="idx_dimension")
public class Dimension extends BaseEntity implements Serializable {
@Id
@Column(name = "dimension_id")
@NotNull(groups = Update.class)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
private String dimensionCode;
private String dimensionName;
private String dimensionDescription;
private Boolean indexDimension;
private Boolean timeDimension;
@OneToMany(mappedBy = "dimension",fetch = FetchType.LAZY,cascade = CascadeType.ALL)
private List<DimensionAttribute> attributes;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
Dimension dimension = (Dimension) o;
return id != null && Objects.equals(id, dimension.id) &&
Objects.equals(dimensionCode, dimension.dimensionCode);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
@Override
public String toString() {
return getClass().getSimpleName() + "(" +
"id = " + id + ", " +
"dimensionCode = " + dimensionCode + ", " +
"dimensionName = " + dimensionName + ", " +
"dimensionDescription = " + dimensionDescription + ", " +
"indexDimension = " + indexDimension + ", " +
"timeDimension = " + timeDimension + ")";
}
}
@@ -0,0 +1,91 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Entity
@Getter
@Setter
@Table(name="idx_dimension_attribute")
public class DimensionAttribute extends BaseEntity implements Serializable {
@Id
@Column(name = "dimension_attribute_id")
@NotNull(groups = Update.class)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
// @JsonBackReference
@ManyToOne
@JoinColumn(name = "dimension_id")
private Dimension dimension;
@ApiModelProperty(value = "属性代码")
protected String attributeCode;
@ApiModelProperty(value = "属性名称")
protected String attributeName;
@ApiModelProperty(value = "属性描述")
protected String description;
@ApiModelProperty(value = "键值属性")
private Boolean keyAttribute;
@ApiModelProperty(value = "代码属性")
private Boolean codeAttribute = false;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
DimensionAttribute that = (DimensionAttribute) o;
return id != null && Objects.equals(id, that.id) &&
Objects.equals(attributeCode,that.attributeCode) ;
}
@Override
public int hashCode() {
return getClass().hashCode();
}
@Override
public String toString() {
return getClass().getSimpleName() + "(" +
"id = " + getId() + ", " +
"createBy = " + getCreateBy() + ", " +
"updateBy = " + getUpdateBy() + ", " +
"createTime = " + getCreateTime() + ", " +
"updateTime = " + getUpdateTime() + ", " +
"dimension = " + getDimension() + ", " +
"attributeCode = " + getAttributeCode() + ", " +
"attributeName = " + getAttributeName() + ", " +
"description = " + getDescription() + ", " +
"keyAttribute = " + getKeyAttribute() + ", " +
"codeAttribute = " + getCodeAttribute() + ")";
}
}
@@ -0,0 +1,82 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Entity
@Getter
@Setter
@Table(name = "idx_fact", uniqueConstraints = {
@UniqueConstraint(name = "uc_fact_factcode", columnNames = {"factCode"})
})
@TableName("idx_fact")
public class Fact extends BaseEntity implements Serializable {
@Id
@Column(name = "fact_id")
@NotNull(groups = Update.class)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
// @TableField("fact_code")
@ApiModelProperty(value = "事实代码")
private String factCode;
@ApiModelProperty(value = "事实名称")
private String factName;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "度量",hidden = true)
// @JsonBackReference
@OneToMany(mappedBy = "fact",fetch = FetchType.LAZY,cascade = CascadeType.ALL)
private List<FactMeasure> measures;
//
@ApiModelProperty(value = "属性",hidden = true)
// @JsonBackReference
@OneToMany(mappedBy = "fact",fetch = FetchType.LAZY,cascade = CascadeType.ALL)
private List<FactAttribute> attributes;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
Fact fact = (Fact) o;
return id != null && Objects.equals(id, fact.id) && Objects.equals(factCode, fact.factCode);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}
@@ -0,0 +1,72 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Entity
@Getter
@Setter
@Table(name="idx_fact_attribute")
public class FactAttribute extends BaseEntity implements Serializable {
@Id
@Column(name = "fact_attribute_id")
@NotNull(groups = Update.class)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "属性代码")
protected String attributeCode;
@ApiModelProperty(value = "属性名称")
protected String attributeName;
@ApiModelProperty(value = "属性描述")
protected String description;
@ApiModelProperty(value="factId",hidden = true)
// @JsonBackReference
@ManyToOne
@JoinColumn(name = "fact_id")
private Fact fact;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
FactAttribute that = (FactAttribute) o;
return id != null && Objects.equals(id, that.id) &&
Objects.equals(attributeCode, that.attributeCode);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}
@@ -0,0 +1,74 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.domain;
import com.fasterxml.jackson.annotation.JsonBackReference;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Entity
@Getter
@Setter
@Table(name="idx_fact_measure")
public class FactMeasure extends BaseEntity implements Serializable {
@Id
@Column(name = "fact_measure_id")
@NotNull(groups = Update.class)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
private String measureCode;
private String measureName;
private String description;
private String measureType;
@JsonBackReference
@ApiModelProperty(value="factId",hidden = true)
@ManyToOne
@JoinColumn(name = "fact_id")
private Fact fact;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FactMeasure obj = (FactMeasure) o;
return Objects.equals(id, obj.id) && Objects.equals(measureCode, obj.measureCode) ;
}
@Override
public int hashCode() {
return Objects.hash(id, measureCode);
}
}
@@ -0,0 +1,69 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Entity
@Getter
@Setter
@Table(name="idx_indexes")
public class Index extends BaseEntity implements Serializable {
@Id
@Column(name = "index_id")
@NotNull(groups = Update.class)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
private String indexCode;
private String indexName;
private String indexType;
private String indexCategory;
private String indexDescription;
private Boolean enabled;
private Boolean based;
private String indexFolderId;
private String indexCalculeType;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
Index index = (Index) o;
return id != null && Objects.equals(id, index.id) &&
Objects.equals(indexCode, index.indexCode);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}
@@ -0,0 +1,69 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Entity
@Getter
@Setter
@Table(name="idx_logic_model")
public class LogicModel extends BaseEntity implements Serializable {
@Id
@Column(name = "logic_model_id")
@NotNull(groups = Update.class)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
private String modelName;
private String description;
@ManyToOne
@JoinColumn(name = "fact_id")
private Fact fact;
@ManyToOne
@JoinColumn(name = "table_definition_id")
private TableDefinition tableDefinition;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
LogicModel that = (LogicModel) o;
return id != null && Objects.equals(id, that.id);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}
@@ -0,0 +1,67 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Entity
@Getter
@Setter
@Table(name="idx_table_definition")
public class TableDefinition extends BaseEntity implements Serializable {
@Id
@Column(name = "table_definition_id")
@NotNull(groups = Update.class)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
private String tableName;
private String tableDescription;
private String remark;
private String enabled;
private Long dsId;
private String sourceSystem;
private String definitionType;
private Boolean created;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
TableDefinition that = (TableDefinition) o;
return id != null && Objects.equals(id, that.id);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
}
@@ -0,0 +1,61 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseEntity;
import java.io.Serializable;
/**
* @author Alawn
* @date 2018-11-22
*/
@ApiModel
@Getter
@Setter
@ToString(callSuper = true)
public class DimensionAttributeDto extends BaseEntity implements Serializable {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
private Long dimensionId;
@ApiModelProperty(value = "属性代码")
protected String attributeCode;
@ApiModelProperty(value = "属性名称")
protected String attributeName;
@ApiModelProperty(value = "属性描述")
protected String description;
@ApiModelProperty(value = "键值属性")
private Boolean keyAttribute;
@ApiModelProperty(value = "代码属性")
private Boolean codeAttribute;
}
@@ -0,0 +1,49 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseEntity;
import java.io.Serializable;
/**
* @author Alawn
* @date 2018-11-22
*/
@ApiModel
@Getter
@Setter
@ToString(callSuper = true)
public class DimensionDto extends BaseEntity implements Serializable {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
private String dimensionCode;
private String dimensionName;
private String dimensionDescription;
private Boolean indexDimension;
private Boolean timeDimension;
}
@@ -0,0 +1,52 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseEntity;
import java.io.Serializable;
/**
* @author Alawn
* @date 2018-11-22
*/
@ApiModel
@Getter
@Setter
@ToString(callSuper = true)
public class FactAttributeDto extends BaseEntity implements Serializable {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "属性代码")
protected String attributeCode;
@ApiModelProperty(value = "属性名称")
protected String attributeName;
@ApiModelProperty(value = "属性描述")
protected String description;
@ApiModelProperty(value="事实ID")
private Long factId;
}
@@ -0,0 +1,53 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseEntity;
import java.io.Serializable;
/**
* @author Alawn
* @date 2018-11-22
*/
@ApiModel
@Getter
@Setter
@ToString(callSuper = true)
public class FactDto extends BaseEntity implements Serializable {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "事实代码")
private String factCode;
@ApiModelProperty(value = "事实名称")
private String factName;
@ApiModelProperty(value = "事实描述")
private String description;
}
@@ -0,0 +1,54 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseEntity;
import java.io.Serializable;
/**
* @author Alawn
* @date 2018-11-22
*/
@ApiModel
@Getter
@Setter
@ToString(callSuper = true)
public class FactMeasureDto extends BaseEntity implements Serializable {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@ApiModelProperty(value = "度量代码")
private String measureCode;
@ApiModelProperty(value = "度量名称")
private String measureName;
@ApiModelProperty(value = "度量描述")
private String description;
@ApiModelProperty(value = "度量类型")
private String measureType;
private Long factId;
}
@@ -0,0 +1,46 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseDTO;
import priv.alawn.aladmin.base.BaseEntity;
import java.io.Serializable;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@ToString(callSuper = true)
public class LogicModelDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
private String modelName;
private String description;
private Long factId;
private Long tableDefinitionId;
}
@@ -0,0 +1,57 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@TableName("idx_dimension")
@ToString(callSuper = true)
public class Dimension extends BaseEntity implements Serializable {
@TableId(value = "dimension_id",type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@TableField
private String dimensionCode;
@TableField
private String dimensionName;
@TableField
private String dimensionDescription;
@TableField
private Boolean indexDimension;
@TableField
private Boolean timeDimension;
}
@@ -0,0 +1,67 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseEntity;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@TableName("idx_dimension_attribute")
@ToString(callSuper = true)
public class DimensionAttribute extends BaseEntity implements Serializable {
@TableId(value = "dimension_attribute_id",type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@TableField
private Long dimensionId;
@TableField
@ApiModelProperty(value = "属性代码")
protected String attributeCode;
@TableField
@ApiModelProperty(value = "属性名称")
protected String attributeName;
@TableField
@ApiModelProperty(value = "属性描述")
protected String description;
@TableField
@ApiModelProperty(value = "键值属性")
private Boolean keyAttribute;
@TableField
@ApiModelProperty(value = "代码属性")
private Boolean codeAttribute = false;
}
@@ -0,0 +1,60 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@TableName("idx_fact")
@ToString(callSuper = true)
public class Fact extends BaseEntity implements Serializable {
@TableId(value = "fact_id",type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@TableField
@ApiModelProperty(value = "事实代码")
private String factCode;
@TableField
@ApiModelProperty(value = "事实名称")
private String factName;
@TableField
@ApiModelProperty(value = "描述")
private String description;
}
@@ -0,0 +1,62 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@TableName("idx_fact_attribute")
@ToString(callSuper = true)
public class FactAttribute extends BaseEntity implements Serializable {
@TableId(value = "fact_attribute_id",type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@TableField
@ApiModelProperty(value = "属性代码")
protected String attributeCode;
@TableField
@ApiModelProperty(value = "属性名称")
protected String attributeName;
@TableField
@ApiModelProperty(value = "属性描述")
protected String description;
@ApiModelProperty(value="factId",hidden = true)
private Long factId;
}
@@ -0,0 +1,60 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.po;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.Column;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@TableName("idx_fact_measure")
@ToString(callSuper = true)
public class FactMeasure extends BaseEntity implements Serializable {
@TableId(value = "fact_measure_id",type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@TableField
private String measureCode;
@TableField
private String measureName;
@TableField
private String description;
@TableField
private String measureType;
@ApiModelProperty(value="factId",hidden = true)
private Long factId;
}
@@ -0,0 +1,74 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.po;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@TableName("idx_indexes")
@ToString(callSuper = true)
public class Index extends BaseEntity implements Serializable {
@Id
@TableField(value = "index_id",fill = FieldFill.INSERT)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@TableField
private String indexCode;
@TableField
private String indexName;
@TableField
private String indexType;
@TableField
private String indexCategory;
@TableField
private String indexDescription;
@TableField
private Boolean enabled;
@TableField
private Boolean based;
@TableField
private String indexFolderId;
@TableField
private String indexCalculeType;
}
@@ -0,0 +1,59 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@TableName("idx_logic_model")
@ToString(callSuper = true)
public class LogicModel extends BaseEntity implements Serializable {
@TableId(value = "logic_model_id",type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@TableField
private String modelName;
@TableField
private String description;
@TableField
private Long factId;
@TableField
private Long tableDefinitionId;
}
@@ -0,0 +1,71 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.Hibernate;
import priv.alawn.aladmin.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@TableName("idx_table_definition")
@ToString(callSuper = true)
public class TableDefinition extends BaseEntity implements Serializable {
@TableId(value = "table_definition_id",type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
@TableField
private String tableName;
@TableField
private String tableDescription;
@TableField
private String remark;
@TableField
private String enabled;
@TableField
private Long dsId;
@TableField
private String sourceSystem;
@TableField
private String definitionType;
@TableField
private Boolean created;
}
@@ -0,0 +1,49 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseEntity;
import priv.alawn.aladmin.modules.idx.entity.dto.DimensionAttributeDto;
import javax.persistence.Entity;
import java.io.Serializable;
import java.util.List;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@ToString(callSuper = true)
public class DimensionVo extends BaseEntity implements Serializable {
@ApiModelProperty(value = "ID", hidden = true)
private Long id;
private String dimensionCode;
private String dimensionName;
private String dimensionDescription;
private Boolean indexDimension;
private Boolean timeDimension;
private List<DimensionAttributeDto> attributes;
}
@@ -0,0 +1,55 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseEntity;
import priv.alawn.aladmin.modules.idx.entity.dto.FactAttributeDto;
import priv.alawn.aladmin.modules.idx.entity.dto.FactMeasureDto;
import java.io.Serializable;
import java.util.List;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@ToString(callSuper = true)
public class FactVo extends BaseEntity implements Serializable {
private Long id;
@ApiModelProperty(value = "事实代码")
private String factCode;
@ApiModelProperty(value = "事实名称")
private String factName;
@ApiModelProperty(value = "事实描述")
private String description;
@ApiModelProperty(value = "属性")
List<FactAttributeDto> attributes;
@ApiModelProperty(value = "度量")
List<FactMeasureDto> measures;
}
@@ -0,0 +1,43 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import priv.alawn.aladmin.base.BaseDTO;
import priv.alawn.aladmin.modules.idx.entity.po.Fact;
import priv.alawn.aladmin.modules.idx.entity.po.TableDefinition;
import java.io.Serializable;
/**
* @author Alawn
* @date 2018-11-22
*/
@Getter
@Setter
@ToString(callSuper = true)
public class LogicModelVo extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID", hidden = true)
private Long id ;
private String modelName ;
private String description ;
private Fact fact ;
private TableDefinition tableDefinition ;
}
@@ -0,0 +1,22 @@
package priv.alawn.aladmin.modules.idx.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum AttributeTypeEnum {
/* 事实 */
FACT_ATTRIBUTE("FACT", "事实"),
/* 维度 */
DIMENSION_ATTRIBUTE("DIMENSION", "维度"),
/* 模型 */
MODEL_ATTRIBUTE("MODEL_ATTRIBUTE", "模型");
private final String key;
private final String description;
}
@@ -0,0 +1,19 @@
package priv.alawn.aladmin.modules.idx.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;
import priv.alawn.aladmin.modules.idx.entity.po.Dimension;
import priv.alawn.aladmin.modules.idx.entity.po.DimensionAttribute;
import java.util.List;
@Mapper
public interface DimensionAttributeMapper extends BaseMapper<DimensionAttribute> {
String tableName = "idx_dimension_attribute";
@Result(property = "id",column = "dimension_attribute_id")
@Select("select * from " + tableName + " where dimension_id = #{dimensionId}")
List<DimensionAttribute> selectByDimensionId(Long dimensionId) ;
}
@@ -0,0 +1,9 @@
package priv.alawn.aladmin.modules.idx.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import priv.alawn.aladmin.modules.idx.entity.po.Dimension;
@Mapper
public interface DimensionMapper extends BaseMapper<Dimension> {
}
@@ -0,0 +1,18 @@
package priv.alawn.aladmin.modules.idx.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import priv.alawn.aladmin.modules.idx.entity.po.FactAttribute;
import java.util.List;
@Mapper
public interface FactAttributeMapper extends BaseMapper<FactAttribute> {
String tableName = "idx_fact_attribute";
// @Results(value = {@Result(property = "id",column = "fact_attribute_id")})
@Result(property = "id",column = "fact_attribute_id")
@Select("select * from " + tableName + " where fact_id = #{factId}")
List<FactAttribute> selectByFactId(Long factId) ;
}
@@ -0,0 +1,9 @@
package priv.alawn.aladmin.modules.idx.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import priv.alawn.aladmin.modules.idx.entity.po.Fact;
@Mapper
public interface FactMapper extends BaseMapper<Fact> {
}
@@ -0,0 +1,19 @@
package priv.alawn.aladmin.modules.idx.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import priv.alawn.aladmin.modules.idx.entity.po.FactMeasure;
import java.util.List;
@Mapper
public interface FactMeasureMapper extends BaseMapper<FactMeasure> {
String tableName = "idx_fact_measure";
// @Results(value = {@Result(property = "id",column = "fact_measure_id")})
@Result(property = "id",column = "fact_measure_id")
@Select("select * from " + tableName + " where fact_id = #{factId}")
List<FactMeasure> selectByFactId(Long factId) ;
}
@@ -0,0 +1,24 @@
package priv.alawn.aladmin.modules.idx.mapstruct;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
import priv.alawn.aladmin.modules.idx.entity.dto.*;
import priv.alawn.aladmin.modules.idx.entity.po.*;
import priv.alawn.aladmin.modules.idx.entity.vo.DimensionVo;
import priv.alawn.aladmin.modules.idx.entity.vo.FactVo;
import java.util.List;
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DimensionMapping {
DimensionMapping INSTANCE = Mappers.getMapper( DimensionMapping.class );
Dimension toEntity(DimensionDto dto);
DimensionAttribute toEntity(DimensionAttributeDto dto);
List<DimensionVo> toDimensionVo(List<Dimension> facts) ;
List<DimensionAttributeDto> toAttributeDto(List<DimensionAttribute> entity);
}
@@ -0,0 +1,33 @@
package priv.alawn.aladmin.modules.idx.mapstruct;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
import priv.alawn.aladmin.modules.idx.entity.dto.FactAttributeDto;
import priv.alawn.aladmin.modules.idx.entity.dto.FactDto;
import priv.alawn.aladmin.modules.idx.entity.dto.FactMeasureDto;
import priv.alawn.aladmin.modules.idx.entity.po.Fact;
import priv.alawn.aladmin.modules.idx.entity.po.FactAttribute;
import priv.alawn.aladmin.modules.idx.entity.po.FactMeasure;
import priv.alawn.aladmin.modules.idx.entity.vo.FactVo;
import java.util.List;
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface FactMapping {
FactMapping INSTANCE = Mappers.getMapper( FactMapping.class );
Fact toEntity(FactVo vo) ;
Fact toEntity(FactDto dto) ;
FactMeasure toEntity(FactMeasureDto dto) ;
FactAttribute toEntity(FactAttributeDto dto) ;
// FactVo toFactVo(Fact fact);
List<FactVo> toFactVo(List<Fact> facts) ;
List<FactDto> toFactDto(List<Fact> objs) ;
List<FactAttributeDto> toAttributeDto(List<FactAttribute> objs) ;
List<FactMeasureDto> toMeasureDto(List<FactMeasure> objs) ;
}
@@ -0,0 +1,23 @@
package priv.alawn.aladmin.modules.idx.mapstruct;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
import priv.alawn.aladmin.base.SuperMapper;
import priv.alawn.aladmin.modules.idx.entity.domain.LogicModel;
import priv.alawn.aladmin.modules.idx.entity.dto.LogicModelDto;
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
//public interface LogicModelMapper extends SuperMapper<LogicModelDto, LogicModel> {
public interface LogicModelMapper {
LogicModelMapper INSTANCE = Mappers.getMapper(LogicModelMapper.class);
@Mappings({
@Mapping(source="factId" , target="fact.id" ),
@Mapping(source="tableDefinitionId" , target="tableDefinition.id" )
})
LogicModel toEntity(LogicModelDto dto);
}
@@ -0,0 +1,27 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import priv.alawn.aladmin.modules.idx.entity.domain.DimensionAttribute;
/**
* @author Alawn
* @date 2019-03-25
*/
public interface DimensionAttributeRepository extends JpaRepository<DimensionAttribute, Long>, JpaSpecificationExecutor<DimensionAttribute> {
}
@@ -0,0 +1,27 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import priv.alawn.aladmin.modules.idx.entity.domain.Dimension;
/**
* @author Alawn
* @date 2019-03-25
*/
public interface DimensionRepository extends JpaRepository<Dimension, Long>, JpaSpecificationExecutor<Dimension> {
}
@@ -0,0 +1,29 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import priv.alawn.aladmin.modules.idx.entity.domain.FactAttribute;
/**
* @author Alawn
* @date 2019-03-25
*/
public interface FactAttributeRepository extends JpaRepository<FactAttribute, Long>, JpaSpecificationExecutor<FactAttribute> {
FactAttribute findByAttributeCode(String attributeCode);
}
@@ -0,0 +1,29 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import priv.alawn.aladmin.modules.idx.entity.domain.FactMeasure;
/**
* @author Alawn
* @date 2019-03-25
*/
public interface FactMeasureRepository extends JpaRepository<FactMeasure, Long>, JpaSpecificationExecutor<FactMeasure> {
FactMeasure findByMeasureCode(String measureCode);
}
@@ -0,0 +1,27 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import priv.alawn.aladmin.modules.idx.entity.domain.Fact;
/**
* @author Alawn
* @date 2019-03-25
*/
public interface FactRepository extends JpaRepository<Fact, Long>, JpaSpecificationExecutor<Fact> {
}
@@ -0,0 +1,27 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import priv.alawn.aladmin.modules.idx.entity.domain.LogicModel;
/**
* @author Alawn
* @date 2019-03-25
*/
public interface LogicModelRepository extends JpaRepository<LogicModel, Long>, JpaSpecificationExecutor<LogicModel> {
}
@@ -0,0 +1,77 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import priv.alawn.aladmin.annotation.Log;
import priv.alawn.aladmin.exception.BadRequestException;
import priv.alawn.aladmin.modules.idx.entity.dto.DimensionAttributeDto;
import priv.alawn.aladmin.modules.idx.entity.dto.DimensionDto;
import priv.alawn.aladmin.modules.idx.entity.vo.DimensionVo;
import priv.alawn.aladmin.modules.idx.service.impl.DimensionServiceImpl;
import java.util.List;
/**
* @author Alawn
* @date 2019-03-25
*/
@RestController
@RequiredArgsConstructor
@Api(tags = "指标:维度")
@RequestMapping("/api/idx/dimension")
public class DimensionController {
private final DimensionServiceImpl dimensionService;
// private static final String ENTITY_NAME = "dept";
@Log("新增维度")
@ApiOperation("新增维度")
@PostMapping
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<Object> createDimension(@Validated @RequestBody DimensionDto resources){
if (resources.getId() != null) {
throw new BadRequestException("A new dimension cannot already have an ID");
}
dimensionService.createDimension(resources);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@Log("新增属性")
@ApiOperation("新增属性")
@PostMapping("/attribute")
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<Object> createAttribute(@Validated @RequestBody DimensionAttributeDto resources){
if (resources.getId() != null) {
throw new BadRequestException("A new dimensionAttribute cannot already have an ID");
}
dimensionService.createAttribute(resources);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@Log("完整维度清单")
@ApiOperation("完整维度清单")
@GetMapping
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<List<DimensionVo>> wholeDimensions(){
return ResponseEntity.ok(dimensionService.queryWholeDimensions());
}
}
@@ -0,0 +1,133 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import priv.alawn.aladmin.annotation.Log;
import priv.alawn.aladmin.exception.BadRequestException;
import priv.alawn.aladmin.exception.EntityNotFoundException;
import priv.alawn.aladmin.modules.idx.entity.dto.FactAttributeDto;
import priv.alawn.aladmin.modules.idx.entity.dto.FactDto;
import priv.alawn.aladmin.modules.idx.entity.dto.FactMeasureDto;
import priv.alawn.aladmin.modules.idx.entity.po.Fact;
import priv.alawn.aladmin.modules.idx.entity.vo.FactVo;
import priv.alawn.aladmin.modules.idx.service.impl.FactServiceImpl;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author Alawn
* @date 2019-03-25
*/
@RestController
@RequiredArgsConstructor
@Api(tags = "指标:事实")
@RequestMapping("/api/index/fact")
public class FactController {
private final FactServiceImpl factService;
private static final String ENTITY_NAME = "Fact";
@Log("新增事实")
@ApiOperation("新增事实")
@PostMapping
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<Object> createFact(@Validated @RequestBody FactDto resources){
if (resources.getId() != null) {
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
}
factService.createFact(resources);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@Log("删除事实")
@ApiOperation("删除事实")
@DeleteMapping("/{id}")
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<Object> deleteFact(@PathVariable Long id){
if (factService.findFactById(id) == null) {
throw new EntityNotFoundException(Fact.class, "id", id.toString());
}
factService.deleteFact(id);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("修改事实")
@ApiOperation("修改事实")
@PutMapping
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<Object> updateFact(@RequestBody Fact resources){
if (resources.getId() == null) {
throw new BadRequestException(ENTITY_NAME +" id cannot empty");
}
if (factService.findFactById(resources.getId()) == null) {
throw new EntityNotFoundException( Fact.class,"id",resources.getId().toString());
}
factService.updateFact(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("新增度量")
@ApiOperation("新增度量")
@PostMapping("/measure")
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<Object> createMeasure(@Validated @RequestBody FactMeasureDto resources){
if (resources.getId() != null) {
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
}
factService.createMeasure(resources);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@Log("新增属性")
@ApiOperation("新增属性")
@PostMapping("/attribute")
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<Object> createAttribute(@Validated @RequestBody FactAttributeDto resources){
if (resources.getId() != null) {
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
}
factService.createAttribute(resources);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@ApiOperation("完整事实清单")
@GetMapping
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<List<FactVo>> wholeFacts(){
return ResponseEntity.ok(factService.queryWholeFacts());
}
@ApiOperation("查询事实")
@GetMapping("/list")
// @PreAuthorize("@perm.check('dept:add')")
public ResponseEntity<List<FactDto>> queryFactList() {
return ResponseEntity.ok(factService.queryAllFacts());
}
}
@@ -0,0 +1,99 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.stereotype.Service;
import priv.alawn.aladmin.exception.EntityExistException;
import priv.alawn.aladmin.exception.EntityNotFoundException;
import priv.alawn.aladmin.modules.idx.entity.dto.*;
import priv.alawn.aladmin.modules.idx.entity.po.*;
import priv.alawn.aladmin.modules.idx.entity.vo.DimensionVo;
import priv.alawn.aladmin.modules.idx.entity.vo.FactVo;
import priv.alawn.aladmin.modules.idx.mapper.DimensionAttributeMapper;
import priv.alawn.aladmin.modules.idx.mapper.DimensionMapper;
import priv.alawn.aladmin.modules.idx.mapstruct.DimensionMapping;
import priv.alawn.aladmin.modules.idx.mapstruct.FactMapping;
import java.util.List;
/**
* @author Alawn
* @date 2022-03-25
*/
@Slf4j
@Service
@RequiredArgsConstructor
@CacheConfig(cacheNames = "dimension")
public class DimensionServiceImpl {
private final DimensionMapper dimensionMapper;
private final DimensionAttributeMapper attributeMapper;
private final DimensionMapping mapping = DimensionMapping.INSTANCE;
/**
* 创建维度
* @param resources
*/
public void createDimension(DimensionDto resources) {
if (dimensionMapper.selectOne(new QueryWrapper<Dimension>().lambda().eq(Dimension::getDimensionCode,resources.getDimensionCode())) != null) {
throw new EntityExistException(DimensionDto.class, "dimensionCode", resources.getDimensionCode());
}
dimensionMapper.insert(mapping.toEntity(resources));
}
/**
* 创建维度属性
* @param resources
*/
public void createAttribute(DimensionAttributeDto resources) {
if(dimensionMapper.selectById(resources.getDimensionId()) == null) {
throw new EntityNotFoundException(DimensionAttributeDto.class, "dimensionId", resources.getDimensionId().toString());
}
if (attributeMapper.selectOne(new QueryWrapper<DimensionAttribute>().lambda().eq(DimensionAttribute::getAttributeCode,resources.getAttributeCode())) != null) {
throw new EntityExistException(DimensionAttributeDto.class, "attributeCode", resources.getAttributeCode());
}
attributeMapper.insert(mapping.toEntity(resources));
}
/**
* 查询维度
* @return 维度列表
*/
public List<DimensionVo> queryWholeDimensions() {
List<Dimension> dimensions = dimensionMapper.selectList(null);
log.info("dimensions:{}",dimensions);
List<DimensionVo> dimensionVoList = mapping.toDimensionVo(dimensions);
log.info("dimensionVoList:{}",dimensionVoList);
for(DimensionVo dimension:dimensionVoList) {
dimension.setAttributes(mapping.toAttributeDto(attributeMapper.selectByDimensionId(dimension.getId())));
}
log.info("dimensionVoList:{}",dimensionVoList);
return dimensionVoList;
}
}
@@ -0,0 +1,155 @@
/*
* Copyright 2019-2020 Alawn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package priv.alawn.aladmin.modules.idx.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.stereotype.Service;
import priv.alawn.aladmin.exception.BadRequestException;
import priv.alawn.aladmin.exception.EntityExistException;
import priv.alawn.aladmin.exception.EntityNotFoundException;
import priv.alawn.aladmin.modules.idx.entity.dto.FactAttributeDto;
import priv.alawn.aladmin.modules.idx.entity.dto.FactDto;
import priv.alawn.aladmin.modules.idx.entity.dto.FactMeasureDto;
import priv.alawn.aladmin.modules.idx.entity.po.Fact;
import priv.alawn.aladmin.modules.idx.entity.po.FactAttribute;
import priv.alawn.aladmin.modules.idx.entity.po.FactMeasure;
import priv.alawn.aladmin.modules.idx.entity.vo.FactVo;
import priv.alawn.aladmin.modules.idx.mapper.FactAttributeMapper;
import priv.alawn.aladmin.modules.idx.mapper.FactMapper;
import priv.alawn.aladmin.modules.idx.mapper.FactMeasureMapper;
import priv.alawn.aladmin.modules.idx.mapstruct.FactMapping;
import java.util.List;
/**
* @author Alawn
* @date 2022-03-25
*/
@Slf4j
@Service
@RequiredArgsConstructor
@CacheConfig(cacheNames = "fact")
public class FactServiceImpl {
private final FactMapping mapping = FactMapping.INSTANCE;
private final FactMapper factMapper;
private final FactMeasureMapper factMeasureMapper;
private final FactAttributeMapper factAttributeMapper;
/**
* 创建事实
* @param resources
*/
public void createFact(FactDto resources) {
if (factMapper.selectOne(new QueryWrapper<Fact>().lambda().eq(Fact::getFactCode,resources.getFactCode())) != null) {
throw new EntityExistException(FactDto.class, "factCode", resources.getFactCode());
}
factMapper.insert(mapping.toEntity(resources));
}
/**
* 删除事实
* @param id
*/
public void deleteFact(Long id) {
int rs = factMapper.deleteById(id);
if ( rs < 0) {
throw new EntityNotFoundException(Fact.class, "id", id.toString());
}
}
/**
* 查找事实
* @param id
*/
public Fact findFactById(Long id) {
return factMapper.selectById(id);
}
/**
* 修改事实
* @param id
*/
public void updateFact(Fact resources) {
factMapper.updateById(resources);
}
/**
* 创建属性
* @param resources
*/
public void createAttribute(FactAttributeDto resources) {
// 判重
if (factAttributeMapper.selectOne(new QueryWrapper<FactAttribute>().lambda().eq(FactAttribute::getAttributeCode,resources.getAttributeCode())) != null) {
throw new EntityExistException(Fact.class, "attributeCode", resources.getAttributeCode());
}
// 判断FactId是否存在
if (factMapper.selectById(resources.getFactId()) == null) {
throw new EntityNotFoundException(FactMeasureDto.class, "factId", resources.getFactId().toString());
}
factAttributeMapper.insert(mapping.toEntity(resources));
}
/**
* 创建度量
* @param resources
*/
public void createMeasure(FactMeasureDto resources) {
QueryWrapper wp = new QueryWrapper<FactMeasure>().eq("measure_code",resources.getMeasureCode());
/** 判重 **/
// User user = new User().selectOne(new QueryWrapper<User>().lambda().eq(User::getId, 2));
if (factMeasureMapper.selectOne(wp) != null) {
throw new EntityExistException(FactMeasureDto.class, "measureCode", resources.getMeasureCode());
}
// 判断FactId是否存在
if (factMapper.selectById(resources.getFactId()) == null) {
throw new EntityNotFoundException(FactMeasureDto.class, "faceId", resources.getFactId().toString());
}
factMeasureMapper.insert(mapping.toEntity(resources));
}
public List<FactVo> queryWholeFacts(){
List<Fact> facts = factMapper.selectList(null);
log.info("facts:{}",facts);
List<FactVo> factVoList = mapping.toFactVo(facts);
log.info("factVoList:{}",factVoList);
for(FactVo fact:factVoList) {
fact.setMeasures(mapping.toMeasureDto(factMeasureMapper.selectByFactId(fact.getId())));
fact.setAttributes(mapping.toAttributeDto(factAttributeMapper.selectByFactId(fact.getId())));
}
log.info("factVoList:{}",factVoList);
return factVoList;
}
public List<FactDto> queryAllFacts(){
return mapping.toFactDto(factMapper.selectList(null));
}
}
@@ -0,0 +1,22 @@
package priv.alawn.aladmin.modules.idx.service.impl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.stereotype.Service;
import priv.alawn.aladmin.modules.idx.repository.LogicModelRepository;
@Slf4j
@Service
@RequiredArgsConstructor
@CacheConfig(cacheNames = "logicModel")
public class LogicModelServiceImpl {
// @Autowired
// private LogicModelRepository logicModelRepository;
//
// public void createLogicModel(LogicModelDto dto){
// logicModelRepository.save(LogicModelMapper.INSTANCE.toEntity(dto));
// }
}
+1
View File
@@ -0,0 +1 @@
14239
+4
View File
@@ -102,6 +102,10 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>priv.alawn.aladmin.Application</mainClass>
</configuration>
</plugin>
<!-- 跳过单元测试 -->
<plugin>
@@ -83,4 +83,20 @@ public class Dept extends BaseEntity implements Serializable {
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
return getClass().getSimpleName() + "(" +
"id = " + getId() + ", " +
"createBy = " + getCreateBy() + ", " +
"updateBy = " + getUpdateBy() + ", " +
"createTime = " + getCreateTime() + ", " +
"updateTime = " + getUpdateTime() + ", " +
"deptSort = " + getDeptSort() + ", " +
"name = " + getName() + ", " +
"enabled = " + getEnabled() + ", " +
"pid = " + getPid() + ", " +
"subCount = " + getSubCount() + ")";
}
}
@@ -122,4 +122,26 @@ public class User extends BaseEntity implements Serializable {
public int hashCode() {
return Objects.hash(id, username);
}
@Override
public String toString() {
return getClass().getSimpleName() + "(" +
"id = " + getId() + ", " +
"createBy = " + getCreateBy() + ", " +
"updateBy = " + getUpdateBy() + ", " +
"createTime = " + getCreateTime() + ", " +
"updateTime = " + getUpdateTime() + ", " +
"dept = " + getDept() + ", " +
"username = " + getUsername() + ", " +
"nickName = " + getNickName() + ", " +
"email = " + getEmail() + ", " +
"phone = " + getPhone() + ", " +
"gender = " + getGender() + ", " +
"avatarName = " + getAvatarName() + ", " +
"avatarPath = " + getAvatarPath() + ", " +
"password = " + getPassword() + ", " +
"enabled = " + getEnabled() + ", " +
"isAdmin = " + getIsAdmin() + ", " +
"pwdResetTime = " + getPwdResetTime() + ")";
}
}
@@ -19,6 +19,7 @@ import cn.hutool.core.collection.CollectionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import priv.alawn.aladmin.modules.system.domain.Dept;
import priv.alawn.aladmin.modules.system.domain.User;
import priv.alawn.aladmin.modules.system.domain.vo.UserPassVo;
@@ -60,6 +61,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/api/users")
@RequiredArgsConstructor
@Slf4j
public class UserController {
private final PasswordEncoder passwordEncoder;
@@ -109,6 +111,7 @@ public class UserController {
@PostMapping
@PreAuthorize("@perm.check('user:add')")
public ResponseEntity<Object> createUser(@Validated @RequestBody User resources){
log.info("User:{}",resources);
checkLevel(resources);
// 默认密码 123456
resources.setPassword(passwordEncoder.encode("123456"));
@@ -5,7 +5,7 @@ spring:
db-type: com.alibaba.druid.pool.DruidDataSource
# H2 配置
driverClassName: org.h2.Driver
url: jdbc:h2:tcp://localhost:9092/~/.h2/aladmin;NON_KEYWORDS=VALUE,USER;DATABASE_TO_LOWER=TRUE;MODE=MySQL;OLD_INFORMATION_SCHEMA=TRUE
url: jdbc:h2:tcp://localhost:9092/~/.h2/aladmin;NON_KEYWORDS=VALUE,USER;DATABASE_TO_LOWER=TRUE;MODE=MySQL;OLD_INFORMATION_SCHEMA=TRUE;DB_CLOSE_DELAY=-1;FILE_LOCK=SOCKET
#;AUTO_SERVER=TRUE;DB_CLOSE_DELAY=-1
username: sa
password: sa
@@ -31,7 +31,7 @@ spring:
database: ${REDIS_DB:0}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
password: ${REDIS_PWD:Newland15%}
#连接超时时间
timeout: 5000
@@ -0,0 +1,30 @@
package priv.alawn.aladmin;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import priv.alawn.aladmin.modules.idx.service.impl.LogicModelServiceImpl;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class IndexTests {
@Autowired
LogicModelServiceImpl logicModelService;
@Test
public void testLogicModelService() {
// LogicModelDto dto = new LogicModelDto();
// dto.setDescription("描述");
// dto.setModelName("模型名称");
// dto.setFactId(1000l);
// dto.setTableDefinitionId(2l);
//
// logicModelService.createLogicModel(dto);
}
public static void main(String[] args) {
}
}
@@ -0,0 +1,28 @@
package priv.alawn.aladmin;
import org.aspectj.lang.annotation.Before;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.crypto.password.StandardPasswordEncoder;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class PasswordEncoderTests {
// @Autowired
private PasswordEncoder passwordEncoder;
String rawPassword = "admin1";
String secret = "my-secret-key";
@Before("")
public void initPasswordEncoder(){
System.out.println("initPasswordEncoder");
}
@Test
public void testPassword() {
passwordEncoder = new StandardPasswordEncoder(secret);
String encryptedPassword = passwordEncoder.encode(rawPassword);
System.out.println("Password:" + encryptedPassword);
}
}
+76
View File
@@ -0,0 +1,76 @@
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< priv.alawn:aladmin-system >----------------------
[INFO] Building 核心模块 1.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- spring-boot-maven-plugin:2.7.3:start (default-cli) @ aladmin-system ---
[INFO] Attaching agents: []
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/alawn/.m2/repository/ch/qos/logback/logback-classic/1.2.9/logback-classic-1.2.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/alawn/.m2/repository/org/slf4j/slf4j-simple/1.7.36/slf4j-simple-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
_ _ _
| | | | (_)
___| |______ __ _ __| |_ __ ___ _ _ __
/ _ | |______/ _` |/ _` | '_ ` _ \| | '_ \
| __| | | (_| | (_| | | | | | | | | | |
\___|_| \__,_|\__,_|_| |_| |_|_|_| |_|
:: Spring Boot :: (v2.6.4)
admin- 2022-10-26 10:58:05 [main] INFO  priv.alawn.aladmin.Application - Starting Application using Java 18.0.2 on mbp.local with PID 14239 (/Users/alawn/Workspace/aladmin/aladmin-system/target/classes started by alawn in /Users/alawn/Workspace/aladmin/aladmin-system)
admin- 2022-10-26 10:58:05 [main] INFO  priv.alawn.aladmin.Application - The following 1 profile is active: "dev"
admin- 2022-10-26 10:58:08 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode
admin- 2022-10-26 10:58:08 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
admin- 2022-10-26 10:58:08 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 370 ms. Found 28 JPA repository interfaces.
admin- 2022-10-26 10:58:09 [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8000 (http)
admin- 2022-10-26 10:58:09 [main] INFO  o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8000"]
admin- 2022-10-26 10:58:09 [main] INFO  o.a.catalina.core.StandardService - Starting service [Tomcat]
admin- 2022-10-26 10:58:09 [main] INFO  o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.65]
admin- 2022-10-26 10:58:10 [main] INFO  o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
admin- 2022-10-26 10:58:10 [main] INFO  o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 4078 ms
admin- 2022-10-26 10:58:10 [main] INFO  c.a.d.s.b.a.DruidDataSourceAutoConfigure - Init DruidDataSource
admin- 2022-10-26 10:58:11 [main] INFO  c.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
admin- 2022-10-26 10:58:11 [main] INFO  o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [name: default]
admin- 2022-10-26 10:58:11 [main] INFO  org.hibernate.Version - HHH000412: Hibernate ORM core version 5.6.10.Final
admin- 2022-10-26 10:58:11 [main] INFO  o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
admin- 2022-10-26 10:58:11 [main] INFO  org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
admin- 2022-10-26 10:58:13 [main] INFO  o.h.e.t.j.p.i.JtaPlatformInitiator - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
admin- 2022-10-26 10:58:13 [main] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
admin- 2022-10-26 10:58:14 [main] INFO  org.quartz.impl.StdSchedulerFactory - Using default implementation for ThreadExecutor
admin- 2022-10-26 10:58:14 [main] INFO  o.quartz.core.SchedulerSignalerImpl - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
admin- 2022-10-26 10:58:14 [main] INFO  org.quartz.core.QuartzScheduler - Quartz Scheduler v.2.3.2 created.
admin- 2022-10-26 10:58:14 [main] INFO  org.quartz.simpl.RAMJobStore - RAMJobStore initialized.
admin- 2022-10-26 10:58:14 [main] INFO  org.quartz.core.QuartzScheduler - Scheduler meta-data: Quartz Scheduler (v2.3.2) 'quartzScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
admin- 2022-10-26 10:58:14 [main] INFO  org.quartz.impl.StdSchedulerFactory - Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance.
admin- 2022-10-26 10:58:14 [main] INFO  org.quartz.impl.StdSchedulerFactory - Quartz scheduler version: 2.3.2
admin- 2022-10-26 10:58:14 [main] INFO  org.quartz.core.QuartzScheduler - JobFactory set to: org.springframework.scheduling.quartz.SpringBeanJobFactory@2a9eb44d
_ _ |_ _ _|_. ___ _ | _
| | |\/|_)(_| | |_\ |_)||_|_\
/ |
3.5.2
admin- 2022-10-26 10:58:16 [main] INFO  o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@5398fac2, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@37884b27, org.springframework.security.web.context.SecurityContextPersistenceFilter@7b6419dd, org.springframework.security.web.header.HeaderWriterFilter@68d21554, org.springframework.security.web.authentication.logout.LogoutFilter@53b52f30, org.springframework.web.filter.CorsFilter@774c5e5c, priv.alawn.aladmin.modules.security.security.TokenFilter@8749c08, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@776a3e76, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@54856056, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@5e56f24c, org.springframework.security.web.session.SessionManagementFilter@623c62b9, org.springframework.security.web.access.ExceptionTranslationFilter@16be6b36, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@4c93cf28]
admin- 2022-10-26 10:58:16 [main] INFO  p.alawn.aladmin.config.RedisConfig - 初始化 -> [Redis CacheErrorHandler]
admin- 2022-10-26 10:58:17 [main] INFO  o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8000"]
admin- 2022-10-26 10:58:17 [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8000 (http) with context path ''
admin- 2022-10-26 10:58:18 [main] INFO  o.s.s.quartz.SchedulerFactoryBean - Starting Quartz Scheduler now
admin- 2022-10-26 10:58:18 [main] INFO  org.quartz.core.QuartzScheduler - Scheduler quartzScheduler_$_NON_CLUSTERED started.
admin- 2022-10-26 10:58:18 [main] INFO  priv.alawn.aladmin.Application - Started Application in 13.647 seconds (JVM running for 15.102)
admin- 2022-10-26 10:58:18 [main] INFO  p.a.a.m.quartz.config.JobRunner - Timing task injection complete
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.033 s
[INFO] Finished at: 2022-10-26T10:58:19+08:00
[INFO] ------------------------------------------------------------------------
admin- 2022-10-26 10:59:15 [http-nio-8000-exec-1] INFO  o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
admin- 2022-10-26 10:59:15 [http-nio-8000-exec-1] INFO  o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
admin- 2022-10-26 10:59:15 [http-nio-8000-exec-1] INFO  o.s.web.servlet.DispatcherServlet - Completed initialization in 2 ms
+3 -2
View File
@@ -15,6 +15,7 @@
<module>aladmin-system</module>
<module>aladmin-tools</module>
<module>aladmin-generator</module>
<module>aladmin-index</module>
</modules>
<name>ALADMIN 后台管理</name>
@@ -37,7 +38,7 @@
<fastjson.version>1.2.83</fastjson.version>
<druid.version>1.2.9</druid.version>
<commons-pool2.version>2.11.1</commons-pool2.version>
<mapstruct.version>1.4.2.Final</mapstruct.version>
<mapstruct.version>1.5.2.Final</mapstruct.version>
<h2.version>2.1.214</h2.version>
<mybatis-plus.version>3.5.2</mybatis-plus.version>
<jsqlparser.version>4.5</jsqlparser.version>
@@ -47,7 +48,7 @@
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>>
<version>${mybatis-plus.version}</version>
<exclusions>
<exclusion>
<groupId>javax.persistence</groupId>
+150
View File
@@ -0,0 +1,150 @@
set mode mysql;
set names utf8mb4;
set foreign_key_checks = 0;
-- auto-generated definition
drop table if exists idx_dimension;
create table if not exists idx_dimension
(
dimension_id bigint auto_increment primary key,
create_by varchar(500),
create_time timestamp,
update_by varchar(500),
update_time timestamp,
dimension_code varchar(500),
dimension_description varchar(500),
dimension_name varchar(500),
index_dimension boolean,
time_dimension boolean
);
drop table if exists idx_dimension_attribute;
create table if not exists idx_dimension_attribute
(
dimension_attribute_id bigint auto_increment primary key,
create_by varchar(500),
create_time timestamp,
update_by varchar(500),
update_time timestamp,
attribute_code varchar(500),
attribute_name varchar(500),
description varchar(500),
code_attribute boolean,
key_attribute boolean,
dimension_id bigint
);
drop table if exists idx_fact;
create table if not exists idx_fact
(
fact_id bigint auto_increment primary key,
create_by varchar(500),
create_time timestamp,
update_by varchar(500),
update_time timestamp,
fact_code varchar(500),
description varchar(500),
fact_name varchar(500)
);
drop table if exists idx_fact_attribute;
create table if not exists idx_fact_attribute
(
fact_attribute_id bigint auto_increment primary key,
create_by varchar(500),
create_time timestamp,
update_by varchar(500),
update_time timestamp,
attribute_code varchar(500),
attribute_name varchar(500),
description varchar(500),
fact_id bigint
);
drop table if exists idx_indexes;
create table if not exists idx_indexes
(
index_id bigint auto_increment primary key,
create_by varchar(500),
create_time timestamp,
update_by varchar(500),
update_time timestamp,
based boolean,
enabled boolean,
index_calcule_type varchar(500),
index_category varchar(500),
index_code varchar(500),
index_description varchar(500),
index_folder_id varchar(500),
index_name varchar(500),
index_type varchar(500)
);
drop table if exists idx_fact_measure;
create table if not exists idx_fact_measure
(
fact_measure_id bigint auto_increment primary key,
measure_code varchar(10),
measure_name varchar(1000),
description varchar(1000),
measure_type varchar(10),
fact_id bigint,
create_by varchar(100),
create_time timestamp,
update_by varchar(100),
update_time timestamp
);
drop table if exists idx_logic_model;
create table if not exists idx_logic_model
(
logic_model_id bigint auto_increment primary key comment '物理主键',
model_name varchar(255) null,
description varchar(255) null,
fact_id bigint(30) null,
table_definition_id bigint(30) null,
create_by varchar(255) null,
create_time timestamp,
update_by varchar(255) null,
update_time timestamp
);
drop table if exists idx_table_definition;
create table if not exists idx_table_definition
(
table_definition_id bigint auto_increment primary key comment '物理主键',
table_name varchar(255) null,
table_description varchar(255) null,
remark varchar(255) null,
enabled varchar(255) null,
ds_id bigint(30) null,
source_system varchar(255) null,
difinition_type varchar(255) null,
created tinyint(1) null,
create_by varchar(255) null,
create_time timestamp,
update_by varchar(255) null,
update_time timestamp
);
begin;
commit;
set foreign_key_checks = 1;
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (1, 'admin', null, null, null, 'RPT_BUS_ORG_CD_D', '机构', '机构', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (2, 'admin', null, null, null, 'RPT_BUSINESS_LINE_ID_D', '条线', '条线', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (3, 'admin', null, null, null, 'RPT_MIS_PROD_ID_D', '产品', '产品', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (4, 'admin', null, null, null, 'RPT_ADJ_TYPE_D', '调整类型', '调整类型', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (5, 'admin', null, null, null, 'RPT_BUS_ORG_CD_d', '机构', '机构', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (6, 'admin', null, null, null, 'RPT_CCY_CD_D', '币种', '币种', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (7, 'admin', null, null, null, 'RPT_PERIOD_CODe_d', '期间', '期间', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (8, 'admin', null, null, null, 'RPT_INDEX_D', '指标', '指标', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (9, 'admin', null, null, null, 'RPT_BUS_ORG_CD_ori_d', '原始机构', '原始机构', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (10, 'admin', null, null, null, 'RPT_DESK_D', 'DESK', 'DESK', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (11, 'admin', null, null, null, 'GRM_ORG_CODE', 'GRM机构', 'GRM机构', false, false);
-- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (12, 'admin', null, null, null, 'RPT_DATE_D', '日期', '日期', false, false);
Executable
+13
View File
@@ -0,0 +1,13 @@
#. ./startKit.sh
pid=`lsof -i tcp:8000 | sed -n '2,2p' | awk '{print $2}'`
if [ "$pid" != "" ];then
kill -9 $pid
echo $pid has been killed
fi
cd aladmin-system && mvn spring-boot:start > ../nohup.out
Executable
+32
View File
@@ -0,0 +1,32 @@
#pid=$(ps -ef | grep h2.sh | grep -v ag | grep -v grep | awk '{print $2}')
#
#
#if [ "$pid" != "" ]; then
# echo "\n\033[1;31mh2.sh($pid) has been killed\033[0m"
# kill -9 $pid
#fi
#
#pid=$(ps -ef | grep org.h2.tools.Console | grep -v ag | grep -v grep | awk '{print $2}')
#if [ "$pid" != "" ]; then
# echo "\033[1;31mh2.console($pid) has been killed\033[0m"
# kill -9 $pid
#fi
#
#pid=$(ps -ef | grep redis-server | grep -v ag | grep -v grep | awk '{print $2}')
#
#
#if [ "$pid" != "" ]; then
# echo "\033[1;31mredis-server($pid) has been killed\033[0m"
# kill -9 $pid
#fi
pid=`lsof -i tcp:8000 | sed -n '2,2p' | awk '{print $2}'`
if [ "$pid" != "" ];then
kill -9 $pid
echo $pid has been killed
fi
Executable
+35
View File
@@ -0,0 +1,35 @@
pid=$(ps -ef | grep h2.sh | grep -v ag | grep -v grep | awk '{print $2}')
if [ "$pid" != "" ]; then
echo "\n\033[1;32mh2.sh($pid) has been killed\033[0m"
kill -9 $pid
fi
pid=$(ps -ef | grep org.h2.tools.Console | grep -v ag | grep -v grep | awk '{print $2}')
if [ "$pid" != "" ]; then
echo "\033[1;32mh2.console($pid) has been killed\033[0m"
kill -9 $pid
fi
# h2 > /dev/null &
# pid=$(ps -ef | grep h2.sh | grep -v ag | grep -v grep | awk '{print $2}')
# echo "\033[1;32mh2($pid) started \033[0m\n"
pid=$(ps -ef | grep redis-server | grep -v ag | grep -v grep | awk '{print $2}')
if [ "$pid" != "" ]; then
echo "\033[1;32mredis-server($pid) has been killed\033[0m"
kill -9 $pid
fi
echo ""
# redis-server /usr/local/etc/redis.conf > /dev/null &
# pid=$(ps -ef | grep redis-server | grep -v ag | grep -v grep | awk '{print $2}')
# echo "\033[1;32mredis-server($pid) started \033[0m\n"