From 56e8e3d9616813874a5c83c1770ba9fc761dd3d0 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期六, 19 八月 2023 10:12:57 +0800
Subject: [PATCH] 巡检打卡前
---
ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/RecordBeforeParam.java | 1 +
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java | 26 +++++++++++++++++++++++---
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/RecordBeforeParam.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/RecordBeforeParam.java
index fa34895..4b44f6d 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/RecordBeforeParam.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/RecordBeforeParam.java
@@ -7,4 +7,5 @@
private String planId;
private String wellId;
+ private String toDay;
}
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..7b88c1c 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
@@ -734,19 +734,39 @@
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);
}
}
--
Gitblit v1.9.3