zhangqian
2023-09-02 a16dcef8f200b787fcde115088cb699b167c3023
获取plc写入地址只处理本设备的消息
2个文件已修改
3 ■■■■ 已修改文件
model/common/common.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nsq/msg_handler.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/common/common.go
@@ -63,6 +63,7 @@
    ResponsePlcAddress struct {
        KeyData     []byte
        AddressData []byte
        DeviceId    string
    }
)
nsq/msg_handler.go
@@ -102,7 +102,7 @@
        logx.Errorf("ScheduleTask HandleMessage Unmarshal json err: %v", err.Error())
        return nil
    }
    if len(resp.KeyData) == 0 || len(resp.AddressData) == 0 {
    if len(resp.KeyData) == 0 || len(resp.AddressData) == 0 || resp.DeviceId != conf.Conf.System.DeviceId {
        return nil
    }
    //写入到文件