|
|
|
@ -12,12 +12,14 @@ import cn.iocoder.yudao.module.system.dal.mysql.enterprise.EnterpriseMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.enterpriseinspections.EnterpriseInspectionsMapper; |
|
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.taglibrary.TagLibraryMapper; |
|
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.tasktag.TaskTagMapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@ -182,7 +184,40 @@ public class TaskInfoServiceImpl implements TaskInfoService {
|
|
|
|
|
@Override |
|
|
|
|
public PageResult<TaskInfoDO> getTaskInfoAppPage(TaskInfoPageReqVO pageReqVO) { |
|
|
|
|
|
|
|
|
|
final PageResult<TaskInfoDO> taskInfoDOPageResult = taskInfoMapper.selectPage(pageReqVO); |
|
|
|
|
//按标签查询
|
|
|
|
|
if (pageReqVO.getTagList() != null && pageReqVO.getTagList().size() > 0) { |
|
|
|
|
LambdaQueryWrapper<TaskTagDO> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.in(TaskTagDO::getTaskId, pageReqVO.getTagList()); |
|
|
|
|
final List<TaskTagDO> taskTagDOS = taskTagMapper.selectList(); |
|
|
|
|
if (taskTagDOS != null && taskTagDOS.size() > 0) { |
|
|
|
|
pageReqVO.setTagList(taskTagDOS.stream().map(TaskTagDO::getTagId).collect(Collectors.toList())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//按时间查询
|
|
|
|
|
if (pageReqVO.getSelectWeek() != null) { |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
LocalDateTime[] dateList = new LocalDateTime[2]; |
|
|
|
|
|
|
|
|
|
switch (pageReqVO.getSelectWeek()) { |
|
|
|
|
case 1: |
|
|
|
|
dateList[0] = now.minusDays(3); // 三天前
|
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
dateList[0] = now.minusWeeks(1); // 一周前
|
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
dateList[0] = now.minusMonths(1); // 一月前
|
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
dateList[0] = now.minusYears(1); // 一年前
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
dateList[1] = now; |
|
|
|
|
pageReqVO.setEndDate(dateList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
final PageResult<TaskInfoDO> taskInfoDOPageResult = taskInfoMapper.selectAppPage(pageReqVO); |
|
|
|
|
if (taskInfoDOPageResult.getList() != null && taskInfoDOPageResult.getList().size() > 0) { |
|
|
|
|
taskInfoDOPageResult.getList().forEach(item->{ |
|
|
|
|
QueryWrapper<EnterpriseInspectionsDO> wrapper = new QueryWrapper<>(); |
|
|
|
|