From bbf251d114d2dfcf522ea9183175fa2d77005dc5 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期一, 26 一月 2026 14:38:10 +0800
Subject: [PATCH] 设备管理-巡检管理-搜索查询修改

---
 src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java b/src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java
index 26e3bdd..a84a70d 100644
--- a/src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java
+++ b/src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java
@@ -25,6 +25,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -63,6 +64,9 @@
     public IPage<InspectionTaskDto> selectInspectionTaskList(Page<InspectionTask> page, InspectionTaskDto inspectionTaskDto) {
         LambdaQueryWrapper<InspectionTask> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.orderByDesc(InspectionTask::getCreateTime);
+        if (StringUtils.isNotBlank(inspectionTaskDto.getTaskName())) {
+            queryWrapper.like(InspectionTask::getTaskName, inspectionTaskDto.getTaskName());
+        }
         IPage<InspectionTask> entityPage = inspectionTaskMapper.selectPage(page, queryWrapper);
 
         //  鏃犳暟鎹彁鍓嶈繑鍥�
@@ -70,19 +74,19 @@
             return new Page<>(entityPage.getCurrent(), entityPage.getSize(), entityPage.getTotal());
         }
         // 鑾峰彇id闆嗗悎
-        List<Long> ids = entityPage.getRecords().stream().map(InspectionTask::getId).toList();
+        List<Long> ids = entityPage.getRecords().stream().map(InspectionTask::getId).collect(Collectors.toList());
         //鐧昏浜篿ds
-        List<Long> registrantIds = entityPage.getRecords().stream().map(InspectionTask::getRegistrantId).toList();
+        List<Long> registrantIds = entityPage.getRecords().stream().map(InspectionTask::getRegistrantId).collect(Collectors.toList());
         // 鎵归噺鏌ヨ鐧昏浜�
         Map<Long, SysUser> sysUserMap;
         if (!registrantIds.isEmpty()) {
-            List<SysUser> sysUsers = sysUserMapper.selectList(registrantIds);
+            List<SysUser> sysUsers = sysUserMapper.selectUsersByIds(registrantIds);
             sysUserMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity()));
         } else {
             sysUserMap = new HashMap<>();
         }
         //宸℃浜篿ds
-        List<String> inspectorIds = entityPage.getRecords().stream().map(InspectionTask::getInspectorId).toList();
+        List<String> inspectorIds = entityPage.getRecords().stream().map(InspectionTask::getInspectorId).collect(Collectors.toList());
 
         //鑾峰彇鎵�鏈変笉閲嶅鐨勭敤鎴稩D
         Set<Long> allUserIds = entityPage.getRecords().stream()
@@ -151,6 +155,8 @@
                 dto.setInspector(inspectorNames);
             }
 
+            dto.setDateStr(inspectionTask.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+
             // 鍒濆鍖栦笁涓檮浠跺垪琛�
             dto.setBeforeProduction(new ArrayList<>());
             dto.setAfterProduction(new ArrayList<>());

--
Gitblit v1.9.3