From 013c5f28422defd9b47abbe17a827be693872a26 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期四, 04 一月 2024 14:39:26 +0800
Subject: [PATCH] 调整优化正来电子粮情协议
---
src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java b/src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java
index 945f152..fb85434 100644
--- a/src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java
+++ b/src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java
@@ -13,6 +13,7 @@
import com.fzzy.gateway.entity.GatewayDevice;
import com.fzzy.gateway.hx2023.ScConstant;
import com.fzzy.gateway.hx2023.data.*;
+import com.fzzy.protocol.ProtocolUtils;
import com.fzzy.protocol.fzzy.builder.SimpleCommandBuilder;
import com.fzzy.protocol.fzzy.cmd.BaseRemoteImpl;
import com.fzzy.protocol.fzzy.data.ReMessage;
@@ -93,7 +94,7 @@
private void buildBizInfo1(Response2102 response) {
//鑾峰彇璇锋眰淇℃伅
- BaseReqData reqData = ServerUtils.getSyncReq(response.getHouseId());
+ BaseReqData reqData = ProtocolUtils.getSyncReq(response.getHouseId());
if (null == reqData) {
log.error("--绮儏灏佽瑙f瀽锛屾湭鑾峰彇鍒拌姹傜浉鍏冲弬鏁�----");
@@ -158,7 +159,11 @@
}
outPut.setTemperature(temperature);
+ List<GrainTH> ths = new ArrayList<>();
+ ths.add(new GrainTH(response.getTIn()!=null?response.getTIn()+"":"",response.getHIn()!=null?response.getHIn()+"":"","1"));
+ outPut.setTemperatureAndhumidity(ths);
+ //grain.setOutput(JSONObject.toJSONString(outPut));
grain.setOutput(com.alibaba.fastjson2.JSONObject.toJSONString(outPut));
@@ -202,6 +207,7 @@
GatewayDeviceReportService reportService = gatewayRemoteManager.getDeviceReportService(reqData.getDevice().getPushProtocol());
if (null == reportService) {
log.error("------------绮儏鎺ㄩ�佸け璐ワ紝绯荤粺涓嶅瓨鍦ㄥ綋鍓嶅崗璁墽琛岀被----{}", reqData.getDevice().getDeviceName());
+ return;
}
reportService.reportGrainData(reqData);
}
--
Gitblit v1.9.3