| | |
| | | import com.fzzy.gateway.entity.GatewayDevice; |
| | | import com.fzzy.gateway.hx2023.ScConstant; |
| | | import com.fzzy.gateway.hx2023.data.*; |
| | | import com.fzzy.protocol.ConstantProtocol; |
| | | import com.fzzy.protocol.ProtocolUtils; |
| | | import com.fzzy.protocol.bhzn.cmd.CommandBuild; |
| | | import com.fzzy.protocol.bhzn.cmd.ReMessageBuilder; |
| | | import com.fzzy.protocol.bhzn.data.IoMessage; |
| | | import com.fzzy.protocol.bhzn.data.THDto; |
| | | import com.fzzy.protocol.data.THDto; |
| | | import com.fzzy.protocol.bhzn.server.BhznGrainV2ServerEngine; |
| | | import com.fzzy.protocol.bhzn.server.BhznGrainV2ServerUtils; |
| | | import com.fzzy.protocol.fzzy.server.ServerUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | } |
| | | |
| | | //获取请求信息 |
| | | BaseReqData reqData = BhznGrainV2ServerUtils.getSyncReq(gatewayDevice.getDepotIdSys()); |
| | | BaseReqData reqData = ProtocolUtils.getSyncReq(gatewayDevice.getDepotIdSys()); |
| | | if (null == reqData) { |
| | | replayGrain(message); |
| | | log.error("主机-------->>平台,解析粮情失败,未获取到粮情请求信息:" + message.getAddr()); |
| | |
| | | temp = "0000"; |
| | | } |
| | | if (ReMessageBuilder.ERROR_TAG.equals(temp)) { |
| | | tempValue = ConstantProtocol.ERROR_TEMP; |
| | | tempValue = ProtocolUtils.ERROR_TEMP; |
| | | } else { |
| | | tempValue = BytesUtil.hexToInt(BytesUtil.tran_LH(temp)) / 10.0; |
| | | } |
| | | // 故障值处理 |
| | | if (tempValue >= ReMessageBuilder.FAULT_CHECK_TAG) { |
| | | tempValue = ConstantProtocol.FAULT_TEMP; |
| | | tempValue = ProtocolUtils.FAULT_TEMP; |
| | | } |
| | | temps.add(tempValue); |
| | | } |