From ee89d67599e85222b1df11df6601ab5658475052 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期六, 12 八月 2023 17:06:53 +0800
Subject: [PATCH] 巡检个人记录

---
 ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java
index bb94225..b9ff8f1 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java
@@ -359,4 +359,50 @@
         }
     }
 
+    @Override
+    public Results recordSolo(ArdAppPatrolpointRecordParam ardAppPatrolpointRecordParam) {
+        String toDay = ardAppPatrolpointRecordParam.getToDay();
+        String planId = ardAppPatrolpointRecordParam.getPlanId();
+        String userId = ardAppPatrolpointRecordParam.getUserId();
+        QueryWrapper<ArdAppPatrolpointRecord> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("plan_id", planId).eq("user_id",userId).like("record_time", toDay);
+        //褰撳墠璁″垝閫変腑鏃堕棿閲屾鐢ㄦ埛鐨勬墦鍗¤褰�
+        List<ArdAppPatrolpointRecord> list = ardAppPatrolpointRecordMapper.selectList(queryWrapper);
+        for (ArdAppPatrolpointRecord appPatrolpointRecord : list) {
+            QueryWrapper<ArdAppPatrolpointRecordImg> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("app_patrolponit_record_id", appPatrolpointRecord.getId());
+            List<ArdAppPatrolpointRecordImg> list1 = recordImgMapper.selectList(queryWrapper1);
+            List<String> strings = new ArrayList<>();
+            for (ArdAppPatrolpointRecordImg ardAppPatrolpointRecordImg : list1) {
+                strings.add(ardAppPatrolpointRecordImg.getImg());
+            }
+            appPatrolpointRecord.setImg(strings);
+        }
+        //鎵撹繃鍗$殑鍦扮偣
+        List<String> pointList = new ArrayList<>();
+        for (ArdAppPatrolpointRecord appPatrolpointRecord : list) {
+            pointList.add(appPatrolpointRecord.getAppPatrolpointsId());
+        }
+        //鏌ヨ璇ヨ鍒掔殑鎵�鏈夊叴瓒g偣
+        List<ArdAlarmpointsWell> wellList = wellMapper.wellByPlanId(planId);
+        for (ArdAlarmpointsWell ardAlarmpointsWell : wellList) {
+            //鎵�鏈夊簲璇ユ墦鍗$殑鍦扮偣ID
+            String well = ardAlarmpointsWell.getId();
+            //濡傛灉鎵撳紑鍦扮偣涓嶅寘鍚簲鎵撳崱鍦扮偣锛岄偅璇村悕杩欏潡鍎挎病鎵撳崱
+            if (!pointList.contains(well)) {
+                ArdAppPatrolpointRecord ardAppPatrolpointRecord = new ArdAppPatrolpointRecord();
+                ardAppPatrolpointRecord.setAppPatrolpointsId(well);
+                ardAppPatrolpointRecord.setAppPatrolpointsName(ardAlarmpointsWell.getWellId());
+                ardAppPatrolpointRecord.setPlanId(planId);
+                ardAppPatrolpointRecord.setPlanName(list.get(0).getPlanName());
+                ardAppPatrolpointRecord.setUserId(userId);
+                ardAppPatrolpointRecord.setUserName(list.get(0).getUserName());
+                ardAppPatrolpointRecord.setLatitude(ardAlarmpointsWell.getLatitude().toString());
+                ardAppPatrolpointRecord.setLongitude(ardAlarmpointsWell.getLongitude().toString());
+                list.add(ardAppPatrolpointRecord);
+            }
+        }
+        return Results.succeed(list);
+    }
+
 }

--
Gitblit v1.9.3