| | |
| | | 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 |
| | |
| | | res.addAll(ScheduleVo.toScheduleVoList(it, option)) |
| | | } |
| | | } |
| | | res.sortBy { it.time } |
| | | |
| | | res.forEach { |
| | | val millisecond = it.time?.time!! + 1000 * 60 * 60 * 24 |
| | |
| | | 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()) |