From 752e00503f672ddfe2066afb6c235721a3a912b5 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 19 十一月 2024 10:25:55 +0800 Subject: [PATCH] 2024.11.19 各项修正 --- src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ScheduleServiceImpl.kt | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ScheduleServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ScheduleServiceImpl.kt index f69ab1d..e94fae8 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ScheduleServiceImpl.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ScheduleServiceImpl.kt @@ -1,5 +1,6 @@ package cn.flightfeather.supervision.lightshare.service.Impl +import cn.flightfeather.supervision.common.exception.BizException import cn.flightfeather.supervision.domain.entity.ScheduleSignRecord import cn.flightfeather.supervision.domain.mapper.BaseInfoMapper import cn.flightfeather.supervision.domain.mapper.EnvironmentalScheduleMapper @@ -41,6 +42,7 @@ res.addAll(ScheduleVo.toScheduleVoList(it, option)) } } + res.sortBy { it.time } res.forEach { val millisecond = it.time?.time!! + 1000 * 60 * 60 * 24 @@ -55,6 +57,32 @@ return BaseResponse(true, data = res) } +// override fun getYearSchedules(option: ScheduleOption): List<ScheduleVo> { +// option.userId ?: throw BizException("鐢ㄦ埛id涓嶈兘涓虹┖") +// val userInfo = userinfoMapper.selectByPrimaryKey(option.userId) ?: throw BizException("鐢ㄦ埛涓嶅瓨鍦�") +// val baseInfo = baseInfoMapper.selectByPrimaryKey(option.userId) +// val config = userConfigRep.getUserConfig(userInfo, baseInfo) +// val res = mutableListOf<ScheduleVo>() +// scheduleRepository.getSchedules(userInfo, config, option).forEach{ +// it?.let { +// +// res.addAll(ScheduleVo.toScheduleVoList(it, option)) +// } +// } +// +// // 鏌ヨ绛炬敹璁板綍 +// res.forEach { +// if (!it.needSign) return@forEach +// val millisecond = it.time?.time!! + 1000 * 60 * 60 * 24 +// val eTime = Date(millisecond) +// val r = scheduleSignRecordRepository.getRecord(option.userId, it.id, it.time, eTime) +// if (r.isNotEmpty()) { +// it.recordId = r[0]?.srId +// it.finished = r[0]?.srSignStatus ?: false +// } +// } +// } + override fun completeSchedule(userId: String, id: Int): BaseResponse<ScheduleSignRecord> { val now = LocalDate.now().atTime(0,0,0) val sTime = Date.from(now.atZone(ZoneId.systemDefault()).toInstant()) -- Gitblit v1.9.3