|  | @@ -10,7 +10,10 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
											
												
													
														|  |  import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 |  |  import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
											
												
													
														|  |  import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 |  |  import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
											
												
													
														|  |  import com.xunmei.common.core.constant.SecurityConstants;
 |  |  import com.xunmei.common.core.constant.SecurityConstants;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.common.core.domain.DateRange;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.common.core.enums.CycleCommonEnum;
 | 
											
												
													
														|  |  import com.xunmei.common.core.exception.ServiceException;
 |  |  import com.xunmei.common.core.exception.ServiceException;
 | 
											
												
													
														|  | 
 |  | +import com.xunmei.common.core.utils.DateUtils;
 | 
											
												
													
														|  |  import com.xunmei.common.core.utils.IDHelper;
 |  |  import com.xunmei.common.core.utils.IDHelper;
 | 
											
												
													
														|  |  import com.xunmei.common.core.utils.StringUtils;
 |  |  import com.xunmei.common.core.utils.StringUtils;
 | 
											
												
													
														|  |  import com.xunmei.common.core.utils.Ymd;
 |  |  import com.xunmei.common.core.utils.Ymd;
 | 
											
										
											
												
													
														|  | @@ -87,7 +90,13 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public TableDataInfo appList(AppPageDto dto) {
 |  |      public TableDataInfo appList(AppPageDto dto) {
 | 
											
												
													
														|  | 
 |  | +        if(ObjectUtil.isNotNull(dto.getTaskTime())){
 | 
											
												
													
														|  | 
 |  | +            DateRange r= DateUtils.getStartAndEnd(dto.getTaskTime(), CycleCommonEnum.MONTHLY);
 | 
											
												
													
														|  | 
 |  | +            dto.setStartTime(r.getStartTime());
 | 
											
												
													
														|  | 
 |  | +            dto.setEndTime(r.getEndTime());
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  |          Page<AppPageVo> page = dto.toPage();
 |  |          Page<AppPageVo> page = dto.toPage();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          page = baseMapper.selectTaskGroup(page, dto, SecurityUtils.getUserId());
 |  |          page = baseMapper.selectTaskGroup(page, dto, SecurityUtils.getUserId());
 | 
											
												
													
														|  |          if (CollectionUtil.isEmpty(page.getRecords())) {
 |  |          if (CollectionUtil.isEmpty(page.getRecords())) {
 | 
											
												
													
														|  |              return TableDataInfo.success(page);
 |  |              return TableDataInfo.success(page);
 | 
											
										
											
												
													
														|  | @@ -96,25 +105,26 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
 | 
											
												
													
														|  |  //        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
 |  |  //        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  //        List<Long> batchIds = page.getRecords().stream().map(r -> r.getBatchId()).collect(Collectors.toList());
 |  |  //        List<Long> batchIds = page.getRecords().stream().map(r -> r.getBatchId()).collect(Collectors.toList());
 | 
											
												
													
														|  | -        LambdaQueryWrapper<CoreSafetyTask> wrapper = new LambdaQueryWrapper<CoreSafetyTask>();
 |  | 
 | 
											
												
													
														|  | -        if (ObjectUtil.isNotNull(dto.getBeCheckedOrgId())) {
 |  | 
 | 
											
												
													
														|  | -            wrapper.eq(CoreSafetyTask::getOrgId, dto.getBeCheckedOrgId());
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        if (ObjectUtil.isNotNull(dto.getCheckOrgId())) {
 |  | 
 | 
											
												
													
														|  | -            wrapper.and(w -> w.eq(CoreSafetyTask::getCheckOrgId, dto.getCheckOrgId())
 |  | 
 | 
											
												
													
														|  | -                    .or()
 |  | 
 | 
											
												
													
														|  | -                    .eq(CoreSafetyTask::getGrantUserId, SecurityUtils.getUserId()));
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        if (ObjectUtil.isNotNull(dto.getStatus())) {
 |  | 
 | 
											
												
													
														|  | -            wrapper.eq(CoreSafetyTask::getStatus, dto.getStatus());
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        if (ObjectUtil.isNotNull(dto.getTaskTime())) {
 |  | 
 | 
											
												
													
														|  | -            wrapper.and(w -> w.and(w1 -> w1.ge(CoreSafetyTask::getPlanEndTime, dto.getTaskTime())
 |  | 
 | 
											
												
													
														|  | -                    .le(CoreSafetyTask::getPlanStartTime, dto.getTaskTime())).or().eq(CoreSafetyTask::getYmdDate, dto.getTaskTime()));
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        wrapper.in(CoreSafetyTask::getPlanId, page.getRecords().stream().map(r -> r.getPlanId()).collect(Collectors.toList()));
 |  | 
 | 
											
												
													
														|  | 
 |  | +//        LambdaQueryWrapper<CoreSafetyTask> wrapper = new LambdaQueryWrapper<CoreSafetyTask>();
 | 
											
												
													
														|  | 
 |  | +//        if (ObjectUtil.isNotNull(dto.getBeCheckedOrgId())) {
 | 
											
												
													
														|  | 
 |  | +//            wrapper.eq(CoreSafetyTask::getOrgId, dto.getBeCheckedOrgId());
 | 
											
												
													
														|  | 
 |  | +//        }
 | 
											
												
													
														|  | 
 |  | +//        if (ObjectUtil.isNotNull(dto.getCheckOrgId())) {
 | 
											
												
													
														|  | 
 |  | +//            wrapper.and(w -> w.eq(CoreSafetyTask::getCheckOrgId, dto.getCheckOrgId())
 | 
											
												
													
														|  | 
 |  | +//                    .or()
 | 
											
												
													
														|  | 
 |  | +//                    .eq(CoreSafetyTask::getGrantUserId, SecurityUtils.getUserId()));
 | 
											
												
													
														|  | 
 |  | +//        }
 | 
											
												
													
														|  | 
 |  | +//        if (ObjectUtil.isNotNull(dto.getStatus())) {
 | 
											
												
													
														|  | 
 |  | +//            wrapper.eq(CoreSafetyTask::getStatus, dto.getStatus());
 | 
											
												
													
														|  | 
 |  | +//        }
 | 
											
												
													
														|  | 
 |  | +//        if (ObjectUtil.isNotNull(dto.getTaskTime())) {
 | 
											
												
													
														|  | 
 |  | +//            wrapper.and(w -> w.and(w1 -> w1.ge(CoreSafetyTask::getPlanEndTime, dto.getTaskTime())
 | 
											
												
													
														|  | 
 |  | +//                    .le(CoreSafetyTask::getPlanStartTime, dto.getTaskTime()))
 | 
											
												
													
														|  | 
 |  | +//                    .or().eq(CoreSafetyTask::getYmdDate, dto.getTaskTime()));
 | 
											
												
													
														|  | 
 |  | +//        }
 | 
											
												
													
														|  | 
 |  | +//        wrapper.in(CoreSafetyTask::getPlanId, page.getRecords().stream().map(r -> r.getPlanId()).collect(Collectors.toList()));
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        List<CoreSafetyTask> list = baseMapper.selectList(wrapper);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        List<CoreSafetyTask> list = baseMapper.selectTaskList(dto,SecurityUtils.getUserId());
 | 
											
												
													
														|  |  //        Map<Long, List<CoreSafetyTask>> grouped = list.stream().collect(Collectors.groupingBy(t -> t.getBatchId()));
 |  |  //        Map<Long, List<CoreSafetyTask>> grouped = list.stream().collect(Collectors.groupingBy(t -> t.getBatchId()));
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          List<Long> planIds = page.getRecords().stream().map(r -> r.getPlanId()).distinct().collect(Collectors.toList());
 |  |          List<Long> planIds = page.getRecords().stream().map(r -> r.getPlanId()).distinct().collect(Collectors.toList());
 |