普测测试流程

This commit is contained in:
2024-06-04 10:51:08 +08:00
parent fd70d53286
commit 78d36fadb7
25 changed files with 262 additions and 47 deletions

View File

@@ -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.SurveyPlanFeignClientFallbackFactory;
import com.njcn.supervision.api.fallback.SurveyTestFeignClientFallbackFactory;
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 = "/surveyTest", fallbackFactory = SurveyTestFeignClientFallbackFactory.class)
public interface SurveyTestFeignClient {
@GetMapping("/updateSurveyTestStatus")
HttpResult<Object> updateStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
}

View File

@@ -0,0 +1,37 @@
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.SurveyTestFeignClient;
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 SurveyTestFeignClientFallbackFactory implements FallbackFactory<SurveyTestFeignClient> {
@Override
public SurveyTestFeignClient 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 SurveyTestFeignClient() {
@Override
public HttpResult<Object> updateStatus(String businessKey, Integer status) {
log.error("{}异常,降级处理,异常为:{}", "更新退运装置数据流程状态", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -14,7 +14,8 @@ public enum FlowStatusEnum {
APPROVE(2, "审批通过"),
OPPOSE(3, "审批不通过"),
CANCEL(4, "已取消"),
NO_FEEDBACK(5, "未反馈");
NO_FEEDBACK(5, "未反馈"),
UN_TEST(6, "待测试");
private final Integer code;

View File

@@ -23,6 +23,9 @@ public class SurveyTestParam extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
@NotBlank(message = "索引不能为空")
private String Id;
/**
* 普测计划表id
@@ -88,10 +91,6 @@ public class SurveyTestParam extends BaseEntity implements Serializable {
@EqualsAndHashCode(callSuper = true)
public static class SurveyTestUpdateParam extends SurveyTestParam {
@ApiModelProperty("id")
@NotBlank(message = "索引不能为空")
private String Id;
}

View File

@@ -30,11 +30,52 @@ public class SurveyTestVO extends BaseEntity implements Serializable {
*/
private String planId;
/**
* 普测计划名称
*/
private String planName;
/**
* 0 关联系统内变电站1 用户手动输入变电站
*/
private Integer customSubstationFlag;
/**
* 变电站台账ID或者用户手动输入的变电站名称
*/
private String substation;
/**
* 变电站名称
*/
private String substationName;
/**
* 变电站电压等级
*/
private String voltageLevel;
/**
* 计划开始时间
*/
private LocalDate planStartTime;
/**
* 计划结束时间
*/
private LocalDate planEndTime;
/**
* 负责单位id
*/
private String deptId;
/**
* 负责单位名称
*/
private String deptName;
/**
* 计划完成时间
*/