Merge branch 'main' of http://dev.xinyingpower.com:8080/git/cac/backend
commit
4b84f77cf4
@ -0,0 +1,74 @@
|
|||||||
|
package com.xydl.cac.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Entity
|
||||||
|
@Table(name = "icd_config_type")
|
||||||
|
@ApiModel("ICD配置类型表")
|
||||||
|
public class IcdConfigType {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Column(name = "ied_name")
|
||||||
|
private String iedName;
|
||||||
|
|
||||||
|
@Column(name = "ldevice_inst")
|
||||||
|
private String ldeviceInst;
|
||||||
|
|
||||||
|
@Column(name = "ln_class")
|
||||||
|
private String lnClass;
|
||||||
|
|
||||||
|
@Column(name = "table_name")
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private LinkedHashMap<String, IcdConfigTypeAtt> attMap;
|
||||||
|
@Transient
|
||||||
|
private List<IcdConfigTypeAtt> attList;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private LinkedHashMap<String, IcdConfigTypeInst> instMap;
|
||||||
|
@Transient
|
||||||
|
private List<IcdConfigTypeInst> instList;
|
||||||
|
|
||||||
|
public void addAtt(String doName, String lastname) {
|
||||||
|
if (attMap == null) {
|
||||||
|
attMap = new LinkedHashMap<>();
|
||||||
|
}
|
||||||
|
if (!attMap.containsKey(doName)) {
|
||||||
|
IcdConfigTypeAtt item = IcdConfigTypeAtt.builder()
|
||||||
|
.doName(doName)
|
||||||
|
.lastName(lastname)
|
||||||
|
.build();
|
||||||
|
attMap.put(doName, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addInst(String inst) {
|
||||||
|
if (instMap == null) {
|
||||||
|
instMap = new LinkedHashMap<>();
|
||||||
|
}
|
||||||
|
if (!instMap.containsKey(inst)) {
|
||||||
|
IcdConfigTypeInst item = IcdConfigTypeInst.builder()
|
||||||
|
.inst(inst)
|
||||||
|
.build();
|
||||||
|
instMap.put(inst, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.xydl.cac.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Entity
|
||||||
|
@Table(name = "icd_config_type_att")
|
||||||
|
@ApiModel("ICD配置类型属性表")
|
||||||
|
public class IcdConfigTypeAtt {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Column(name = "icd_config_type_id")
|
||||||
|
private Integer icdConfigTypeId;
|
||||||
|
|
||||||
|
@Column(name = "do_name")
|
||||||
|
private String doName;
|
||||||
|
|
||||||
|
@Column(name = "last_name")
|
||||||
|
private String lastName;
|
||||||
|
|
||||||
|
@Column(name = "col_name")
|
||||||
|
private String colName;
|
||||||
|
|
||||||
|
}
|
@ -1,66 +0,0 @@
|
|||||||
package com.xydl.cac.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Entity
|
|
||||||
@Table(name = "icd_file_config")
|
|
||||||
@ApiModel("ICD文件配置表")
|
|
||||||
public class IcdFileConfig {
|
|
||||||
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
@Column(name = "id")
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Column(name = "ied_name")
|
|
||||||
private String iedName;
|
|
||||||
|
|
||||||
@Column(name = "ldevice_inst")
|
|
||||||
private String ldeviceInst;
|
|
||||||
|
|
||||||
@Column(name = "ln_class")
|
|
||||||
private String lnClass;
|
|
||||||
|
|
||||||
@Column(name = "do_name")
|
|
||||||
private String doName;
|
|
||||||
|
|
||||||
@Column(name = "last_name")
|
|
||||||
private String lastName;
|
|
||||||
|
|
||||||
@Column(name = "table_name")
|
|
||||||
private String tableName;
|
|
||||||
|
|
||||||
@Column(name = "col_name")
|
|
||||||
private String colName;
|
|
||||||
|
|
||||||
@Transient
|
|
||||||
private List<IcdFileConfigInst> instList;
|
|
||||||
|
|
||||||
public void addInst(String inst, String paramindex) {
|
|
||||||
if (instList == null) {
|
|
||||||
instList = new ArrayList<>();
|
|
||||||
}
|
|
||||||
IcdFileConfigInst item = IcdFileConfigInst.builder()
|
|
||||||
.inst(inst)
|
|
||||||
.paramindex(paramindex)
|
|
||||||
.build();
|
|
||||||
instList.add(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String buildParamIndex(IcdFileConfigInst inst) {
|
|
||||||
String param = iedName + ldeviceInst + "/" + lnClass + inst.getInst() + "$" + inst.getParamindex();
|
|
||||||
return param;
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.xydl.cac.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Entity
|
||||||
|
@Table(name = "rptparamindex")
|
||||||
|
@ApiModel("绑定关系表")
|
||||||
|
public class Rptparamindex {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@ApiModelProperty("61850对象参引")
|
||||||
|
@Column(name = "paramindex")
|
||||||
|
private String paramindex;
|
||||||
|
|
||||||
|
@ApiModelProperty("61850对象id")
|
||||||
|
@Column(name = "objid")
|
||||||
|
private Integer objid;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测设备id")
|
||||||
|
@Column(name = "eqmid")
|
||||||
|
private Integer eqmid;
|
||||||
|
|
||||||
|
@Column(name = "tablename")
|
||||||
|
private String tablename;
|
||||||
|
|
||||||
|
@Column(name = "colname")
|
||||||
|
private String colname;
|
||||||
|
|
||||||
|
@Column(name = "phase")
|
||||||
|
private String phase;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.xydl.cac.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BindingModel {
|
||||||
|
@NotNull(message = "eqmid不能为空")
|
||||||
|
@ApiModelProperty("eqmid")
|
||||||
|
Integer eqmid;
|
||||||
|
@NotNull(message = "逻辑设备实例的Id不能为空")
|
||||||
|
@ApiModelProperty("逻辑设备实例的Id")
|
||||||
|
Integer bindingId;
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package com.xydl.cac.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ColumnModel {
|
||||||
|
private String name;
|
||||||
|
private String comment;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.xydl.cac.repository;
|
||||||
|
|
||||||
|
import com.xydl.cac.entity.IcdConfigTypeAtt;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface IcdConfigTypeAttRepository extends JpaRepository<IcdConfigTypeAtt, Integer>, JpaSpecificationExecutor<IcdConfigTypeAtt> {
|
||||||
|
|
||||||
|
List<IcdConfigTypeAtt> findByIcdConfigTypeId(Integer icdConfigTypeId);
|
||||||
|
|
||||||
|
void deleteByIcdConfigTypeId(Integer icdConfigTypeId);
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.xydl.cac.repository;
|
||||||
|
|
||||||
|
import com.xydl.cac.entity.IcdConfigTypeInst;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface IcdConfigTypeInstRepository extends JpaRepository<IcdConfigTypeInst, Integer>, JpaSpecificationExecutor<IcdConfigTypeInst> {
|
||||||
|
|
||||||
|
List<IcdConfigTypeInst> findByIcdConfigTypeId(Integer icdConfigTypeId);
|
||||||
|
|
||||||
|
void deleteByIcdConfigTypeId(Integer icdConfigTypeId);
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.xydl.cac.repository;
|
||||||
|
|
||||||
|
import com.xydl.cac.entity.IcdConfigType;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface IcdConfigTypeRepository extends JpaRepository<IcdConfigType, Integer>, JpaSpecificationExecutor<IcdConfigType> {
|
||||||
|
|
||||||
|
List<IcdConfigType> findByIedName(String iedName);
|
||||||
|
|
||||||
|
List<IcdConfigType> findByIedNameAndLdeviceInstAndLnClass(String iedName, String ldeviceInst, String lnClass);
|
||||||
|
|
||||||
|
}
|
@ -1,18 +0,0 @@
|
|||||||
package com.xydl.cac.repository;
|
|
||||||
|
|
||||||
import com.xydl.cac.entity.IcdFileConfigInst;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface IcdFileConfigInstRepository extends JpaRepository<IcdFileConfigInst, Integer>, JpaSpecificationExecutor<IcdFileConfigInst> {
|
|
||||||
|
|
||||||
List<IcdFileConfigInst> findByConfigId(Integer configId);
|
|
||||||
|
|
||||||
void deleteByConfigId(Integer configId);
|
|
||||||
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
package com.xydl.cac.repository;
|
|
||||||
|
|
||||||
import com.xydl.cac.entity.IcdFileConfig;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface IcdFileConfigRepository extends JpaRepository<IcdFileConfig, Integer>, JpaSpecificationExecutor<IcdFileConfig> {
|
|
||||||
|
|
||||||
List<IcdFileConfig> findByIedName(String iedName);
|
|
||||||
|
|
||||||
List<IcdFileConfig> findByIedNameAndLdeviceInstAndLnClassAndDoName(String iedName, String ldeviceInst, String lnClass, String doName);
|
|
||||||
}
|
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.xydl.cac.repository;
|
||||||
|
|
||||||
|
import com.xydl.cac.entity.Rptparamindex;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface RptparamindexRepository extends JpaRepository<Rptparamindex, String>, JpaSpecificationExecutor<Rptparamindex> {
|
||||||
|
|
||||||
|
}
|
@ -1,10 +1,17 @@
|
|||||||
package com.xydl.cac.service;
|
package com.xydl.cac.service;
|
||||||
|
|
||||||
import com.xydl.cac.entity.Bdz;
|
import com.xydl.cac.entity.Bdz;
|
||||||
|
import com.xydl.cac.entity.IcdConfigTypeInst;
|
||||||
|
import com.xydl.cac.entity.Rptparamindex;
|
||||||
|
import com.xydl.cac.model.BindingModel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ParamBindService {
|
public interface ParamBindService {
|
||||||
|
|
||||||
List<Bdz> getTree() throws Exception;
|
List<Bdz> getTree() throws Exception;
|
||||||
|
|
||||||
|
List<IcdConfigTypeInst> instList(String iedName);
|
||||||
|
|
||||||
|
List<Rptparamindex> preview(BindingModel item) throws Exception;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue