Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4566b0628 |
@@ -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,81 @@
|
||||
/*
|
||||
* 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.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;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @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")
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* 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.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
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;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "dimension_id")
|
||||
// @JsonBackReference
|
||||
private Dimension dimension;
|
||||
|
||||
private String attributeCode;
|
||||
private String attributeName;
|
||||
private String attributeDescription;
|
||||
private Boolean keyAttribute;
|
||||
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 = " + id + ", " +
|
||||
"dimension = " + dimension + ", " +
|
||||
"attributeCode = " + attributeCode + ", " +
|
||||
"attributeName = " + attributeName + ", " +
|
||||
"attributeDescription = " + attributeDescription + ", " +
|
||||
"keyAttribute = " + keyAttribute + ", " +
|
||||
"codeAttribute = " + codeAttribute + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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.domain;
|
||||
|
||||
//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 com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
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 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
|
||||
// @ApiModelProperty(value = "ID", hidden = true)
|
||||
// @TableField("fact_id")
|
||||
@Column(name = "fact_id")
|
||||
@TableId(value = "fact_id",type = IdType.ASSIGN_ID)
|
||||
@NotNull(groups = Update.class)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
// @TableField("fact_code")
|
||||
private String factCode;
|
||||
private String factName;
|
||||
private String factDescription;
|
||||
|
||||
// @JsonBackReference
|
||||
// @OneToMany(mappedBy = "fact")
|
||||
// private List<Measure> measures;
|
||||
//
|
||||
// @JsonBackReference
|
||||
// @OneToMany(mappedBy = "fact")
|
||||
// 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,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.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;
|
||||
private String attributeCode;
|
||||
private String attributeName;
|
||||
private String attributeDescription;
|
||||
|
||||
@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,68 @@
|
||||
/*
|
||||
* 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.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.domain;
|
||||
|
||||
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_measure")
|
||||
public class Measure extends BaseEntity implements Serializable {
|
||||
|
||||
@Id
|
||||
@Column(name = "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 measureDescription;
|
||||
private String measureType;
|
||||
|
||||
@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;
|
||||
}
|
||||
Measure obj = (Measure) o;
|
||||
return Objects.equals(id, obj.id) && Objects.equals(measureCode, obj.measureCode) ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, measureCode);
|
||||
}
|
||||
}
|
||||
@@ -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.domain;
|
||||
|
||||
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_model")
|
||||
public class Model 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;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Model obj = (Model) o;
|
||||
return Objects.equals(id, obj.id) && Objects.equals(dimensionCode, obj.dimensionCode) ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, dimensionCode);
|
||||
}
|
||||
}
|
||||
@@ -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.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import priv.alawn.aladmin.modules.idx.domain.Fact;
|
||||
|
||||
/**
|
||||
* @author Alawn
|
||||
* @date 2019-03-25
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface FactMapper extends BaseMapper<Fact> {
|
||||
}
|
||||
+27
@@ -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.domain.Fact;
|
||||
|
||||
/**
|
||||
* @author Alawn
|
||||
* @date 2019-03-25
|
||||
*/
|
||||
public interface FactRepository extends JpaRepository<Fact, Long>, JpaSpecificationExecutor<Fact> {
|
||||
}
|
||||
+57
@@ -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.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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import priv.alawn.aladmin.annotation.Log;
|
||||
import priv.alawn.aladmin.exception.BadRequestException;
|
||||
import priv.alawn.aladmin.modules.idx.domain.Fact;
|
||||
import priv.alawn.aladmin.modules.idx.service.FactService;
|
||||
|
||||
/**
|
||||
* @author Alawn
|
||||
* @date 2019-03-25
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "指标:维度")
|
||||
@RequestMapping("/api/idx/dim")
|
||||
public class DimensionController {
|
||||
|
||||
private final FactService factService;
|
||||
private static final String ENTITY_NAME = "dept";
|
||||
|
||||
@Log("新增事实")
|
||||
@ApiOperation("新增事实")
|
||||
@PostMapping
|
||||
// @PreAuthorize("@perm.check('dept:add')")
|
||||
public ResponseEntity<Object> createFact(@Validated @RequestBody Fact resources){
|
||||
if (resources.getId() != null) {
|
||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||
}
|
||||
factService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
@@ -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.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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import priv.alawn.aladmin.annotation.Log;
|
||||
import priv.alawn.aladmin.exception.BadRequestException;
|
||||
import priv.alawn.aladmin.modules.idx.domain.Fact;
|
||||
import priv.alawn.aladmin.modules.idx.service.FactService;
|
||||
|
||||
/**
|
||||
* @author Alawn
|
||||
* @date 2019-03-25
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "指标:事实")
|
||||
@RequestMapping("/api/idx/fact")
|
||||
public class FactController {
|
||||
|
||||
private final FactService factService;
|
||||
private static final String ENTITY_NAME = "dept";
|
||||
|
||||
@Log("新增事实")
|
||||
@ApiOperation("新增事实")
|
||||
@PostMapping
|
||||
// @PreAuthorize("@perm.check('dept:add')")
|
||||
public ResponseEntity<Object> createFact(@Validated @RequestBody Fact resources){
|
||||
if (resources.getId() != null) {
|
||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||
}
|
||||
factService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import priv.alawn.aladmin.modules.idx.domain.Fact;
|
||||
|
||||
/**
|
||||
* @author Alawn
|
||||
* @date 2019-03-25
|
||||
*/
|
||||
public interface FactService {
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
*/
|
||||
void create(Fact resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(Fact resources);
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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 lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.stereotype.Service;
|
||||
import priv.alawn.aladmin.modules.idx.domain.Fact;
|
||||
import priv.alawn.aladmin.modules.idx.mapper.FactMapper;
|
||||
import priv.alawn.aladmin.modules.idx.repository.FactRepository;
|
||||
import priv.alawn.aladmin.modules.idx.service.FactService;
|
||||
|
||||
/**
|
||||
* @author Alawn
|
||||
* @date 2019-03-25
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@CacheConfig(cacheNames = "fact")
|
||||
public class FactServiceImpl implements FactService {
|
||||
private final FactRepository factRepository;
|
||||
private final FactMapper factMapper;
|
||||
|
||||
@Override
|
||||
public void create(Fact resources) {
|
||||
log.info("Creating FactService");
|
||||
// factRepository.save(resources);
|
||||
factMapper.insert(resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Fact resources) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
<module>aladmin-system</module>
|
||||
<module>aladmin-tools</module>
|
||||
<module>aladmin-generator</module>
|
||||
<module>aladmin-index</module>
|
||||
</modules>
|
||||
|
||||
<name>ALADMIN 后台管理</name>
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
SET MODE MYSQL;
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- auto-generated definition
|
||||
create table IDX_DIMENSION
|
||||
(
|
||||
DIMENSION_ID BIGINT auto_increment
|
||||
primary key,
|
||||
CREATE_BY CHARACTER,
|
||||
CREATE_TIME TIMESTAMP,
|
||||
UPDATE_BY CHARACTER,
|
||||
UPDATE_TIME TIMESTAMP,
|
||||
DIMENSION_CODE CHARACTER,
|
||||
DIMENSION_DESCRIPTION CHARACTER,
|
||||
DIMENSION_NAME CHARACTER,
|
||||
INDEX_DIMENSION BOOLEAN,
|
||||
TIME_DIMENSION BOOLEAN
|
||||
);
|
||||
|
||||
|
||||
create table IDX_DIMENSION_ATTRIBUTE
|
||||
(
|
||||
DIMENSION_ATTRIBUTE_ID BIGINT auto_increment
|
||||
primary key,
|
||||
CREATE_BY CHARACTER,
|
||||
CREATE_TIME TIMESTAMP,
|
||||
UPDATE_BY CHARACTER,
|
||||
UPDATE_TIME TIMESTAMP,
|
||||
ATTRIBUTE_CODE CHARACTER,
|
||||
ATTRIBUTE_DESCRIPTION CHARACTER,
|
||||
ATTRIBUTE_NAME CHARACTER,
|
||||
CODE_ATTRIBUTE BOOLEAN,
|
||||
KEY_ATTRIBUTE BOOLEAN,
|
||||
DIMENSION_ID BIGINT,
|
||||
constraint FK3PC4BATJ2JBLUJNRUHGFIV63G
|
||||
foreign key (DIMENSION_ID) references IDX_DIMENSION
|
||||
);
|
||||
|
||||
create table IDX_FACT
|
||||
(
|
||||
FACT_ID BIGINT auto_increment
|
||||
primary key,
|
||||
CREATE_BY CHARACTER,
|
||||
CREATE_TIME TIMESTAMP,
|
||||
UPDATE_BY CHARACTER,
|
||||
UPDATE_TIME TIMESTAMP,
|
||||
FACT_CODE CHARACTER,
|
||||
FACT_DESCRIPTION CHARACTER,
|
||||
FACT_NAME CHARACTER
|
||||
);
|
||||
|
||||
create table IDX_FACT_ATTRIBUTE
|
||||
(
|
||||
FACT_ATTRIBUTE_ID BIGINT auto_increment
|
||||
primary key,
|
||||
CREATE_BY CHARACTER,
|
||||
CREATE_TIME TIMESTAMP,
|
||||
UPDATE_BY CHARACTER,
|
||||
UPDATE_TIME TIMESTAMP,
|
||||
ATTRIBUTE_CODE CHARACTER,
|
||||
ATTRIBUTE_DESCRIPTION CHARACTER,
|
||||
ATTRIBUTE_NAME CHARACTER,
|
||||
FACT_ID BIGINT,
|
||||
constraint FKS9HIC1SGFVP7J0NTA5LIOECD3
|
||||
foreign key (FACT_ID) references IDX_FACT
|
||||
);
|
||||
|
||||
create table IDX_INDEXES
|
||||
(
|
||||
INDEX_ID BIGINT auto_increment
|
||||
primary key,
|
||||
CREATE_BY CHARACTER,
|
||||
CREATE_TIME TIMESTAMP,
|
||||
UPDATE_BY CHARACTER,
|
||||
UPDATE_TIME TIMESTAMP,
|
||||
BASED BOOLEAN,
|
||||
ENABLED BOOLEAN,
|
||||
INDEX_CALCULE_TYPE CHARACTER,
|
||||
INDEX_CATEGORY CHARACTER,
|
||||
INDEX_CODE CHARACTER,
|
||||
INDEX_DESCRIPTION CHARACTER,
|
||||
INDEX_FOLDER_ID CHARACTER,
|
||||
INDEX_NAME CHARACTER,
|
||||
INDEX_TYPE CHARACTER
|
||||
);
|
||||
|
||||
create table IDX_MEASURE
|
||||
(
|
||||
MEASURE_ID BIGINT auto_increment
|
||||
primary key,
|
||||
CREATE_BY CHARACTER,
|
||||
CREATE_TIME TIMESTAMP,
|
||||
UPDATE_BY CHARACTER,
|
||||
UPDATE_TIME TIMESTAMP,
|
||||
MEASURE_CODE CHARACTER,
|
||||
MEASURE_DESCRIPTION CHARACTER,
|
||||
MEASURE_NAME CHARACTER,
|
||||
MEASURE_TYPE CHARACTER,
|
||||
FACT_ID BIGINT,
|
||||
constraint FK5LVBNRVJGJLN15PQ2C37FLEYJ
|
||||
foreign key (FACT_ID) references IDX_FACT
|
||||
);
|
||||
|
||||
create table IDX_MODEL
|
||||
(
|
||||
DIMENSION_ID BIGINT auto_increment
|
||||
primary key,
|
||||
CREATE_BY CHARACTER,
|
||||
CREATE_TIME TIMESTAMP,
|
||||
UPDATE_BY CHARACTER,
|
||||
UPDATE_TIME TIMESTAMP,
|
||||
DIMENSION_CODE CHARACTER,
|
||||
DIMENSION_DESCRIPTION CHARACTER,
|
||||
DIMENSION_NAME CHARACTER,
|
||||
INDEX_DIMENSION BOOLEAN,
|
||||
TIME_DIMENSION BOOLEAN
|
||||
);
|
||||
|
||||
|
||||
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
Reference in New Issue
Block a user