预告警单增加问题详细描述

This commit is contained in:
2024-05-22 16:30:22 +08:00
parent 41e6d2efb8
commit b7e291398b
8 changed files with 212 additions and 3 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.DeVReportManageFeignClientFallbackFactory;
import com.njcn.supervision.api.fallback.WarningLeafletFeignClientFallbackFactory;
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 = "/warningLeaflet", fallbackFactory = WarningLeafletFeignClientFallbackFactory.class)
public interface WarningLeafletFeignClient {
@GetMapping("/updateStatus")
HttpResult<Object> updateStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
}

View File

@@ -0,0 +1,32 @@
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.WarningLeafletFeignClient;
import com.njcn.supervision.utils.SupervisionEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class WarningLeafletFeignClientFallbackFactory implements FallbackFactory<WarningLeafletFeignClient> {
@Override
public WarningLeafletFeignClient 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 WarningLeafletFeignClient() {
@Override
public HttpResult<Object> updateStatus(String businessKey, Integer status) {
log.error("{}异常,降级处理,异常为:{}", "更新流程状态", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -11,6 +11,8 @@ import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -75,6 +77,8 @@ public class WarningLeafletParam extends BaseEntity implements Serializable{
@ApiModelProperty(value = "问题详细描述")
private String issueDetail;
@ApiModelProperty("发起人自选审批人 Map")
private Map<String, List<String>> startUserSelectAssignees;
@Data
@EqualsAndHashCode(callSuper = true)
@@ -100,6 +104,8 @@ public class WarningLeafletParam extends BaseEntity implements Serializable{
@NotBlank(message = "处理成效报告不能为空")
private String reportPath;
}

View File

@@ -59,12 +59,26 @@ public class WarningLeafletVO extends BaseEntity implements Serializable{
*/
private String takeStep;
/**
* 问题文件
*/
private String problemPath;
/**
* 问题文件
*/
private String problemName;
/**
* 处理成效报告
*/
private String reportPath;
/**
* 处理成效报告
*/
private String reportName;
/**
* 流程实例的编号
*/