新增物接入流程
This commit is contained in:
@@ -26,6 +26,28 @@
|
|||||||
<version>4.11</version>
|
<version>4.11</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.8.9</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-swagger</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.nacos</groupId>
|
||||||
|
<artifactId>nacos-client</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.njcn.access.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2023年04月17日 10:50
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum AccessResponseEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A0301 ~ A0399 用于用户模块的枚举
|
||||||
|
* <p>
|
||||||
|
*/
|
||||||
|
MODEL_REPEAT("A0301", "模板重复,请勿重复录入!"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
AccessResponseEnum(String code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.access.param;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列化时,调整实体返回名称
|
||||||
|
* @author 徐扬
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
|
||||||
|
public @interface ParamName {
|
||||||
|
|
||||||
|
String value() default "";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.access.pojo.dto;
|
||||||
|
|
||||||
|
import com.njcn.access.param.ParamName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/3/31 14:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AccessDto implements Serializable {
|
||||||
|
|
||||||
|
@ParamName("NDID")
|
||||||
|
private String nDid;
|
||||||
|
|
||||||
|
@ParamName("dev_type")
|
||||||
|
private String devType;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.njcn.access.pojo.dto;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 10:47
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DevCfgDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("DID")
|
||||||
|
private String did;
|
||||||
|
|
||||||
|
@SerializedName("DevType")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.access.pojo.dto;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 10:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DevModelDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("DevType")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
@SerializedName("Version")
|
||||||
|
private String versionNo;
|
||||||
|
|
||||||
|
@SerializedName("Time")
|
||||||
|
private String versionDate;
|
||||||
|
|
||||||
|
@SerializedName("Crc")
|
||||||
|
private String crc;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.njcn.access.pojo.dto;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 10:54
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ModelDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("DevCfg")
|
||||||
|
private List<DevCfgDto> devCfg;
|
||||||
|
|
||||||
|
@SerializedName("DevMod")
|
||||||
|
private List<DevModelDto> devMod;
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.access.pojo.dto;
|
||||||
|
|
||||||
|
import com.njcn.access.param.ParamName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/3/31 14:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PublicDto implements Serializable {
|
||||||
|
|
||||||
|
private String mid;
|
||||||
|
|
||||||
|
@ParamName("NDID")
|
||||||
|
private String nDid;
|
||||||
|
|
||||||
|
private Long timestamp;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private AccessDto param;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.njcn.access.pojo.dto;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/12 19:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PublicParamDTO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在请求报文中该值为请求 ID,在设备主动上报数据的报文中该字段可不填写
|
||||||
|
*/
|
||||||
|
@SerializedName("mid")
|
||||||
|
private Integer mid;
|
||||||
|
|
||||||
|
@SerializedName("userId")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@SerializedName("deviceId")
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
@SerializedName("timestamp")
|
||||||
|
private String timestamp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文处理的优先级
|
||||||
|
*/
|
||||||
|
@SerializedName("level")
|
||||||
|
private Integer level;
|
||||||
|
|
||||||
|
@SerializedName("type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.njcn.access.pojo.dto;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/11 14:36
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class RegisterDTO extends PublicParamDTO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class RegisterRequest extends RegisterDTO implements Serializable{
|
||||||
|
|
||||||
|
@SerializedName("expire")
|
||||||
|
private Integer expire;
|
||||||
|
|
||||||
|
@SerializedName("param")
|
||||||
|
private RegisterParamDTO.RegisterParamRequest param;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应答参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class RegisterResponse extends RegisterDTO implements Serializable{
|
||||||
|
|
||||||
|
@SerializedName("code")
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
@SerializedName("msg")
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
@SerializedName("param")
|
||||||
|
private RegisterParamDTO.RegisterParamResponse param;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.njcn.access.pojo.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/11 14:58
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RegisterParamDTO implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("NDID")
|
||||||
|
private String nDid;
|
||||||
|
|
||||||
|
@SerializedName("DID")
|
||||||
|
private List<String> did;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class RegisterParamRequest extends RegisterParamDTO implements Serializable{
|
||||||
|
@SerializedName("type")
|
||||||
|
private Integer type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应答参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class RegisterParamResponse extends RegisterParamDTO implements Serializable{
|
||||||
|
@SerializedName("res")
|
||||||
|
private Integer res;
|
||||||
|
|
||||||
|
@SerializedName("type")
|
||||||
|
private Integer resType;
|
||||||
|
|
||||||
|
@SerializedName("NDID")
|
||||||
|
private String nDid;
|
||||||
|
|
||||||
|
@SerializedName("DEV_TYPE")
|
||||||
|
private String dev_type;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 14:45
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AlmDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("Type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 15:06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CtrlDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("Type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@SerializedName("Check")
|
||||||
|
private Integer remoteCheck;
|
||||||
|
|
||||||
|
@SerializedName("Auto")
|
||||||
|
private Integer auto;
|
||||||
|
|
||||||
|
@SerializedName("MaxNum")
|
||||||
|
private Integer maxNum;
|
||||||
|
|
||||||
|
@SerializedName("MinNum")
|
||||||
|
private Integer minNum;
|
||||||
|
|
||||||
|
@SerializedName("Ctlvalue")
|
||||||
|
private List<String> ctlValue;
|
||||||
|
|
||||||
|
@SerializedName("Strlen")
|
||||||
|
private Integer strLen;
|
||||||
|
|
||||||
|
@SerializedName("Encode")
|
||||||
|
private Integer encode;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 14:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class DiDto extends StsDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("TranFlag")
|
||||||
|
private Integer tranFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 14:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DoDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("CurSts")
|
||||||
|
private Integer curSts;
|
||||||
|
|
||||||
|
@SerializedName("CtlSts")
|
||||||
|
private Integer ctlSts;
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 14:27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EpdPqdDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("Type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@SerializedName("Phase")
|
||||||
|
private String phase;
|
||||||
|
|
||||||
|
@SerializedName("Unit")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@SerializedName("HarmStart")
|
||||||
|
private String harmStart;
|
||||||
|
|
||||||
|
@SerializedName("HarmEnd")
|
||||||
|
private String harmEnd;
|
||||||
|
|
||||||
|
@SerializedName("ClassID")
|
||||||
|
private String classId;
|
||||||
|
|
||||||
|
@SerializedName("StatMethod")
|
||||||
|
private List<String> statMethod;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 14:40
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EvtDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("Type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@SerializedName("Parm")
|
||||||
|
private List<EvtParamDto> param;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 14:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EvtParamDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("Type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@SerializedName("Unit")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@SerializedName("Data")
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 14:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MdDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("Type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@SerializedName("Unit")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@SerializedName("Phase")
|
||||||
|
private String phase;
|
||||||
|
|
||||||
|
@SerializedName("ClassID")
|
||||||
|
private String classId;
|
||||||
|
|
||||||
|
@SerializedName("StatMethod")
|
||||||
|
private List<String> statMethod;
|
||||||
|
|
||||||
|
@SerializedName("TranRule")
|
||||||
|
private String tranRule;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 15:02
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ParDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("Type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@SerializedName("DataType")
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
@SerializedName("ModifyFlag")
|
||||||
|
private Integer modifyFlag;
|
||||||
|
|
||||||
|
@SerializedName("MaxNum")
|
||||||
|
private Integer maxNum;
|
||||||
|
|
||||||
|
@SerializedName("MinNum")
|
||||||
|
private Integer minNum;
|
||||||
|
|
||||||
|
@SerializedName("SetValue")
|
||||||
|
private List<String> setValue;
|
||||||
|
|
||||||
|
@SerializedName("Strlen")
|
||||||
|
private Integer strLen;
|
||||||
|
|
||||||
|
@SerializedName("DefaultValue")
|
||||||
|
private String defaultValue;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.access.pojo.dto.data;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 14:52
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StsDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("StoreFlag")
|
||||||
|
private Integer storeFlag;
|
||||||
|
|
||||||
|
@SerializedName("CurSts")
|
||||||
|
private Integer curSts;
|
||||||
|
|
||||||
|
@SerializedName("ClassID")
|
||||||
|
private String classId;
|
||||||
|
|
||||||
|
@SerializedName("TranRule")
|
||||||
|
private String tranRule;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 16:35
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CfgDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("DevModName")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("DevModVersion")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
@SerializedName("DevModTime")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
@SerializedName("ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@SerializedName("DevType")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@SerializedName("DevApp")
|
||||||
|
private String devApp;
|
||||||
|
|
||||||
|
@SerializedName("DevInfo")
|
||||||
|
private DevInfoDTO devInfo;
|
||||||
|
|
||||||
|
@SerializedName("Province")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
@SerializedName("City")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@SerializedName("County")
|
||||||
|
private String county;
|
||||||
|
|
||||||
|
@SerializedName("Address")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@SerializedName("Position")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
@SerializedName("LineNum")
|
||||||
|
private Integer lineNum;
|
||||||
|
|
||||||
|
@SerializedName("FileFrameLength")
|
||||||
|
private Integer fileFrameLength;
|
||||||
|
|
||||||
|
@SerializedName("FileFrameTimeout")
|
||||||
|
private Integer fileFrameTimeout;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 12:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CpuInfoDTO implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("CpuCore")
|
||||||
|
private Integer cpuCore;
|
||||||
|
|
||||||
|
@SerializedName("CpuFreq")
|
||||||
|
private Float cpuFreq;
|
||||||
|
|
||||||
|
@SerializedName("Arch")
|
||||||
|
private String arch;
|
||||||
|
|
||||||
|
@SerializedName("CpuLmt")
|
||||||
|
private Float cpuLmt;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 15:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DataArrayDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 16:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DataDto implements Serializable {
|
||||||
|
@SerializedName("TEMPLATE")
|
||||||
|
private TemplateDetailDto template;
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 14:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DataSetDTO implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("DataType")
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
@SerializedName("StartTime")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@SerializedName("Period")
|
||||||
|
private Integer period;
|
||||||
|
|
||||||
|
@SerializedName("StoreFlag")
|
||||||
|
private Integer storeFlag;
|
||||||
|
|
||||||
|
@SerializedName("DataArray")
|
||||||
|
private List<DataArrayDto> dataArray;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 16:26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DevCfgDetailDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("Version")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
@SerializedName("Time")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
@SerializedName("Cfg")
|
||||||
|
private List<CfgDto> cfg;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 12:08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DevInfoDTO implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("DevType")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
@SerializedName("DevName")
|
||||||
|
private String devName;
|
||||||
|
|
||||||
|
@SerializedName("MsgInfo")
|
||||||
|
private String msgInfo;
|
||||||
|
|
||||||
|
@SerializedName("DevStatus")
|
||||||
|
private String devStatus;
|
||||||
|
|
||||||
|
@SerializedName("HardVer")
|
||||||
|
private String hardVer;
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import com.njcn.access.pojo.dto.data.*;
|
||||||
|
import com.njcn.access.pojo.dto.data.ParDto;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 16:26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DevModDetailDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("Version")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
@SerializedName("Time")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
@SerializedName("IDX")
|
||||||
|
private Integer idx;
|
||||||
|
|
||||||
|
@SerializedName("DevType")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
@SerializedName("DataList")
|
||||||
|
private List<String> dataList;
|
||||||
|
|
||||||
|
@SerializedName("DataSet")
|
||||||
|
private List<DataSetDTO> dataSet;
|
||||||
|
|
||||||
|
@SerializedName("IClk")
|
||||||
|
private String iclk;
|
||||||
|
|
||||||
|
@SerializedName("EClk")
|
||||||
|
private String eclk;
|
||||||
|
|
||||||
|
@SerializedName("LineNum")
|
||||||
|
private Integer lineNum;
|
||||||
|
|
||||||
|
@SerializedName("EPD")
|
||||||
|
private List<EpdPqdDto> epd;
|
||||||
|
|
||||||
|
@SerializedName("PQD")
|
||||||
|
private List<EpdPqdDto> pqd;
|
||||||
|
|
||||||
|
@SerializedName("EVT")
|
||||||
|
private List<EvtDto> evt;
|
||||||
|
|
||||||
|
@SerializedName("ALM")
|
||||||
|
private List<AlmDto> alm;
|
||||||
|
|
||||||
|
@SerializedName("MD")
|
||||||
|
private List<MdDto> md;
|
||||||
|
|
||||||
|
@SerializedName("STS")
|
||||||
|
private List<StsDto> sts;
|
||||||
|
|
||||||
|
@SerializedName("DI")
|
||||||
|
private List<DiDto> di;
|
||||||
|
|
||||||
|
@SerializedName("DO")
|
||||||
|
private List<DoDto> doDTO;
|
||||||
|
|
||||||
|
@SerializedName("Param")
|
||||||
|
private List<ParDto> param;
|
||||||
|
|
||||||
|
@SerializedName("CTRL")
|
||||||
|
private List<CtrlDto> ctrl;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 12:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DiskInfoDTO implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("DiskPhy")
|
||||||
|
private Float diskPhy;
|
||||||
|
|
||||||
|
@SerializedName("DiskUsePhy")
|
||||||
|
private Float diskUsePhy;
|
||||||
|
|
||||||
|
@SerializedName("DiskLmt")
|
||||||
|
private Float diskLmt;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 12:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MemInfoDTO implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("MemPhy")
|
||||||
|
private Float memPhy;
|
||||||
|
|
||||||
|
@SerializedName("MemVirt")
|
||||||
|
private Float memVirt;
|
||||||
|
|
||||||
|
@SerializedName("MemLmt")
|
||||||
|
private Float memLmt;
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 16:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class NetDevModDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("Version")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
@SerializedName("Time")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
@SerializedName("DevName")
|
||||||
|
private String devName;
|
||||||
|
|
||||||
|
@SerializedName("DevType")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
@SerializedName("NetType")
|
||||||
|
private String netType;
|
||||||
|
|
||||||
|
@SerializedName("NDID")
|
||||||
|
private String nDid;
|
||||||
|
|
||||||
|
@SerializedName("DevTopicVer")
|
||||||
|
private String devTopicVer;
|
||||||
|
|
||||||
|
@SerializedName("Uid")
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
@SerializedName("CUid")
|
||||||
|
private List<String> cUid;
|
||||||
|
|
||||||
|
@SerializedName("DevInfo")
|
||||||
|
private DevInfoDTO devInfoDTO;
|
||||||
|
|
||||||
|
@SerializedName("CpuInfo")
|
||||||
|
private CpuInfoDTO cpuInfoDTO;
|
||||||
|
|
||||||
|
@SerializedName("MemInfo")
|
||||||
|
private MemInfoDTO memInfoDTO;
|
||||||
|
|
||||||
|
@SerializedName("DiskInfo")
|
||||||
|
private DiskInfoDTO diskInfoDTO;
|
||||||
|
|
||||||
|
@SerializedName("SoftInfo")
|
||||||
|
private SoftInfoDTO softInfoDTO;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 16:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ParamDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("Data_Type")
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
@SerializedName("Data_Array")
|
||||||
|
private List<DataDto> dataArray;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/3/13 12:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SoftInfoDTO implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("OsName")
|
||||||
|
private String osName;
|
||||||
|
|
||||||
|
@SerializedName("OsVersion")
|
||||||
|
private String osVersion;
|
||||||
|
|
||||||
|
@SerializedName("AppVersion")
|
||||||
|
private String appVersion;
|
||||||
|
|
||||||
|
@SerializedName("AppDate")
|
||||||
|
private String appDate;
|
||||||
|
|
||||||
|
@SerializedName("AppCheck")
|
||||||
|
private String appCheck;
|
||||||
|
|
||||||
|
@SerializedName("Softupdate")
|
||||||
|
private String softUpdate;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 16:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TemplateDetailDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("NetDevMod")
|
||||||
|
private NetDevModDto netDevModDto;
|
||||||
|
|
||||||
|
@SerializedName("DevCfg")
|
||||||
|
private DevCfgDetailDto devCfgDetailDto;
|
||||||
|
|
||||||
|
@SerializedName("DevMod")
|
||||||
|
private List<DevModDetailDto> devModDetailDto;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.njcn.access.pojo.dto.devModel;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 16:16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TemplateDto implements Serializable {
|
||||||
|
|
||||||
|
@SerializedName("mid")
|
||||||
|
private Integer mid;
|
||||||
|
|
||||||
|
@SerializedName("deviceId")
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
@SerializedName("timestamp")
|
||||||
|
private String timestamp;
|
||||||
|
|
||||||
|
@SerializedName("type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@SerializedName("param")
|
||||||
|
private ParamDto param;
|
||||||
|
|
||||||
|
@SerializedName("code")
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.access.pojo.param;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 13:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DevModelParam {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模板文件")
|
||||||
|
@NotNull(message="模板文件不能为空!")
|
||||||
|
private MultipartFile file;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "装置类型")
|
||||||
|
@NotNull(message="装置类型不能为空!")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -20,6 +20,11 @@
|
|||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>access-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>common-web</artifactId>
|
<artifactId>common-web</artifactId>
|
||||||
@@ -27,7 +32,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>common-swagger</artifactId>
|
<artifactId>common-oss</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -42,14 +47,25 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>common-poi</artifactId>
|
<artifactId>common-redis</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>algorithm-api</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>common-redis</artifactId>
|
<artifactId>system-api</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>${project.version}</version>
|
||||||
<scope>compile</scope>
|
</dependency>
|
||||||
|
<!--kafka -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.kafka</groupId>
|
||||||
|
<artifactId>spring-kafka</artifactId>
|
||||||
|
<version>${kafka.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.njcn.access.config;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
|
import springfox.documentation.builders.OAuthBuilder;
|
||||||
|
import springfox.documentation.builders.PathSelectors;
|
||||||
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||||
|
import springfox.documentation.service.*;
|
||||||
|
import springfox.documentation.spi.DocumentationType;
|
||||||
|
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/3 9:03
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class SwaggerConfig {
|
||||||
|
|
||||||
|
@Value("${microservice.gateway.url}")
|
||||||
|
private String gatewayUrl;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Docket createRestApi() {
|
||||||
|
|
||||||
|
List<GrantType> grantTypes = new ArrayList<>();
|
||||||
|
String passwordTokenUrl = "http://" + gatewayUrl + "/pqs-auth/oauth/token";
|
||||||
|
ResourceOwnerPasswordCredentialsGrant resourceOwnerPasswordCredentialsGrant = new ResourceOwnerPasswordCredentialsGrant(passwordTokenUrl);
|
||||||
|
grantTypes.add(resourceOwnerPasswordCredentialsGrant);
|
||||||
|
OAuth oAuth = new OAuthBuilder().name("oauth2").grantTypes(grantTypes).build();
|
||||||
|
//schemas
|
||||||
|
List<SecurityScheme> securitySchemes = Lists.newArrayList(oAuth);
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.groupName("物联网注册服务")
|
||||||
|
.apiInfo(apiInfo())
|
||||||
|
.enable(true)
|
||||||
|
.select()
|
||||||
|
.apis(RequestHandlerSelectors.basePackage("com.njcn.access.controller"))
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
.build()
|
||||||
|
.securityContexts(securityContexts())
|
||||||
|
.securitySchemes(securitySchemes);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiInfo apiInfo() {
|
||||||
|
return new ApiInfoBuilder()
|
||||||
|
.title("物接入")
|
||||||
|
.description("物接入接口文档")
|
||||||
|
.version("1.0")
|
||||||
|
.contact(contact())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<SecurityContext> securityContexts() {
|
||||||
|
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||||
|
securityContexts.add(
|
||||||
|
SecurityContext.builder()
|
||||||
|
.securityReferences(defaultAuth())
|
||||||
|
.forPaths(PathSelectors.ant("/**"))
|
||||||
|
.build());
|
||||||
|
return securityContexts;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SecurityReference> defaultAuth() {
|
||||||
|
//scope方位
|
||||||
|
List<AuthorizationScope> scopes = new ArrayList<>();
|
||||||
|
scopes.add(new AuthorizationScope("read", "read resources"));
|
||||||
|
scopes.add(new AuthorizationScope("write", "write resources"));
|
||||||
|
scopes.add(new AuthorizationScope("reads", "read all resources"));
|
||||||
|
scopes.add(new AuthorizationScope("writes", "write all resources"));
|
||||||
|
SecurityReference securityReference = new SecurityReference("oauth2", scopes.toArray(new AuthorizationScope[]{}));
|
||||||
|
List<SecurityReference> securityReferences = new ArrayList<>();
|
||||||
|
securityReferences.add(securityReference);
|
||||||
|
return securityReferences;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Contact contact() {
|
||||||
|
return new Contact("灿能系统组", "", "13914774158@163.com");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.njcn.access.controller;
|
||||||
|
|
||||||
|
import com.njcn.access.service.IAccessService;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.common.utils.LogUtil;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/3/31 9:12
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/devAccess")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "装置接入")
|
||||||
|
public class AccessController extends BaseController {
|
||||||
|
|
||||||
|
private final IAccessService accessService;
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("平台发起注册")
|
||||||
|
@ApiImplicitParam(name = "nDid", value = "网关识别码", required = true)
|
||||||
|
public HttpResult<Object> add(@RequestParam String nDid){
|
||||||
|
log.info("设备向装置侧发起注册请求,请求的nDid为:" + nDid);
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LogUtil.njcnDebug(log, "{},设备向装置侧发起注册请求,请求的nDid为:{}", methodDescribe, nDid);
|
||||||
|
accessService.add(nDid);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.njcn.access.controller;
|
||||||
|
|
||||||
|
import com.njcn.access.pojo.param.DevModelParam;
|
||||||
|
import com.njcn.access.service.IDevModelService;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.common.utils.LogUtil;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 10:26
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/devModel")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Validated
|
||||||
|
@Api(tags = "装置模板录入")
|
||||||
|
public class DevModelController extends BaseController {
|
||||||
|
|
||||||
|
private final IDevModelService devModelService;
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("装置录入模板")
|
||||||
|
public HttpResult<String> add(DevModelParam devModelParam){
|
||||||
|
log.info("装置录入模板文件");
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LogUtil.njcnDebug(log, "{},装置录入模板文件", methodDescribe);
|
||||||
|
return devModelService.add(devModelParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
package com.njcn.access.handler;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||||
|
import com.github.tocrhz.mqtt.annotation.MqttSubscribe;
|
||||||
|
import com.github.tocrhz.mqtt.annotation.NamedValue;
|
||||||
|
import com.github.tocrhz.mqtt.annotation.Payload;
|
||||||
|
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||||
|
import com.njcn.access.pojo.dto.*;
|
||||||
|
import com.njcn.algorithm.api.DevModelFeignClient;
|
||||||
|
import com.njcn.algorithm.api.EquipmentFeignClient;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDevModelQueryListParm;
|
||||||
|
import com.njcn.algorithm.pojo.vo.CsDevModelPageVO;
|
||||||
|
import com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2022年03月23日 09:41
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MqttMessageHandler {
|
||||||
|
|
||||||
|
private final EquipmentFeignClient equipmentFeignClient;
|
||||||
|
|
||||||
|
private final DevModelFeignClient devModelFeignClient;
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
private final MqttPublisher publisher;
|
||||||
|
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收装置接入响应
|
||||||
|
* 1.收到注册信息,修改装置出厂表,装置的状态,调整为注册;然后开始接入流程
|
||||||
|
* 2.询问当前装置类型的模板。有则完成接入;没有则告警出来,需要人工手动上传模板信息
|
||||||
|
* @param topic
|
||||||
|
* @param message
|
||||||
|
* @param payload
|
||||||
|
*/
|
||||||
|
@MqttSubscribe(value = "/device/register/{nDid}",qos = 1)
|
||||||
|
public void devOperation(String topic, MqttMessage message, @NamedValue("nDid") String nDid, @Payload String payload){
|
||||||
|
Gson gson = new Gson();
|
||||||
|
RegisterDTO.RegisterResponse registerDTO = gson.fromJson(new String(message.getPayload(), StandardCharsets.UTF_8), RegisterDTO.RegisterResponse.class);
|
||||||
|
if (registerDTO.getCode() == 200){
|
||||||
|
//todo 调整装置出厂表状态
|
||||||
|
|
||||||
|
|
||||||
|
PublicDto publicDto = new PublicDto();
|
||||||
|
publicDto.setMid(Long.toString(Instant.now().toEpochMilli()));
|
||||||
|
publicDto.setNDid(nDid);
|
||||||
|
publicDto.setTimestamp(Instant.now().toEpochMilli());
|
||||||
|
publicDto.setType("CMD_DEV_DATA");
|
||||||
|
AccessDto accessDto = new AccessDto();
|
||||||
|
accessDto.setNDid(nDid);
|
||||||
|
accessDto.setDevType(registerDTO.getParam().getDev_type());
|
||||||
|
publicDto.setParam(accessDto);
|
||||||
|
publisher.send("/platform/devcmd/"+nDid,new Gson().toJson(publicDto),1,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置类型模板相应
|
||||||
|
* 1.判断网关的类型
|
||||||
|
* 2.直联设备的DevCfg和DevMod是以直联设备为准,上送平台端,平台端保存。通过校验DevMod模板信息来从平台端模板池中选取对应的模板,如果找不到匹配模板需告警提示人工干预处理。
|
||||||
|
* 3.平台端需读取装置的DevMod来判断网关支持的设备模板(包含设备型号和模板版本),根据app提交的接入子设备DID匹配数据模板(型号及版本),生成DevCfg下发给网关,网关根据下发信息生成就地设备点表。
|
||||||
|
* @param topic
|
||||||
|
* @param message
|
||||||
|
* @param nDid
|
||||||
|
* @param payload
|
||||||
|
*/
|
||||||
|
@MqttSubscribe(value = "/device/devack/{nDid}",qos = 1)
|
||||||
|
public void devModelOperation(String topic, MqttMessage message, @NamedValue("nDid") String nDid, @Payload String payload){
|
||||||
|
Gson gson = new Gson();
|
||||||
|
ModelDto modelDto = gson.fromJson(new String(message.getPayload(), StandardCharsets.UTF_8), ModelDto.class);
|
||||||
|
HttpResult<CsEquipmentDeliveryVO> pojo = equipmentFeignClient.queryEquipmentByndid(nDid);
|
||||||
|
if (!Objects.isNull(pojo)){
|
||||||
|
String devType = pojo.getData().getDevType();
|
||||||
|
if (Objects.equals(devType,"直连设备")){
|
||||||
|
List<DevModelDto> list = modelDto.getDevMod();
|
||||||
|
list.forEach(item->{
|
||||||
|
//todo 根据条件查询库中是否有符合条件的数据
|
||||||
|
DictData dicData = dicDataFeignClient.getDicDataByCode(item.getDevType()).getData();
|
||||||
|
CsDevModelQueryListParm csDevModelQueryListParm = new CsDevModelQueryListParm();
|
||||||
|
if (Objects.isNull(dicData)) {
|
||||||
|
log.info("新增模板失败,获取装置类型字典数据为空,请先录入装置类型!");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
csDevModelQueryListParm.setDevType( dicData.getId());
|
||||||
|
}
|
||||||
|
csDevModelQueryListParm.setVersionNo(item.getVersionNo());
|
||||||
|
csDevModelQueryListParm.setVersionDate(item.getVersionDate());
|
||||||
|
CsDevModelPageVO csDevModelPageVO = devModelFeignClient.queryDevModelOne(csDevModelQueryListParm).getData();
|
||||||
|
if (Objects.isNull(csDevModelPageVO)){
|
||||||
|
log.info("模板不存在,请先录入模板数据!");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
//todo 录入装置和模板的关系表
|
||||||
|
System.out.println("录入装置和模板的关系表");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (Objects.equals(devType,"网关")){
|
||||||
|
//todo 处理待定
|
||||||
|
System.out.println("网关设备判断");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.info("通过nDid未找到相关装置信息");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.quality.mapper.DataGroupMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getGroupDataList" resultType="DataGroupTemplateVO">
|
||||||
|
select id,pid,name,sort,1 as level from ele_data_group
|
||||||
|
where pid = #{id}
|
||||||
|
order by sort
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getGroupList" resultType="DataGroupTemplateVO">
|
||||||
|
select id,pid,name,sort from ele_data_group
|
||||||
|
where pid = #{id}
|
||||||
|
order by sort
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.access.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 徐扬
|
||||||
|
*/
|
||||||
|
public interface IAccessService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备注册(1.判断此装置是否完成出厂设置 2.判断此装置是否能正常通讯)
|
||||||
|
* 1.根据nDid获取装置的信息(设备型号、网关识别码)
|
||||||
|
* 2.发送MQTT信息给装置
|
||||||
|
* 3.装置响应则修改装置状态;3分钟未响应则生成告警信息
|
||||||
|
* @param nDid 网关识别码
|
||||||
|
*/
|
||||||
|
void add(String nDid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.access.service;
|
||||||
|
|
||||||
|
import com.njcn.access.pojo.param.DevModelParam;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
public interface IDevModelService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直连装置录入模板信息
|
||||||
|
* 1.解析模板文件,将数据录入库中
|
||||||
|
* 2.将文件上传至文件服务器保存起来,先以装置型号-版本号-时间作为名称名称
|
||||||
|
* @param devModelParam 模板文件参数
|
||||||
|
*/
|
||||||
|
HttpResult<String> add(DevModelParam devModelParam);
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.njcn.access.service.serviceImpl;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||||
|
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||||
|
import com.njcn.access.pojo.dto.AccessDto;
|
||||||
|
import com.njcn.access.pojo.dto.PublicDto;
|
||||||
|
import com.njcn.access.service.IAccessService;
|
||||||
|
import com.njcn.algorithm.api.EquipmentFeignClient;
|
||||||
|
import com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/3/31 9:21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AccessServiceImpl implements IAccessService {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(AccessServiceImpl.class);
|
||||||
|
|
||||||
|
private final MqttPublisher publisher;
|
||||||
|
|
||||||
|
private final EquipmentFeignClient equipmentFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(String nDid) {
|
||||||
|
CsEquipmentDeliveryVO vo = equipmentFeignClient.queryEquipmentByndid(nDid).getData();
|
||||||
|
if (Objects.isNull(vo)){
|
||||||
|
logger.error("平台侧无此网关信息,请先录入!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PublicDto publicDto = new PublicDto();
|
||||||
|
publicDto.setMid(Long.toString(Instant.now().toEpochMilli()));
|
||||||
|
publicDto.setNDid(nDid);
|
||||||
|
publicDto.setTimestamp(Instant.now().toEpochMilli());
|
||||||
|
publicDto.setType("CMD_DEV_REGISTER");
|
||||||
|
AccessDto accessDto = new AccessDto();
|
||||||
|
accessDto.setNDid(nDid);
|
||||||
|
accessDto.setDevType(vo.getDevModel());
|
||||||
|
publicDto.setParam(accessDto);
|
||||||
|
publisher.send("/platform/register/"+nDid,new Gson().toJson(publicDto),1,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.njcn.access.service.serviceImpl;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||||
|
import com.njcn.access.enums.AccessResponseEnum;
|
||||||
|
import com.njcn.access.pojo.dto.devModel.*;
|
||||||
|
import com.njcn.access.pojo.param.DevModelParam;
|
||||||
|
import com.njcn.access.service.IDevModelService;
|
||||||
|
import com.njcn.access.utils.JsonUtil;
|
||||||
|
import com.njcn.algorithm.api.DevModelFeignClient;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDevModelAddParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDevModelQueryListParm;
|
||||||
|
import com.njcn.algorithm.pojo.vo.CsDevModelPageVO;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.oss.constant.OssPath;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 10:37
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DevModelServiceImpl implements IDevModelService {
|
||||||
|
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
|
private final DevModelFeignClient devModelFeignClient;
|
||||||
|
|
||||||
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public HttpResult<String> add(DevModelParam devModelParam) {
|
||||||
|
String json = null;
|
||||||
|
try {
|
||||||
|
json = JsonUtil.convertStreamToString(devModelParam.getFile().getInputStream());
|
||||||
|
|
||||||
|
Gson gson = new Gson();
|
||||||
|
TemplateDto templateDto = gson.fromJson(json, TemplateDto.class);
|
||||||
|
ParamDto pojo = templateDto.getParam();
|
||||||
|
//网关模板
|
||||||
|
NetDevModDto po1 = pojo.getDataArray().get(0).getTemplate().getNetDevModDto();
|
||||||
|
//装置信息模板
|
||||||
|
DevCfgDetailDto po2 = pojo.getDataArray().get(0).getTemplate().getDevCfgDetailDto();
|
||||||
|
//装置数据模板
|
||||||
|
List<DevModDetailDto> po3 = pojo.getDataArray().get(0).getTemplate().getDevModDetailDto();
|
||||||
|
|
||||||
|
String name = po3.get(0).getName();
|
||||||
|
String version = po3.get(0).getVersion();
|
||||||
|
String time = po3.get(0).getTime();
|
||||||
|
String devType = po3.get(0).getDevType();
|
||||||
|
String devTypeId = "";
|
||||||
|
|
||||||
|
DictData dicData = dicDataFeignClient.getDicDataByCode(devType).getData();
|
||||||
|
if (Objects.isNull(dicData)) {
|
||||||
|
log.info("新增模板失败,获取装置类型字典数据为空,请先录入装置类型!");
|
||||||
|
return HttpResultUtil.assembleResult(CommonResponseEnum.NO_DATA.getCode(), null, "获取装置类型字典数据为空!");
|
||||||
|
} else {
|
||||||
|
devTypeId = dicData.getId();
|
||||||
|
}
|
||||||
|
CsDevModelQueryListParm csDevModelQueryListParm = new CsDevModelQueryListParm();
|
||||||
|
csDevModelQueryListParm.setDevType(devTypeId);
|
||||||
|
csDevModelQueryListParm.setVersionNo(version);
|
||||||
|
csDevModelQueryListParm.setVersionDate(time);
|
||||||
|
csDevModelQueryListParm.setName(name);
|
||||||
|
CsDevModelPageVO vo = devModelFeignClient.queryDevModelOne(csDevModelQueryListParm).getData();
|
||||||
|
if (!Objects.isNull(vo)){
|
||||||
|
log.info("新增模板失败,新增的模板在库中存在!");
|
||||||
|
return HttpResultUtil.assembleResult(AccessResponseEnum.MODEL_REPEAT.getCode(), null, AccessResponseEnum.MODEL_REPEAT.getMessage());
|
||||||
|
} else {
|
||||||
|
CsDevModelAddParm csDevModelAddParm = new CsDevModelAddParm();
|
||||||
|
csDevModelAddParm.setName(name);
|
||||||
|
csDevModelAddParm.setDevType(devTypeId);
|
||||||
|
csDevModelAddParm.setVersionNo(version);
|
||||||
|
csDevModelAddParm.setVersionDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(time));
|
||||||
|
String filePath = fileStorageUtil.uploadMultipart(devModelParam.getFile(), OssPath.DEV_MODEL + devModelParam.getDevType() + "_");
|
||||||
|
log.info("文件路径为:" + filePath);
|
||||||
|
csDevModelAddParm.setFilePath(filePath);
|
||||||
|
//新增cs_dev_model表数据
|
||||||
|
devModelFeignClient.addDevModel(csDevModelAddParm);
|
||||||
|
//新增cs_data_set
|
||||||
|
|
||||||
|
//新增cs_data_array
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("文件转成json出现异常");
|
||||||
|
e.getMessage();
|
||||||
|
} catch (ParseException e) {
|
||||||
|
log.error("时间转换出现异常");
|
||||||
|
e.getMessage();
|
||||||
|
}
|
||||||
|
return HttpResultUtil.assembleResult(CommonResponseEnum.SUCCESS.getCode(), null, CommonResponseEnum.SUCCESS.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package com.njcn.access.utils;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/4/10 16:03
|
||||||
|
*/
|
||||||
|
public class JsonUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param jsonString 要保存的JSON串
|
||||||
|
* @param filePath 保存到的文件路径
|
||||||
|
* @param fileName 文件名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//保存json 文件
|
||||||
|
public static boolean createJsonFile(String jsonString, String filePath, String fileName) {
|
||||||
|
// 标记文件生成是否成功
|
||||||
|
boolean flag = true;
|
||||||
|
// 拼接文件完整路径
|
||||||
|
String fullPath = filePath + File.separator + fileName + ".json";
|
||||||
|
// 生成json格式文件
|
||||||
|
try {
|
||||||
|
// 保证创建一个新文件
|
||||||
|
File file = new File(fullPath);
|
||||||
|
// 如果父目录不存在,创建父目录
|
||||||
|
if (!file.getParentFile().exists()) {
|
||||||
|
file.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
|
// 如果已存在,删除旧文件
|
||||||
|
if (file.exists()) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
file.createNewFile();
|
||||||
|
// 格式化json字符串
|
||||||
|
//jsonString = JsonFormatTool.formatJson2(jsonString);
|
||||||
|
// 将格式化后的字符串写入文件
|
||||||
|
Writer write = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);
|
||||||
|
write.write(jsonString);
|
||||||
|
write.flush();
|
||||||
|
write.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
flag = false;
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// 返回是否成功的标记
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成随机文件名:当前年月日时分秒+五位随机数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getRandomFileName() {
|
||||||
|
SimpleDateFormat simpleDateFormat;
|
||||||
|
simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
|
Date date = new Date();
|
||||||
|
String str = simpleDateFormat.format(date);
|
||||||
|
Random random = new Random();
|
||||||
|
// 获取5位随机数
|
||||||
|
int ranNum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;
|
||||||
|
// 当前时间
|
||||||
|
return ranNum + str;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String convertStreamToString(InputStream inputStream){
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String line = null;
|
||||||
|
try {
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
sb.append(line);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
inputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -36,7 +36,6 @@ spring:
|
|||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
|
||||||
#项目日志的配置
|
#项目日志的配置
|
||||||
logging:
|
logging:
|
||||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>iot-access</name>
|
<name>iot-access</name>
|
||||||
<!-- FIXME change it to the project's website -->
|
<description>物接入模块</description>
|
||||||
<url>http://www.example.com</url>
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>access-api</module>
|
<module>access-api</module>
|
||||||
<module>access-boot</module>
|
<module>access-boot</module>
|
||||||
|
|||||||
19
pom.xml
19
pom.xml
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!--中间件目标地址-->
|
<!--中间件目标地址-->
|
||||||
<middle.server.url>192.168.1.18</middle.server.url>
|
<middle.server.url>192.168.1.13</middle.server.url>
|
||||||
<!--微服务模块发布地址-->
|
<!--微服务模块发布地址-->
|
||||||
<service.server.url>192.168.1.139</service.server.url>
|
<service.server.url>192.168.1.139</service.server.url>
|
||||||
<!--docker仓库地址-->
|
<!--docker仓库地址-->
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<!--nacos的ip:port-->
|
<!--nacos的ip:port-->
|
||||||
<nacos.url>${middle.server.url}:18848</nacos.url>
|
<nacos.url>${middle.server.url}:18848</nacos.url>
|
||||||
<!--服务器发布内容为空-->
|
<!--服务器发布内容为空-->
|
||||||
<nacos.namespace>9a99958c-ed20-439a-8504-0544cea8e520</nacos.namespace>
|
<nacos.namespace>415a1c87-33aa-47bd-8e25-13cc456c87ed</nacos.namespace>
|
||||||
<!--sentinel:port-->
|
<!--sentinel:port-->
|
||||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||||
<!--网关地址,主要用于配置swagger中认证token-->
|
<!--网关地址,主要用于配置swagger中认证token-->
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
<okhttp.version>4.8.1</okhttp.version>
|
<okhttp.version>4.8.1</okhttp.version>
|
||||||
<minio.version>8.2.1</minio.version>
|
<minio.version>8.2.1</minio.version>
|
||||||
<spring-cloud-huawei.version>1.7.0-Hoxton</spring-cloud-huawei.version>
|
<spring-cloud-huawei.version>1.7.0-Hoxton</spring-cloud-huawei.version>
|
||||||
|
<kafka.version>2.9.6</kafka.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -123,14 +124,6 @@
|
|||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--华为云cse微服务引擎-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.huaweicloud</groupId>
|
|
||||||
<artifactId>spring-cloud-huawei-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-huawei.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
<!--三剑客依赖******end-->
|
<!--三剑客依赖******end-->
|
||||||
<!--java工具包-->
|
<!--java工具包-->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -352,6 +345,12 @@
|
|||||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||||
<version>${dynamic-datasource.version}</version>
|
<version>${dynamic-datasource.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- kafka -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.kafka</groupId>
|
||||||
|
<artifactId>spring-kafka</artifactId>
|
||||||
|
<version>${kafka.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|||||||
Reference in New Issue
Block a user