From 400431e56ba1000fc08ff58684087899cb7ec9d9 Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期五, 26 十二月 2025 16:54:08 +0800
Subject: [PATCH] fix :修改

---
 src/main/java/com/boying/controller/InspectionController.java |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/boying/controller/InspectionController.java b/src/main/java/com/boying/controller/InspectionController.java
index fc9872d..dd2c98b 100644
--- a/src/main/java/com/boying/controller/InspectionController.java
+++ b/src/main/java/com/boying/controller/InspectionController.java
@@ -5,7 +5,9 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.boying.common.R;
 import com.boying.entity.Inspection;
+import com.boying.entity.Repair;
 import com.boying.entity.WhiteList;
+import com.boying.service.BarrierService;
 import com.boying.service.InspectionService;
 import com.boying.service.ParkService;
 import com.boying.service.WhiteListService;
@@ -17,6 +19,7 @@
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.List;
 
 
 @RestController
@@ -25,13 +28,24 @@
 public class InspectionController {
 
     private final InspectionService inspectionService;
+    private final ParkService parkService;
+    private final BarrierService barrierService;
 
     @PostMapping("/findPage")
-    public Object findPage(Page page) {
+    public Object findPage(Page page,Long parkId) {
         QueryWrapper<Inspection> wrapper = new QueryWrapper<>();
         wrapper.lambda()
+                .eq(parkId !=null,Inspection::getParkId,parkId)
                 .orderByDesc(Inspection::getId);
         Page<Inspection> page1 = inspectionService.page(page, wrapper);
+        List<Inspection> records = page1.getRecords();
+        for (Inspection record : records) {
+            record.setParkName(parkService.getById(record.getParkId()).getName());
+            if(record.getBarrierId()!=null){
+                record.setBarrierName(barrierService.getById(record.getBarrierId()).getName());
+            }
+        }
+        page1.setRecords(records);
         return R.ok(page1);
     }
 

--
Gitblit v1.9.1