优化暂态事件推送时部门数据的获取
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.api.fallback.DeptLineFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -40,6 +43,10 @@ public interface DeptLineFeignClient {
|
||||
|
||||
@PostMapping("/getLineByLineIds")
|
||||
HttpResult<DeptLine> getLineByLineIds(@RequestParam("id") String ids);
|
||||
|
||||
@PostMapping("/getDeptListByLineId")
|
||||
HttpResult<List<DeptLine>> getDeptListByLineId(@RequestParam("id") String ids);
|
||||
|
||||
/**
|
||||
* @Description: 部门Id获取所有子集部门绑定监测点
|
||||
* @Param:
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.njcn.device.pq.api.DeptLineFeignClient;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -69,6 +70,12 @@ public class DeptLineFeignClientFallbackFactory implements FallbackFactory<DeptL
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DeptLine>> getDeptListByLineId(String ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据监测点获取部门id(集合)", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getLineNodeByDeptId(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据部门信息id查询监测点id集合", throwable.toString());
|
||||
|
||||
Reference in New Issue
Block a user