| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.DeviceUsageMapper; |
| | | import com.ruoyi.system.model.DeviceUsage; |
| | | import com.ruoyi.system.model.Record; |
| | | import com.ruoyi.system.query.DeviceListQuery; |
| | | import com.ruoyi.system.service.DeviceUsageService; |
| | | import com.ruoyi.system.vo.DeviceListVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.YearMonth; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public List<String> getDeviceUsageList(Integer id) { |
| | | return this.baseMapper.getDeviceUsageList(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceListVo> getDeviceList(Page<DeviceListVo> page, DeviceListQuery query) { |
| | | List<DeviceListVo> deviceList = this.baseMapper.getDeviceList(page, query); |
| | | for (DeviceListVo deviceListVo : deviceList) { |
| | | LocalDateTime checkTime = deviceListVo.getCheckTime(); |
| | | // 判断checkTime是否是本月的时间 |
| | | if (checkTime != null && YearMonth.from(checkTime).equals(YearMonth.now())) { |
| | | deviceListVo.setCheckResult("已检查"); |
| | | }else { |
| | | deviceListVo.setCheckResult("未检查"); |
| | | } |
| | | } |
| | | return deviceList; |
| | | } |
| | | |
| | | |
| | | } |