feat(access): 新增电度数据处理功能并优化设备接入流程
- 新增电度数据分析接口和实现逻辑 - 更新消息消费者以支持电度数据分发处理 - 扩展数据枚举定义以支持新的数据类型 - 增加设备心跳检测定时器单元测试 - 优化Redis等待响应超时时间配置 - 移除未使用的线路服务依赖注入 - 更新设备状态处理逻辑以支持电度数据 - 完善错误处理和异常降级机制
This commit is contained in:
@@ -4,8 +4,11 @@ import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.mq.message.AppAutoDataMessage;
|
||||
import com.njcn.stat.api.fallback.StatClientFallbackFactory;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
@@ -15,4 +18,8 @@ public interface StatFeignClient {
|
||||
|
||||
@PostMapping("/analysis")
|
||||
HttpResult<String> analysis(AppAutoDataMessage appAutoDataMessage);
|
||||
|
||||
@PostMapping("/electricityMeterAnalysis")
|
||||
@ApiOperation("电度数据解析")
|
||||
HttpResult<String> electricityMeterAnalysis(@RequestBody @Validated AppAutoDataMessage appAutoDataMessage);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,13 @@ public class StatClientFallbackFactory implements FallbackFactory<StatFeignClien
|
||||
|
||||
@Override
|
||||
public HttpResult<String> analysis(AppAutoDataMessage appAutoDataMessage) {
|
||||
log.error("{}异常,降级处理,异常为:{}","数据解析",cause.toString());
|
||||
log.error("{}异常,降级处理,异常为:{}",appAutoDataMessage.getId() + "数据解析异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> electricityMeterAnalysis(AppAutoDataMessage appAutoDataMessage) {
|
||||
log.error("{}异常,降级处理,异常为:{}",appAutoDataMessage.getId() + "电度数据解析异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user