feat(api): 添加批量插入通信数据功能
- 在CsCommunicateFeignClient中增加insertionList接口方法 - 实现批量插入的fallback处理逻辑 - 在ICsCommunicateService中添加insertionList服务接口 - 完成InfluxdbCsCommunicateServiceImpl中的批量插入实现 - 优化数据处理逻辑,支持运行状态转换和CT/PT计算 - 添加数据排序功能,按项目名、设备名、测点名排序 - 在控制器中增加批量插入数据的REST接口
This commit is contained in:
@@ -8,6 +8,8 @@ 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 xy
|
||||
*/
|
||||
@@ -17,4 +19,7 @@ public interface CsCommunicateFeignClient {
|
||||
|
||||
@PostMapping("/insertion")
|
||||
HttpResult<String> insertion(@RequestBody PqsCommunicateDto pqsCommunicateDto);
|
||||
|
||||
@PostMapping("/insertionList")
|
||||
HttpResult<String> insertionList(@RequestBody List<PqsCommunicateDto> list);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
@@ -35,6 +37,12 @@ public class CsCommunicateFeignClientFallbackFactory implements FallbackFactory<
|
||||
log.error("{}异常,降级处理,异常为:{}","新增记录",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> insertionList(List<PqsCommunicateDto> list) {
|
||||
log.error("{}异常,降级处理,异常为:{}","批量插入数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user