From 53e14c1919c4a3112f963689d0ce75fa08831021 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期六, 19 八月 2023 12:32:20 +0800
Subject: [PATCH] 增加通道管理业务 修改相机部分实体字段

---
 ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 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 1cd2ed5..1923dba 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
@@ -71,7 +71,8 @@
                 .eq("user_id",ardAppPatrolpointRecord.getUserId());
         List<ArdAppPatrolpointRecord> recordList = ardAppPatrolpointRecordMapper.selectList(recordQueryWrapper);
         ardAppPatrolpointRecord.setPointsNum(recordList.size()+1);
-        int num = ardAppPatrolpointRecordMapper.insert(ardAppPatrolpointRecord);
+//        int num = ardAppPatrolpointRecordMapper.insert(ardAppPatrolpointRecord);
+        int num = ardAppPatrolpointRecordMapper.insertArdAppPatrolpointRecord(ardAppPatrolpointRecord);
         List<String> list = ardAppPatrolpointRecord.getImg();
         for (int i = 0; i < list.size(); i++) {
             ArdAppPatrolpointRecordImg recordImg = new ArdAppPatrolpointRecordImg();
@@ -79,7 +80,7 @@
             recordImg.setId(imgId);
             recordImg.setAppPatrolponitRecordId(id);
             recordImg.setImg(list.get(i));
-            recordImgMapper.insert(recordImg);
+            recordImgMapper.insertArdAppPatrolpointRecordImg(recordImg);
         }
         if(num>0){
             return Results.succeed("鎵撳崱鎴愬姛锛�");
@@ -734,19 +735,45 @@
     public Results recordBefore(RecordBeforeParam recordBeforeParam) {
         String planId = recordBeforeParam.getPlanId();
         String wellId = recordBeforeParam.getWellId();
+        String toDay = recordBeforeParam.getToDay();
         String userId = SecurityUtils.getUserId();
         JSONArray jsonArray = new JSONArray();
         ArdAppPatrolplan plan = patrolplanMapper.selectById(planId);
         jsonArray.add(plan);
         QueryWrapper<ArdAppPatrolpointRecord> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("plan_id",planId).eq("app_patrolpoints_id",wellId).eq("user_id",userId);
+        queryWrapper.eq("plan_id",planId).eq("app_patrolpoints_id",wellId).eq("user_id",userId).like("record_time",toDay);
         ArdAppPatrolpointRecord record = ardAppPatrolpointRecordMapper.selectOne(queryWrapper);
         //鏍规嵁濮撳悕ID鏌ヨ璁″垝鍒跺畾浜虹殑濮撳悕
         String planUserId = plan.getUserId();
         SysUser sysUser = sysUserMapper.selectById(planUserId);
         String nikeName = sysUser.getNickName();
-        record.setPlanUserName(nikeName);
-        jsonArray.add(record);
+        if(record==null){
+            //鏍规嵁濮撳悕ID鏌ヨ鎵ц浜哄鍚�
+            SysUser user = sysUserMapper.selectById(userId);
+            String userName = user.getNickName();
+            //鏌ヨ璇ヨ鍒掔殑鎵�鏈夊叴瓒g偣
+            ArdAlarmpointsWell ardAlarmpointsWell = wellMapper.selectById(wellId);
+            //娌℃墦鍗$殑鏁版嵁
+            ArdAppPatrolpointRecord record1 = new ArdAppPatrolpointRecord();
+            record1.setAppPatrolpointsId(ardAlarmpointsWell.getId());
+            record1.setAppPatrolpointsName(ardAlarmpointsWell.getWellId());
+            record1.setPlanId(planId);
+            record1.setPlanName(plan.getPlanName());
+            record1.setUserId(userId);
+            record1.setUserName(userName);
+            record1.setLatitude(String.valueOf(ardAlarmpointsWell.getLatitude()));
+            record1.setLongitude(String.valueOf(ardAlarmpointsWell.getLongitude().toString()));
+            record1.setPlanUserName(nikeName);
+            jsonArray.add(record1);
+        }else {
+            jsonArray.add(record);
+        }
         return Results.succeed(jsonArray);
     }
+
+    @Override
+    public Results son() {
+
+        return null;
+    }
 }

--
Gitblit v1.9.3