预处理模块:工单问题生成,主网有效监测时长计算,

过程监督模块:工单模块功能,其他模块的审核
This commit is contained in:
huangzj
2023-02-27 11:24:58 +08:00
parent 5915ed87ac
commit 338b659d94
58 changed files with 2932 additions and 57 deletions

View File

@@ -0,0 +1,28 @@
package com.njcn.device.pms.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pms.api.fallback.PmsPowerDistributionareaClientFallbackFactory;
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
import com.njcn.device.pms.pojo.po.PowerDistributionarea;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @author clam
* @date 2022/10/18
*/
@FeignClient(
value = ServerInfo.DEVICE,
path = "/pms/powerDistributionarea",
contextId = "pms/powerDistributionarea",
fallbackFactory = PmsPowerDistributionareaClientFallbackFactory.class)
public interface PmsPowerDistributionareaClient {
@PostMapping("getPowerDistributionList")
HttpResult<List<PowerDistributionarea>> getPowerDistributionList(@RequestBody PowerDistributionareaParam powerDistributionareaParam);
}

View File

@@ -0,0 +1,43 @@
package com.njcn.device.pms.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.pms.api.PmsPowerDistributionareaClient;
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
import com.njcn.device.pms.pojo.po.PowerDistributionarea;
import com.njcn.device.pms.utils.PmsDeviceEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author clam
* @date 2022/10/18
*/
@Slf4j
@Component
public class PmsPowerDistributionareaClientFallbackFactory implements FallbackFactory<PmsPowerDistributionareaClient> {
@Override
public PmsPowerDistributionareaClient create(Throwable throwable) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (throwable.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) throwable.getCause();
exceptionEnum = PmsDeviceEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new PmsPowerDistributionareaClient()
{
@Override
public HttpResult<List<PowerDistributionarea>> getPowerDistributionList(PowerDistributionareaParam powerDistributionareaParam) {
log.error("{}异常,降级处理,异常为:{}", "获取配网所有台区", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -2,8 +2,6 @@ package com.njcn.device.pms.service.majornetwork;
import com.njcn.event.pojo.po.EventDetail;
import java.util.List;
/**
* @author qijian
* @version 1.0.0

View File

@@ -52,9 +52,9 @@ public class RStatDevSignalDServiceImpl extends ServiceImpl<RStatDevSignalDMappe
}
//获取所有子部门信息
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
/*获取下一级子部门信息*/
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
// /*获取下一级子部门信息*/
// List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
if (CollUtil.isEmpty(deptDTOList)) {
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
}