冀北监测点试运行功能提交
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.njcn.supervision.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.supervision.api.fallback.TempLineDebugFeignClientFallbackFactory;
|
||||
import com.njcn.supervision.api.fallback.TempLineRunTestFeignClientFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
|
||||
/**
|
||||
* 流程实例 Api 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.SUPERVISION, path = "/supervisionTempLineRunTest", fallbackFactory = TempLineRunTestFeignClientFallbackFactory.class)
|
||||
public interface TempLineRunTestFeignClient {
|
||||
|
||||
@GetMapping("/updateStatus")
|
||||
HttpResult<Object> updateStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.supervision.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.supervision.api.TempLineFeignClient;
|
||||
import com.njcn.supervision.api.TempLineRunTestFeignClient;
|
||||
import com.njcn.supervision.utils.SupervisionEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022/3/16
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class TempLineRunTestFeignClientFallbackFactory implements FallbackFactory<TempLineRunTestFeignClient> {
|
||||
@Override
|
||||
public TempLineRunTestFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = SupervisionEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new TempLineRunTestFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Object> updateStatus(String businessKey, Integer status) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "更新流程状态", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.njcn.supervision.pojo.param.device;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2024-05-21
|
||||
*/
|
||||
@Data
|
||||
public class SupervisionTempLineRunTestParam {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 流程实例的编号
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 在线率
|
||||
*/
|
||||
private Float onlineRate;
|
||||
|
||||
/**
|
||||
* 数据完整性
|
||||
*/
|
||||
private Float integrityRate;
|
||||
|
||||
/**
|
||||
* 数据符合性
|
||||
*/
|
||||
private Float suitRate;
|
||||
|
||||
/**
|
||||
* 1:审批中;2:审批通过;3:审批不通过;4:已取消
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 0:未试运行 1:试运行中 2.试运行成功 3.试运行异常
|
||||
*/
|
||||
private Integer testRunState;
|
||||
|
||||
/**
|
||||
* 试运行监测点id集合
|
||||
*/
|
||||
@NotEmpty(message = "试运行监测点id集合参数不可为空")
|
||||
private List<String> lineIds;
|
||||
|
||||
@NotBlank(message = "开始时间不可为空")
|
||||
@DateTimeStrValid(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private String startTime;
|
||||
|
||||
@NotBlank(message = "结束时间不可为空")
|
||||
@DateTimeStrValid(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private String endTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.njcn.supervision.pojo.po.device;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -18,12 +17,18 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("supervision_temp_line_run_test")
|
||||
public class SupervisionTempLineRunTest extends BaseEntity {
|
||||
public class SupervisionTempLineRunTestPO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 监测点编号,用于区分监测点唯一编号,和监测点主键需要区分,目前认为是pq_line表的监测点id
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 流程实例的编号
|
||||
*/
|
||||
@@ -32,17 +37,17 @@ public class SupervisionTempLineRunTest extends BaseEntity {
|
||||
/**
|
||||
* 在线率
|
||||
*/
|
||||
private Float onlineRate;
|
||||
private Double onlineRate;
|
||||
|
||||
/**
|
||||
* 数据完整性
|
||||
*/
|
||||
private Float integrityRate;
|
||||
private Double integrityRate;
|
||||
|
||||
/**
|
||||
* 数据符合性
|
||||
*/
|
||||
private Float suitRate;
|
||||
private Double suitRate;
|
||||
|
||||
/**
|
||||
* 1:审批中;2:审批通过;3:审批不通过;4:已取消
|
||||
@@ -59,5 +64,10 @@ public class SupervisionTempLineRunTest extends BaseEntity {
|
||||
*/
|
||||
private Integer testRunState;
|
||||
|
||||
/**
|
||||
* 试运行时间范围
|
||||
*/
|
||||
private String testRunTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -29,4 +29,9 @@ public class SupervisionTempLineDebugVO extends BaseEntity {
|
||||
* 0:未试运行 1:试运行中 2.试运行成功 3.试运行异常
|
||||
*/
|
||||
private Integer testRunState;
|
||||
|
||||
/**
|
||||
* 试运行时间范围
|
||||
*/
|
||||
private String testRunTime;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.njcn.supervision.pojo.vo.device;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2024-05-21
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SupervisionTempLineRunTestVO extends BaseEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 监测点编号,用于区分监测点唯一编号,和监测点主键需要区分,目前认为是pq_line表的监测点id
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 流程实例的编号
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 在线率
|
||||
*/
|
||||
private Double onlineRate;
|
||||
|
||||
/**
|
||||
* 数据完整性
|
||||
*/
|
||||
private Double integrityRate;
|
||||
|
||||
/**
|
||||
* 数据符合性
|
||||
*/
|
||||
private Double suitRate;
|
||||
|
||||
/**
|
||||
* 1:审批中;2:审批通过;3:审批不通过;4:已取消
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 0:未试运行 1:试运行中 2.试运行成功 3.试运行异常
|
||||
*/
|
||||
private Integer testRunState;
|
||||
|
||||
/**
|
||||
* 试运行时间范围
|
||||
*/
|
||||
private String testRunTime;
|
||||
|
||||
|
||||
private String lineName;
|
||||
private String userName;
|
||||
private String connectedBus;
|
||||
private String monitoringTerminalCode;
|
||||
private String monitoringTerminalName;
|
||||
private String powerSubstationName;
|
||||
private String reason;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user