fix
zhangqian
2023-11-03 a9fa2fe7c72279cecc916bb63cee154cdea67b54
fix
2个文件已修改
11 ■■■■ 已修改文件
service/device.go 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/problem/check.go 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/device.go
@@ -4,12 +4,16 @@
    "apsClient/conf"
    "apsClient/model"
    "apsClient/pkg/logx"
    "github.com/jinzhu/gorm"
    "os"
    "strings"
)
func GetDeviceIDList() (deviceIds []string, err error) {
    devices, err := model.NewDeviceSearch().SetDeviceMac(conf.Conf.System.DeviceId).FindNotTotal()
    if err == gorm.ErrRecordNotFound {
        return nil, nil
    }
    if err != nil {
        return nil, err
    }
@@ -32,9 +36,9 @@
    }
    if len(deviceList) == 0 {
        conf.Conf.CurrentDeviceID = conf.Conf.System.DeviceId
        return nil
    } else {
        conf.Conf.CurrentDeviceID = deviceList[0]
    }
    conf.Conf.CurrentDeviceID = deviceList[0]
    SetDeviceIDToFile(conf.Conf.CurrentDeviceID)
    return nil
}
service/problem/check.go
@@ -168,6 +168,9 @@
func (slf *PlcConfig) Check() bool {
    plcConfig, _ := service.NewDevicePlcService().GetDevicePlc()
    if plcConfig == nil {
        return false
    }
    if plcConfig.Method == "" {
        return false
    }