1.完成icd管理和终端类型管理
2.完成终端运维管理
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.PqDevTypeFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.po.PqDevType;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年02月14日 14:02
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.DEVICE, path = "/devType", fallbackFactory = PqDevTypeFallbackFactory.class, contextId = "devType")
|
||||
public interface PqDevTypeClient {
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDevTypeList")
|
||||
HttpResult<List<PqDevType>> getDevTypeList();
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.njcn.device.pq.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.api.PqDevTypeClient;
|
||||
import com.njcn.device.pq.pojo.po.PqDevType;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zbj
|
||||
* @version 1.0.0
|
||||
* @date 2023年04月13日 13:34
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PqDevTypeFallbackFactory implements FallbackFactory<PqDevTypeClient> {
|
||||
@Override
|
||||
public PqDevTypeClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new PqDevTypeClient()
|
||||
{
|
||||
|
||||
@Override
|
||||
public HttpResult<List<PqDevType>> getDevTypeList() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "查询装置型号全部信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -11,13 +12,31 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class PqIcdPathDTO {
|
||||
//模型索引
|
||||
/**
|
||||
* icd主键
|
||||
*/
|
||||
@ApiModelProperty("icd主键")
|
||||
private String id;
|
||||
//更新时间
|
||||
private String updateTime;
|
||||
//icd文件名
|
||||
/**
|
||||
* icd文件名
|
||||
*/
|
||||
@ApiModelProperty("icd文件名")
|
||||
private String fileName;
|
||||
//icd文件存储的地址
|
||||
/**
|
||||
* icd文件存储的地址
|
||||
*/
|
||||
@ApiModelProperty("icd文件存储的地址")
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 装置类型名称
|
||||
*/
|
||||
@ApiModelProperty("装置类型名称")
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty("更新时间")
|
||||
private String updateTime;
|
||||
}
|
||||
|
||||
@@ -20,4 +20,7 @@ public class LogsListParam extends BaseParam {
|
||||
@ApiModelProperty("日志类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("id:终端或者监测点)")
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.njcn.device.pq.pojo.param;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/5 11:34【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class PqDevTypeParam {
|
||||
|
||||
/**
|
||||
* icd文件名
|
||||
*/
|
||||
@ApiModelProperty("装置类型名称")
|
||||
@NotBlank(message = "装置类型名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 关联icdId
|
||||
*/
|
||||
@ApiModelProperty("关联icd表Id")
|
||||
@NotBlank(message = "关联icd不能为空")
|
||||
private String icdId;
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class PqDevTypeUpdateParam extends PqDevTypeParam {
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class A {
|
||||
|
||||
@ApiModelProperty("Id")
|
||||
private String id;
|
||||
|
||||
@ExcelProperty("Name")
|
||||
private String name;
|
||||
}
|
||||
}
|
||||
@@ -19,12 +19,19 @@ import javax.validation.constraints.Pattern;
|
||||
@Data
|
||||
public class PqIcdPathParam {
|
||||
|
||||
|
||||
//icd文件名
|
||||
/**
|
||||
* icd文件名
|
||||
*/
|
||||
@ApiModelProperty("icd文件名")
|
||||
@NotBlank(message = "icd文件名不能为空")
|
||||
private String fileName;
|
||||
//icd文件存储的地址
|
||||
|
||||
/**
|
||||
* icd文件存储的地址
|
||||
*/
|
||||
@ApiModelProperty("icd文件存储的地址")
|
||||
@NotBlank(message = "icd文件存储的地址不能为空")
|
||||
private String filePath;
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -25,6 +25,7 @@ public class Device implements Serializable{
|
||||
/**
|
||||
* 装置序号
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/11/5 11:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "pq_dev_type")
|
||||
public class PqDevType extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 型号id
|
||||
*/
|
||||
@TableId(value = "ID", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 型号名称
|
||||
*/
|
||||
@TableField(value = "Name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 关联icd表id
|
||||
*/
|
||||
@TableField(value = "Icd_Id")
|
||||
private String icdId;
|
||||
|
||||
/**
|
||||
* 状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
@TableField(value = "State")
|
||||
private Integer state;
|
||||
}
|
||||
@@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -21,7 +24,9 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "pq_icd_path")
|
||||
public class PqIcdPath {
|
||||
public class PqIcdPath extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 装置类型GUID
|
||||
*/
|
||||
@@ -29,16 +34,21 @@ public class PqIcdPath {
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 装置类型名称
|
||||
* icd名称
|
||||
*/
|
||||
@TableField(value = "Name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* icd文件路径
|
||||
*/
|
||||
@TableField(value = "Path")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
@TableField(value = "State")
|
||||
private Integer state;
|
||||
|
||||
|
||||
@TableField(value = "Update_Time")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
Reference in New Issue
Block a user