1.技术监督试运行评估-试运行结束后生成试运行报告

2.技术监督计划管理,权限调整为负责地市进行信息修改
3.调整常态化干扰源用户信息更新逻辑
4.调整谐波报告数据请求格式
This commit is contained in:
wr
2024-07-02 16:55:08 +08:00
parent 5ca027513f
commit 50cd5d3895
27 changed files with 510 additions and 283 deletions

View File

@@ -0,0 +1,36 @@
package com.njcn.harmonic.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.harmonic.api.fallback.RStatLimitRateDFeignClientFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@FeignClient(
value = ServerInfo.HARMONIC,
path = "/exportmodel",
fallbackFactory = RStatLimitRateDFeignClientFallbackFactory.class,
contextId = "exportmodel")
public interface ReportFeignClient {
@PostMapping(value ="/exportModel",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
HttpResult<String> exportWorld(
@RequestParam("startTime") String startTime,
@RequestParam("endTime") String endTime,
@RequestParam("type") Integer type,
@RequestParam("lineIndex") String lineIndex,
@RequestParam("name") String name,
@RequestParam("reportNumber") String reportNumber,
@RequestParam("crmName") String crmName,
@RequestParam("isUrl") Boolean isUrl,
@RequestPart("file") MultipartFile file) throws IOException;
}

View File

@@ -0,0 +1,51 @@
package com.njcn.harmonic.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.harmonic.api.PqTypicalSourceFeignClient;
import com.njcn.harmonic.api.RStatLimitRateDClient;
import com.njcn.harmonic.api.ReportFeignClient;
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
import com.njcn.harmonic.pojo.param.UploadParam;
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* @author hongawen
* @version 1.0.0
* @date 2023年07月21日 14:31
*/
@Slf4j
@Component
public class ReportClientFallbackFactory implements FallbackFactory<ReportFeignClient> {
@Override
public ReportFeignClient 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 ReportFeignClient() {
@Override
public HttpResult<String> exportWorld( String startTime, String endTime, Integer type, String lineIndex, String name, String reportNumber, String crmName, Boolean isUrl, MultipartFile file) throws IOException {
log.error("{}异常,降级处理,异常为:{}", "获取谐波报告失败", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}