pms技术监督调整
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.njcn.process.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.process.api.fallback.ThsSuperviseFallbackFactory;
|
||||
import com.njcn.process.pojo.param.SuperviseParam;
|
||||
import com.njcn.process.pojo.vo.SuperviceRunLogVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
|
||||
/**
|
||||
* 技术监督每日任务
|
||||
* @author cdf
|
||||
* @date 2023/4/13
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.PROCESS,path = "/thsSupervise",fallbackFactory = ThsSuperviseFallbackFactory.class)
|
||||
public interface ThsSuperviseFeignClient {
|
||||
|
||||
|
||||
/**
|
||||
* 技术监督每日任务
|
||||
* @author cdf
|
||||
* @date 2024/3/18
|
||||
*/
|
||||
HttpResult<SuperviceRunLogVo> initSupervise(@RequestBody SuperviseParam superviseParam);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.njcn.process.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.process.api.SupvStatisticReportMFeignClient;
|
||||
import com.njcn.process.api.ThsSuperviseFeignClient;
|
||||
import com.njcn.process.pojo.param.SuperviseParam;
|
||||
import com.njcn.process.pojo.vo.SuperviceRunLogVo;
|
||||
import com.njcn.process.utils.ProcessEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* 自动生成技术监督单
|
||||
* @author cdf
|
||||
* @date 2023/4/13
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ThsSuperviseFallbackFactory implements FallbackFactory<ThsSuperviseFeignClient> {
|
||||
|
||||
@Override
|
||||
public ThsSuperviseFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = ProcessEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new ThsSuperviseFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<SuperviceRunLogVo> initSupervise(@RequestBody @Validated SuperviseParam superviseParam){
|
||||
log.error("{}异常,降级处理,异常为:{}", "自动生成技术监督单", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.njcn.process.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2024/3/18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ThsStrategyBindDTO {
|
||||
|
||||
/**
|
||||
* 监测点标签id,监测点id
|
||||
*/
|
||||
private String keyId;
|
||||
|
||||
/**
|
||||
* 指标集合
|
||||
*/
|
||||
private List<String> targetIds;
|
||||
|
||||
/**
|
||||
* 0.与 1.或
|
||||
*/
|
||||
private Integer operation;
|
||||
|
||||
|
||||
/**
|
||||
* 0.监测点标签 1.监测点
|
||||
*/
|
||||
private Integer type;
|
||||
}
|
||||
@@ -30,5 +30,8 @@ public class SuperviseParam {
|
||||
@NotNull(message = "类型不可为空")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(name = "reDate", value = "用于补招时间")
|
||||
private String reDate;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -58,5 +58,5 @@ public class RMpOnlineMonitorOverproofProblem implements Serializable {
|
||||
/**
|
||||
* 告警持续时间
|
||||
*/
|
||||
private String warnLastTime;
|
||||
private Double warnLastTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user