feiyu02
2024-04-25 0392c333ed3d987cb2ab3dac4e1a972cff405f21
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/DeviceMapVo.kt
@@ -74,4 +74,29 @@
            return res
        }
    }
}
/**
 * 根据设备mn编码找到对应关系
 */
fun List<DeviceMapVo>.findByDeviceCode(code: String?): DeviceMapVo? {
    this.forEach {
        if (it.deviceCode == code) {
            return it
        }
    }
    return null
}
/**
 * 根据飞羽监管系统用户id找到对应关系
 */
fun List<DeviceMapVo>.findBySVUserId(svUserId: String?): List<DeviceMapVo> {
    val res = mutableListOf<DeviceMapVo>()
    this.forEach {
        if (it.svUserId == svUserId) {
            res.add(it)
        }
    }
    return res
}