模板解析字典功能
This commit is contained in:
@@ -28,6 +28,19 @@ public enum AccessResponseEnum {
|
||||
|
||||
NO_RECEIVE_FROM_DEV("A0306","未收到装置注册响应,请核查!"),
|
||||
|
||||
DICT_MISSING("A0307","字典数据缺失!"),
|
||||
EPD_DICT_MISSING("A0307","Epd字典数据缺失!"),
|
||||
PQD_DICT_MISSING("A0307","Pqd字典数据缺失!"),
|
||||
BMD_DICT_MISSING("A0307","Bmd字典数据缺失!"),
|
||||
Evt_DICT_MISSING("A0307","Evt字典数据缺失!"),
|
||||
ALM_DICT_MISSING("A0307","Alm字典数据缺失!"),
|
||||
STS_DICT_MISSING("A0307","Sts字典数据缺失!"),
|
||||
DI_DICT_MISSING("A0307","Di字典数据缺失!"),
|
||||
DO_DICT_MISSING("A0307","Do字典数据缺失!"),
|
||||
PARM_DICT_MISSING("A0307","Parm字典数据缺失!"),
|
||||
SET_DICT_MISSING("A0307","Set字典数据缺失!"),
|
||||
INSET_DICT_MISSING("A0307","InSet字典数据缺失!"),
|
||||
CTRL_DICT_MISSING("A0307","Ctrl字典数据缺失!"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -63,6 +63,22 @@ public enum TypeEnum {
|
||||
DATA_13("0x0D","内部定值InSet"),
|
||||
DATA_14("0x0E","控制Ctrl"),
|
||||
|
||||
/**
|
||||
* 数据模型列表
|
||||
*/
|
||||
EPD("Epd","电能数据"),
|
||||
PQD("Pqd","电能质量数据"),
|
||||
BMD("Bmd","基础测量数据"),
|
||||
EVT("Evt","事件"),
|
||||
ALM("Alm","告警"),
|
||||
STS("Sts","状态"),
|
||||
DI("Di","开入"),
|
||||
DO("Do","开出"),
|
||||
PARM("Parm","参数"),
|
||||
SET("Set","定值"),
|
||||
INSET("InSet","内部定值"),
|
||||
CTRL("Ctrl","控制"),
|
||||
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -30,6 +30,6 @@ public class AlmDto implements Serializable {
|
||||
|
||||
@SerializedName("Type")
|
||||
@NotNull(message = "告警事件类别,不为空")
|
||||
private String type;
|
||||
private String eventType;
|
||||
|
||||
}
|
||||
|
||||
@@ -36,11 +36,11 @@ public class CtrlDto implements Serializable {
|
||||
|
||||
@SerializedName("Check")
|
||||
@NotNull(message = "是否需遥控校验,不为空")
|
||||
private Integer check;
|
||||
private Integer curSts;
|
||||
|
||||
@SerializedName("auto")
|
||||
@NotNull(message = "是否支持自动控制,不为空")
|
||||
private Integer auto;
|
||||
private Integer ctlSts;
|
||||
|
||||
@SerializedName("MaxNum")
|
||||
@ApiModelProperty("设置最大值")
|
||||
@@ -60,5 +60,5 @@ public class CtrlDto implements Serializable {
|
||||
|
||||
@SerializedName("Encode")
|
||||
@NotNull(message = "是否加密,不为空")
|
||||
private Integer encode;
|
||||
private Integer storeFlag;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class EvtDto implements Serializable {
|
||||
|
||||
@SerializedName("Type")
|
||||
@NotNull(message = "事件类别,不为空")
|
||||
private String type;
|
||||
private String eventType;
|
||||
|
||||
@SerializedName("Parm")
|
||||
private List<EvtParamDto> param;
|
||||
|
||||
@@ -33,15 +33,15 @@ public class ParmDto implements Serializable {
|
||||
@SerializedName("Type")
|
||||
@NotNull(message = "参数类型,不为空")
|
||||
@ApiModelProperty("系统参数:sys 运行参数:run 功能参数:fun")
|
||||
private String type;
|
||||
private String eventType;
|
||||
|
||||
@SerializedName("DataType")
|
||||
@NotNull(message = "参数数据类型,不为空")
|
||||
private String dataType;
|
||||
private String type;
|
||||
|
||||
@SerializedName("ModifyFlag")
|
||||
@NotNull(message = "是否可修改,不为空")
|
||||
private Integer modifyFlag;
|
||||
private Integer ctlSts;
|
||||
|
||||
@SerializedName("MaxNum")
|
||||
@ApiModelProperty("设置最大值")
|
||||
@@ -57,7 +57,7 @@ public class ParmDto implements Serializable {
|
||||
|
||||
@SerializedName("Strlen")
|
||||
@ApiModelProperty("参数string可设置字符串的长度上限")
|
||||
private Integer strLen;
|
||||
private Integer strlen;
|
||||
|
||||
@SerializedName("DefaultValue")
|
||||
@NotNull(message = "参数缺省值")
|
||||
|
||||
@@ -31,7 +31,7 @@ public class SetDto implements Serializable {
|
||||
|
||||
@SerializedName("DataType")
|
||||
@NotNull(message = "参数数据类型,不为空")
|
||||
private String dataType;
|
||||
private String type;
|
||||
|
||||
@SerializedName("MaxNum")
|
||||
@ApiModelProperty("设置最大值")
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
package com.njcn.access.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -23,6 +17,7 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_alm")
|
||||
@Deprecated
|
||||
public class CsAlmPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -14,6 +14,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@TableName("cs_bmd")
|
||||
@Deprecated
|
||||
public class CsBmdPO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.njcn.access.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.naming.Name;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -22,6 +19,7 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_ctrl")
|
||||
@Deprecated
|
||||
public class CsCtrlPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -39,7 +37,7 @@ public class CsCtrlPO extends BaseEntity {
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@TableId(value = "name")
|
||||
@MppMultiId(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
@@ -60,7 +58,7 @@ public class CsCtrlPO extends BaseEntity {
|
||||
/**
|
||||
* 是否需遥控校验 “1”“0”
|
||||
*/
|
||||
private Integer check;
|
||||
private Integer remoteControlCheck;
|
||||
|
||||
/**
|
||||
* 是否支持自动控制 “1”“0”
|
||||
@@ -97,25 +95,5 @@ public class CsCtrlPO extends BaseEntity {
|
||||
*/
|
||||
private String classId;
|
||||
|
||||
/**
|
||||
* 创建用户
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.njcn.access.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 详细数据表
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("cs_data_array")
|
||||
public class CsDataArrayPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 数据集表id(cs_data_set)
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 数据字典表id(cs_pqd_epd、cs_md..)
|
||||
*/
|
||||
private String dataId;
|
||||
|
||||
/**
|
||||
* 数据名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 数据别名
|
||||
*/
|
||||
private String anotherName;
|
||||
|
||||
/**
|
||||
* 字典序号
|
||||
*/
|
||||
private Integer idx;
|
||||
|
||||
/**
|
||||
* 排序(数据解析序号)
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 数据统计方法(max、min、avg、cp95)
|
||||
*/
|
||||
private String statMethod;
|
||||
|
||||
/**
|
||||
* 数据类型(Float)
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 相别(A、B、C...)
|
||||
*/
|
||||
private String phase;
|
||||
|
||||
/**
|
||||
* influxdb表名
|
||||
*/
|
||||
private String classId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.access.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据集表
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_data_set")
|
||||
public class CsDataSetPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 装置数据模板表Id(cs_dev_model)
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 数据集名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 数据集别名
|
||||
*/
|
||||
private String anotherName;
|
||||
|
||||
/**
|
||||
* 字典序号
|
||||
*/
|
||||
private Integer idx;
|
||||
|
||||
/**
|
||||
* 数据类型(Rt:实时数据、Stat:统计数据)
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 周期
|
||||
*/
|
||||
private Integer period;
|
||||
|
||||
/**
|
||||
* 是否存储 0:不存储 1:存储
|
||||
*/
|
||||
private Integer storeFlag;
|
||||
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_di")
|
||||
@Deprecated
|
||||
public class CsDiPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -23,6 +23,7 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_do")
|
||||
@Deprecated
|
||||
public class CsDoPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -17,6 +17,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@TableName("cs_epd_pqd")
|
||||
@Deprecated
|
||||
public class CsEpdPqdPO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.time.LocalDateTime;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_evt")
|
||||
@Deprecated
|
||||
public class CsEvtPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.access.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -20,6 +21,7 @@ import lombok.Setter;
|
||||
*/
|
||||
@Data
|
||||
@TableName("cs_parm")
|
||||
@Deprecated
|
||||
public class CsParmPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -34,7 +36,7 @@ public class CsParmPO extends BaseEntity {
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@TableId(value = "name")
|
||||
@MppMultiId(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
@@ -87,21 +89,6 @@ public class CsParmPO extends BaseEntity {
|
||||
*/
|
||||
private String defaultValue;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 数据分类,唯一类别
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.access.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -22,6 +23,7 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_set")
|
||||
@Deprecated
|
||||
public class CsSetPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -39,7 +41,7 @@ public class CsSetPO extends BaseEntity {
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@TableId(value = "name")
|
||||
@MppMultiId(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,7 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("cs_sts")
|
||||
@Deprecated
|
||||
public class CsStsPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -30,6 +30,11 @@
|
||||
<artifactId>algorithm-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>cs-system-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.njcn.access.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.access.pojo.po.CsCtrlPO;
|
||||
|
||||
/**
|
||||
@@ -11,6 +11,6 @@ import com.njcn.access.pojo.po.CsCtrlPO;
|
||||
* @author xuyang
|
||||
* @since 2023-05-19
|
||||
*/
|
||||
public interface CsCtrlMapper extends BaseMapper<CsCtrlPO> {
|
||||
public interface CsCtrlMapper extends MppBaseMapper<CsCtrlPO> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.access.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.access.pojo.po.CsDataArrayPO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 详细数据表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
public interface CsDataArrayMapper extends BaseMapper<CsDataArrayPO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.access.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.access.pojo.po.CsDataSetPO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据集表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
public interface CsDataSetMapper extends BaseMapper<CsDataSetPO> {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.access.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.access.pojo.po.CsParmPO;
|
||||
|
||||
/**
|
||||
@@ -11,6 +12,6 @@ import com.njcn.access.pojo.po.CsParmPO;
|
||||
* @author xuyang
|
||||
* @since 2023-05-19
|
||||
*/
|
||||
public interface CsParmMapper extends BaseMapper<CsParmPO> {
|
||||
public interface CsParmMapper extends MppBaseMapper<CsParmPO> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.njcn.access.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.access.pojo.po.CsSetPO;
|
||||
|
||||
/**
|
||||
@@ -11,6 +11,6 @@ import com.njcn.access.pojo.po.CsSetPO;
|
||||
* @author xuyang
|
||||
* @since 2023-05-19
|
||||
*/
|
||||
public interface CsSetMapper extends BaseMapper<CsSetPO> {
|
||||
public interface CsSetMapper extends MppBaseMapper<CsSetPO> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.njcn.access.service;
|
||||
|
||||
import com.njcn.access.pojo.po.CsCtrlPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 控制表 服务类
|
||||
@@ -10,4 +14,6 @@ package com.njcn.access.service;
|
||||
*/
|
||||
public interface ICsCtrlService {
|
||||
|
||||
void saveData(List<CsCtrlPO> list);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.access.service;
|
||||
|
||||
import com.njcn.access.pojo.po.CsDataArrayPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 详细数据表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
public interface ICsDataArrayService {
|
||||
|
||||
void saveData(List<CsDataArrayPO> list);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.access.service;
|
||||
|
||||
import com.njcn.access.pojo.po.CsDataSetPO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据集表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
public interface ICsDataSetService {
|
||||
|
||||
CsDataSetPO addOne(CsDataSetPO csDataSetPo);
|
||||
|
||||
}
|
||||
@@ -15,4 +15,6 @@ import java.util.List;
|
||||
public interface ICsEpdPqdService {
|
||||
|
||||
void saveData(List<CsEpdPqdPO> list);
|
||||
|
||||
// CsEpdPqdPO findOne(Integer idx);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.njcn.access.service;
|
||||
|
||||
import com.njcn.access.pojo.po.CsParmPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 参数表 服务类
|
||||
@@ -10,4 +14,6 @@ package com.njcn.access.service;
|
||||
*/
|
||||
public interface ICsParmService {
|
||||
|
||||
void saveData(List<CsParmPO> list);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.njcn.access.service;
|
||||
|
||||
import com.njcn.access.pojo.po.CsSetPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设备定值数据表 服务类
|
||||
@@ -10,4 +14,6 @@ package com.njcn.access.service;
|
||||
*/
|
||||
public interface ICsSetService {
|
||||
|
||||
void saveData(List<CsSetPO> list);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.njcn.access.service.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.access.mapper.CsCtrlMapper;
|
||||
import com.njcn.access.pojo.po.CsCtrlPO;
|
||||
import com.njcn.access.service.ICsCtrlService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 控制表 服务实现类
|
||||
@@ -15,6 +17,10 @@ import org.springframework.stereotype.Service;
|
||||
* @since 2023-05-19
|
||||
*/
|
||||
@Service
|
||||
public class CsCtrlServiceImpl extends ServiceImpl<CsCtrlMapper, CsCtrlPO> implements ICsCtrlService {
|
||||
public class CsCtrlServiceImpl extends MppServiceImpl<CsCtrlMapper, CsCtrlPO> implements ICsCtrlService {
|
||||
|
||||
@Override
|
||||
public void saveData(List<CsCtrlPO> list) {
|
||||
this.saveOrUpdateBatchByMultiId(list,100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.access.service.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.access.mapper.CsDataArrayMapper;
|
||||
import com.njcn.access.pojo.po.CsDataArrayPO;
|
||||
import com.njcn.access.service.ICsDataArrayService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 详细数据表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
@Service
|
||||
public class CsDataArrayServiceImpl extends ServiceImpl<CsDataArrayMapper, CsDataArrayPO> implements ICsDataArrayService {
|
||||
|
||||
@Override
|
||||
public void saveData(List<CsDataArrayPO> list) {
|
||||
this.saveBatch(list,100);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.access.service.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.access.mapper.CsDataSetMapper;
|
||||
import com.njcn.access.pojo.po.CsDataSetPO;
|
||||
import com.njcn.access.service.ICsDataSetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据集表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xuyang
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
@Service
|
||||
public class CsDataSetServiceImpl extends ServiceImpl<CsDataSetMapper, CsDataSetPO> implements ICsDataSetService {
|
||||
|
||||
@Override
|
||||
public CsDataSetPO addOne(CsDataSetPO csDataSetPo) {
|
||||
this.save(csDataSetPo);
|
||||
return csDataSetPo;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.njcn.access.service.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.access.enums.AccessResponseEnum;
|
||||
import com.njcn.access.mapper.CsEpdPqdMapper;
|
||||
import com.njcn.access.pojo.po.CsEpdPqdPO;
|
||||
import com.njcn.access.service.ICsEpdPqdService;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -23,4 +27,15 @@ public class CsEpdPqdServiceImpl extends MppServiceImpl<CsEpdPqdMapper, CsEpdPqd
|
||||
public void saveData(List<CsEpdPqdPO> list) {
|
||||
this.saveOrUpdateBatchByMultiId(list,100);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public CsEpdPqdPO findOne(Integer idx) {
|
||||
// LambdaQueryWrapper<CsEpdPqdPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(CsEpdPqdPO::getClassId, DataType.POWER_DATA).eq(CsEpdPqdPO::getIdx,idx);
|
||||
// CsEpdPqdPO csEpdPqdPo = this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
// if (Objects.isNull(csEpdPqdPo)) {
|
||||
// throw new BusinessException(AccessResponseEnum.DICT_MISSING);
|
||||
// }
|
||||
// return csEpdPqdPo;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@ public class CsEvtParmServiceImpl extends MppServiceImpl<CsEvtParmMapper, CsEvtP
|
||||
|
||||
@Override
|
||||
public boolean saveData(List<CsEvtParmPO> list) {
|
||||
return this.saveOrUpdateBatchByMultiId(list,100);
|
||||
return this.saveOrUpdateBatchByMultiId(list,1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.njcn.access.service.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.access.mapper.CsParmMapper;
|
||||
import com.njcn.access.pojo.po.CsParmPO;
|
||||
import com.njcn.access.service.ICsParmService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 参数表 服务实现类
|
||||
@@ -15,6 +18,10 @@ import org.springframework.stereotype.Service;
|
||||
* @since 2023-05-19
|
||||
*/
|
||||
@Service
|
||||
public class CsParmServiceImpl extends ServiceImpl<CsParmMapper, CsParmPO> implements ICsParmService {
|
||||
public class CsParmServiceImpl extends MppServiceImpl<CsParmMapper, CsParmPO> implements ICsParmService {
|
||||
|
||||
@Override
|
||||
public void saveData(List<CsParmPO> list) {
|
||||
this.saveOrUpdateBatchByMultiId(list,100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.njcn.access.service.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.access.mapper.CsSetMapper;
|
||||
import com.njcn.access.pojo.po.CsSetPO;
|
||||
import com.njcn.access.service.ICsSetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设备定值数据表 服务实现类
|
||||
@@ -15,6 +18,10 @@ import org.springframework.stereotype.Service;
|
||||
* @since 2023-05-19
|
||||
*/
|
||||
@Service
|
||||
public class CsSetServiceImpl extends ServiceImpl<CsSetMapper, CsSetPO> implements ICsSetService {
|
||||
public class CsSetServiceImpl extends MppServiceImpl<CsSetMapper, CsSetPO> implements ICsSetService {
|
||||
|
||||
@Override
|
||||
public void saveData(List<CsSetPO> list) {
|
||||
this.saveOrUpdateBatchByMultiId(list,100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.njcn.access.service.serviceImpl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.njcn.access.enums.AccessResponseEnum;
|
||||
import com.njcn.access.enums.TypeEnum;
|
||||
import com.njcn.access.pojo.dto.data.*;
|
||||
import com.njcn.access.pojo.dto.devModel.*;
|
||||
import com.njcn.access.pojo.param.DevModelParam;
|
||||
@@ -11,24 +14,32 @@ import com.njcn.access.utils.JsonUtil;
|
||||
import com.njcn.algorithm.api.CsDictFeignClient;
|
||||
import com.njcn.algorithm.api.DevModelFeignClient;
|
||||
import com.njcn.algorithm.pojo.dto.CsDictDTO;
|
||||
import com.njcn.algorithm.pojo.param.CsDevModelAddParm;
|
||||
import com.njcn.algorithm.pojo.po.CsDevModelPO;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.EpdFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLOutput;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
@@ -78,6 +89,11 @@ public class DevModelServiceImpl implements IDevModelService {
|
||||
|
||||
private final ICsSetService csSetService;
|
||||
|
||||
private final ICsDataSetService csDataSetService;
|
||||
|
||||
private final ICsDataArrayService csDataArrayService;
|
||||
|
||||
private final EpdFeignClient epdFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -102,18 +118,6 @@ public class DevModelServiceImpl implements IDevModelService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增cs_data_set
|
||||
*/
|
||||
// public void insertDataSet(List<DataSetDTO> dataSet,String id){
|
||||
// dataSet.forEach(item->{
|
||||
// DataSetDTO dataSetDTO = new DataSetDTO();
|
||||
//
|
||||
//
|
||||
//
|
||||
// });
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增直连设备、网关模板信息
|
||||
*/
|
||||
@@ -151,7 +155,7 @@ public class DevModelServiceImpl implements IDevModelService {
|
||||
// if (!Objects.isNull(csDevModelPo)){
|
||||
// throw new BusinessException(AccessResponseEnum.MODEL_REPEAT);
|
||||
// }
|
||||
// //录入基础模板数据
|
||||
// /**录入基础模板数据*/
|
||||
// CsDevModelAddParm csDevModelAddParm = new CsDevModelAddParm();
|
||||
// csDevModelAddParm.setDevType(devType);
|
||||
// csDevModelAddParm.setName(devType);
|
||||
@@ -168,180 +172,467 @@ public class DevModelServiceImpl implements IDevModelService {
|
||||
// csDevModelAddParm.setSoftInfoId(softInfoId);
|
||||
// }
|
||||
// devModelFeignClient.addDevModel(csDevModelAddParm);
|
||||
//录入字典数据
|
||||
// /**录入数据模型列表*/
|
||||
//录入EPD
|
||||
List<EpdPqdDto> epdDto = devModDto.getDataList().get(0).getEpdDto();
|
||||
if (!CollectionUtils.isEmpty(epdDto)){
|
||||
insertEpdPqd(epdDto);
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.EPD.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.EPD_DICT_MISSING);
|
||||
}
|
||||
insertEpdPqd(epdDto,dictData);
|
||||
}
|
||||
//录入PQD
|
||||
List<EpdPqdDto> pqdDto = devModDto.getDataList().get(0).getPqdDto();
|
||||
if (!CollectionUtils.isEmpty(pqdDto)){
|
||||
insertEpdPqd(pqdDto);
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.PQD.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.PQD_DICT_MISSING);
|
||||
}
|
||||
insertEpdPqd(pqdDto,dictData);
|
||||
}
|
||||
//录入Bmd
|
||||
List<BmdDto> bmdDto = devModDto.getDataList().get(0).getBmdDto();
|
||||
if (!CollectionUtils.isEmpty(bmdDto)){
|
||||
insertBmd(bmdDto);
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.BMD.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.BMD_DICT_MISSING);
|
||||
}
|
||||
insertBmd(bmdDto,dictData);
|
||||
}
|
||||
//录入Evt
|
||||
List<EvtDto> evtDto = devModDto.getDataList().get(0).getEvtDto();
|
||||
if (!CollectionUtils.isEmpty(evtDto)){
|
||||
insertEvt(evtDto);
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.EVT.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.Evt_DICT_MISSING);
|
||||
}
|
||||
insertEvt(evtDto,dictData);
|
||||
}
|
||||
//录入Alm
|
||||
List<AlmDto> almDto = devModDto.getDataList().get(0).getAlmDto();
|
||||
if (!CollectionUtils.isEmpty(almDto)){
|
||||
insertAlm(almDto);
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.ALM.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.ALM_DICT_MISSING);
|
||||
}
|
||||
insertAlm(almDto,dictData);
|
||||
}
|
||||
//录入Alm
|
||||
//录入Sts
|
||||
List<StsDto> stsDto = devModDto.getDataList().get(0).getStsDto();
|
||||
if (!CollectionUtils.isEmpty(stsDto)){
|
||||
insertSts(stsDto);
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.STS.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.STS_DICT_MISSING);
|
||||
}
|
||||
insertSts(stsDto,dictData);
|
||||
}
|
||||
//录入Di
|
||||
List<DiDto> diDto = devModDto.getDataList().get(0).getDiDto();
|
||||
if (!CollectionUtils.isEmpty(diDto)){
|
||||
insertDi(diDto);
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DI.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.DI_DICT_MISSING);
|
||||
}
|
||||
insertDi(diDto,dictData);
|
||||
}
|
||||
//录入Do
|
||||
List<DoDto> doDto = devModDto.getDataList().get(0).getDoDto();
|
||||
if (!CollectionUtils.isEmpty(doDto)){
|
||||
insertDo(doDto);
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DO.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.DO_DICT_MISSING);
|
||||
}
|
||||
insertDo(doDto,dictData);
|
||||
}
|
||||
//录入Parm
|
||||
List<ParmDto> parmDto = devModDto.getDataList().get(0).getParmDto();
|
||||
if (!CollectionUtils.isEmpty(parmDto)){
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.PARM.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.PARM_DICT_MISSING);
|
||||
}
|
||||
insertParm(parmDto,dictData);
|
||||
}
|
||||
//录入Set
|
||||
List<SetDto> setDto = devModDto.getDataList().get(0).getSetDto();
|
||||
if (!CollectionUtils.isEmpty(setDto)){
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.SET.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.SET_DICT_MISSING);
|
||||
}
|
||||
insertSet(setDto,dictData);
|
||||
}
|
||||
//录入InSet
|
||||
List<InSetDto> inSetDto = devModDto.getDataList().get(0).getInSetDto();
|
||||
if (!CollectionUtils.isEmpty(inSetDto)){
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.INSET.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.INSET_DICT_MISSING);
|
||||
}
|
||||
insertInSet(inSetDto,dictData);
|
||||
}
|
||||
//录入Ctrl
|
||||
List<CtrlDto> ctrlDto = devModDto.getDataList().get(0).getCtrlDto();
|
||||
if (!CollectionUtils.isEmpty(ctrlDto)){
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.CTRL.getCode()).getData();
|
||||
if (StringUtils.isBlank(dictData.getId())){
|
||||
throw new BusinessException(AccessResponseEnum.CTRL_DICT_MISSING);
|
||||
}
|
||||
insertCtrl(ctrlDto,dictData);
|
||||
}
|
||||
|
||||
|
||||
// /**录入数据集*/
|
||||
// List<DataSetDto> dataSetDtoList = devModDto.getDataSetDtoList();
|
||||
// if (!CollectionUtils.isEmpty(dataSetDtoList)){
|
||||
// insertDataSet(dataSetDtoList,"60b55915717c0cfd8935e04633657034");
|
||||
// }
|
||||
// /**录入逻辑子设备序列*/
|
||||
// List<ClDevDto> clDevDtoList = devModDto.getClDevDtoList();
|
||||
}
|
||||
|
||||
/**
|
||||
* EPD、PQD字典录入
|
||||
*/
|
||||
public void insertEpdPqd(List<EpdPqdDto> epdPqdDto) {
|
||||
List<CsEpdPqdPO> list = epdPqdDto.stream().map(item->{
|
||||
CsEpdPqdPO csEpdPqdPo = new CsEpdPqdPO();
|
||||
BeanUtils.copyProperties(item,csEpdPqdPo);
|
||||
CsDictDTO csDictDTO = csDictFeignClient.getOwnAndFatherData(item.getName()).getData();
|
||||
public void insertEpdPqd(List<EpdPqdDto> epdPqdDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = epdPqdDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
if (Objects.isNull(item.getPhase())){
|
||||
csEpdPqdPo.setPhase("M");
|
||||
param.setPhase("M");
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(item.getStatMethod())){
|
||||
csEpdPqdPo.setStatMethod(item.getStatMethod().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
param.setStatMethod(item.getStatMethod().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
}
|
||||
csEpdPqdPo.setAnotherName(csDictDTO.getName());
|
||||
csEpdPqdPo.setClassId(csDictDTO.getFatherName());
|
||||
return csEpdPqdPo;
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
csEpdPqdService.saveData(list);
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bmd字典录入
|
||||
*/
|
||||
public void insertBmd(List<BmdDto> bmdDto) {
|
||||
List<CsBmdPO> list = bmdDto.stream().map(item->{
|
||||
CsBmdPO csBmdPo = new CsBmdPO();
|
||||
BeanUtils.copyProperties(item,csBmdPo);
|
||||
CsDictDTO csDictDTO = csDictFeignClient.getOwnAndFatherData(item.getName()).getData();
|
||||
public void insertBmd(List<BmdDto> bmdDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = bmdDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
if (Objects.isNull(item.getPhase())){
|
||||
csBmdPo.setPhase("M");
|
||||
param.setPhase("M");
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(item.getStatMethod())){
|
||||
csBmdPo.setStatMethod(item.getStatMethod().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
param.setStatMethod(item.getStatMethod().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
}
|
||||
csBmdPo.setAnotherName(csDictDTO.getName());
|
||||
csBmdPo.setClassId(csDictDTO.getFatherName());
|
||||
return csBmdPo;
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
csBmdService.saveData(list);
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Evt字典录入
|
||||
*/
|
||||
public void insertEvt(List<EvtDto> evtDto) {
|
||||
List<CsEvtParmPO> parmList = new ArrayList<>();
|
||||
List<CsEvtPO> evtList = evtDto.stream().map(item->{
|
||||
CsEvtPO csEvtPo = new CsEvtPO();
|
||||
BeanUtils.copyProperties(item,csEvtPo);
|
||||
CsDictDTO csDictDTO = csDictFeignClient.getOwnAndFatherData(item.getName()).getData();
|
||||
csEvtPo.setAnotherName(csDictDTO.getName());
|
||||
csEvtPo.setClassId(csDictDTO.getFatherName());
|
||||
return csEvtPo;
|
||||
public void insertEvt(List<EvtDto> evtDto,DictData dictData) {
|
||||
Map<String,List<EvtParamDto>> map = new HashMap<>();
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = evtDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
param.setPhase("M");
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
map.put(item.getName(),item.getParam());
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
Map<String,String> map = csEvtService.saveData(evtList);
|
||||
evtDto.forEach(item->{
|
||||
List<EvtParamDto> evtParamDtoList = item.getParam();
|
||||
if (!CollectionUtils.isEmpty(evtParamDtoList)){
|
||||
evtParamDtoList.forEach(item2->{
|
||||
CsEvtParmPO csEvtParmPo = new CsEvtParmPO();
|
||||
BeanUtils.copyProperties(item2,csEvtParmPo);
|
||||
csEvtParmPo.setPid(map.get(item.getName()));
|
||||
parmList.add(csEvtParmPo);
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!CollectionUtils.isEmpty(parmList)){
|
||||
csEvtParmService.saveData(parmList);
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
List<CsEvtParmPO> evtParmList = new ArrayList<>();
|
||||
Map<String,String> map2 = epdFeignClient.addEvt(paramList).getData();
|
||||
paramList.forEach(item->{
|
||||
List<EvtParamDto> list = map.get(item.getName());
|
||||
if (!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(item2->{
|
||||
CsEvtParmPO csEvtParmPo = new CsEvtParmPO();
|
||||
BeanUtils.copyProperties(item2,csEvtParmPo);
|
||||
csEvtParmPo.setPid(map2.get(item.getName()));
|
||||
evtParmList.add(csEvtParmPo);
|
||||
});
|
||||
}
|
||||
});
|
||||
csEvtParmService.saveData(evtParmList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alm字典录入
|
||||
*/
|
||||
public void insertAlm(List<AlmDto> almDto) {
|
||||
List<CsAlmPO> list = almDto.stream().map(item->{
|
||||
CsAlmPO csAlmPo = new CsAlmPO();
|
||||
BeanUtils.copyProperties(item,csAlmPo);
|
||||
CsDictDTO csDictDTO = csDictFeignClient.getOwnAndFatherData(item.getName()).getData();
|
||||
csAlmPo.setAnotherName(csDictDTO.getName());
|
||||
csAlmPo.setClassId(csDictDTO.getFatherName());
|
||||
return csAlmPo;
|
||||
public void insertAlm(List<AlmDto> almDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = almDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
param.setPhase("M");
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
csAlmService.saveData(list);
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sts字典录入
|
||||
*/
|
||||
public void insertSts(List<StsDto> stsDto) {
|
||||
List<CsStsPO> list = stsDto.stream().map(item->{
|
||||
CsStsPO csStsPo = new CsStsPO();
|
||||
BeanUtils.copyProperties(item,csStsPo);
|
||||
CsDictDTO csDictDTO = csDictFeignClient.getOwnAndFatherData(item.getName()).getData();
|
||||
csStsPo.setAnotherName(csDictDTO.getName());
|
||||
csStsPo.setClassId(csDictDTO.getFatherName());
|
||||
return csStsPo;
|
||||
public void insertSts(List<StsDto> stsDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = stsDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
param.setPhase("M");
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
csStsService.saveData(list);
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Di字典录入
|
||||
*/
|
||||
public void insertDi(List<DiDto> diDto) {
|
||||
List<CsDiPO> list = diDto.stream().map(item->{
|
||||
CsDiPO csDiPo = new CsDiPO();
|
||||
BeanUtils.copyProperties(item,csDiPo);
|
||||
CsDictDTO csDictDTO = csDictFeignClient.getOwnAndFatherData(item.getName()).getData();
|
||||
csDiPo.setAnotherName(csDictDTO.getName());
|
||||
csDiPo.setClassId(csDictDTO.getFatherName());
|
||||
return csDiPo;
|
||||
public void insertDi(List<DiDto> diDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = diDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
param.setPhase("M");
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
csDiService.saveData(list);
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Do字典录入
|
||||
*/
|
||||
public void insertDo(List<DoDto> doDto) {
|
||||
List<CsDoPO> list = doDto.stream().map(item->{
|
||||
CsDoPO csDoPo = new CsDoPO();
|
||||
BeanUtils.copyProperties(item,csDoPo);
|
||||
CsDictDTO csDictDTO = csDictFeignClient.getOwnAndFatherData(item.getName()).getData();
|
||||
csDoPo.setAnotherName(csDictDTO.getName());
|
||||
csDoPo.setClassId(csDictDTO.getFatherName());
|
||||
return csDoPo;
|
||||
public void insertDo(List<DoDto> doDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = doDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
param.setPhase("M");
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
csDoService.saveData(list);
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parm字典录入
|
||||
*/
|
||||
public void insertParm(List<ParmDto> parmDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = parmDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
if (!CollectionUtils.isEmpty(item.getSetValue())){
|
||||
param.setSetValue(item.getSetValue().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
}
|
||||
param.setPhase("M");
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set字典录入
|
||||
*/
|
||||
public void insertSet(List<SetDto> setDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = setDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
param.setPhase("M");
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* InSet字典录入
|
||||
*/
|
||||
public void insertInSet(List<InSetDto> inSetDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = inSetDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
param.setPhase("M");
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ctrl字典录入
|
||||
*/
|
||||
public void insertCtrl(List<CtrlDto> ctrlDto,DictData dictData) {
|
||||
List<EleEpdPqd> dictList = epdFeignClient.dictMarkByDataType(dictData.getId()).getData();
|
||||
List<EleEpdPqdParam> paramList = ctrlDto.stream().map(item->{
|
||||
EleEpdPqdParam param = new EleEpdPqdParam();
|
||||
BeanUtils.copyProperties(item,param);
|
||||
if (!CollectionUtils.isEmpty(item.getCtlValue())){
|
||||
param.setSetValue(item.getCtlValue().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
}
|
||||
param.setPhase("M");
|
||||
param.setShowName(item.getName());
|
||||
param.setDataType(dictData.getId());
|
||||
param.setClassId(dictData.getValue());
|
||||
param.setSort(0);
|
||||
param.setSystemType("");
|
||||
return param;
|
||||
}).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(dictList)){
|
||||
//两个集合取差集
|
||||
paramList = paramList.stream().filter(item->!dictList.stream().map(item2->item2.getName()+"-"+item2.getPhase()+"-"+item2.getDataType()).collect(Collectors.toList()).contains(item.getName()+"-"+item.getPhase()+"-"+item.getDataType())).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(paramList)){
|
||||
epdFeignClient.addByModel(paramList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DataSet录入
|
||||
*/
|
||||
public void insertDataSet(List<DataSetDto> dataSetDtoList,String pid) {
|
||||
dataSetDtoList.forEach(item->{
|
||||
CsDataSetPO csDataSetPo = new CsDataSetPO();
|
||||
BeanUtils.copyProperties(item,csDataSetPo);
|
||||
CsDictDTO csDictDTO = csDictFeignClient.getOwnAndFatherData(item.getName()).getData();
|
||||
csDataSetPo.setAnotherName(csDictDTO.getName());
|
||||
if (csDictDTO.getName().contains("Rt")){
|
||||
csDataSetPo.setDataType("实时数据");
|
||||
} else if (csDictDTO.getName().contains("Stat")){
|
||||
csDataSetPo.setDataType("统计数据");
|
||||
}
|
||||
csDataSetPo.setPid(pid);
|
||||
csDataSetService.addOne(csDataSetPo);
|
||||
List<DataArrayDto> dataArrayDto = item.getDataArrayDtoList();
|
||||
if (!CollectionUtils.isEmpty(dataArrayDto)){
|
||||
insertDataArray(dataArrayDto,csDataSetPo.getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* DataArray录入
|
||||
*/
|
||||
public void insertDataArray(List<DataArrayDto> dataArrayDto,String pid) {
|
||||
List<CsDataArrayPO> list = new ArrayList<>();
|
||||
dataArrayDto.forEach(item->{
|
||||
int sort = 0;
|
||||
CsDataArrayPO csDataArrayPo = new CsDataArrayPO();
|
||||
csDataArrayPo.setPid(pid);
|
||||
list.add(csDataArrayPo);
|
||||
});
|
||||
csDataArrayService.saveData(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ spring:
|
||||
shared-configs:
|
||||
- data-id: share-config.yaml
|
||||
refresh: true
|
||||
- data-Id: share-config-datasource-db.yaml
|
||||
- data-Id: algorithm-config.yaml
|
||||
refresh: true
|
||||
- data-Id: kafka-config.yaml
|
||||
refresh: true
|
||||
|
||||
Reference in New Issue
Block a user