package cn.flightfeather.supervision.lightshare.repository.impl
|
|
import cn.flightfeather.supervision.domain.entity.EnvironmentalSchedule
|
import cn.flightfeather.supervision.domain.entity.UserConfig
|
import cn.flightfeather.supervision.domain.entity.Userinfo
|
import cn.flightfeather.supervision.domain.mapper.EnvironmentalScheduleMapper
|
import cn.flightfeather.supervision.lightshare.repository.ScheduleRepository
|
import cn.flightfeather.supervision.lightshare.vo.ScheduleOption
|
import org.springframework.stereotype.Repository
|
|
@Repository
|
class ScheduleRepositoryImpl(private val scheduleMapper: EnvironmentalScheduleMapper) : ScheduleRepository {
|
|
override fun getSchedules(
|
userInfo: Userinfo,
|
configs: List<UserConfig?>,
|
option: ScheduleOption,
|
): List<EnvironmentalSchedule?> {
|
if (userInfo.guid == null || configs.isEmpty() || userInfo.extension2 == null) return emptyList()
|
val configId = mutableListOf<Int>()
|
configs.forEach { it?.let { configId.add(it.ucId) } }
|
return scheduleMapper.getSchedules(userInfo.guid!!, configId, userInfo.extension2!!, option.type)
|
}
|
}
|