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/domain/param/ArdAppPatrolpointRecordParam.java | 1
ard-work/src/main/java/com/ruoyi/app/patrolplan/mapper/ArdAppPatrolpointRecordMapper.java | 17 ++++----
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/IArdAppPatrolpointRecordService.java | 2 +
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java | 46 +++++++++++++++++++++++
ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java | 15 ++++++-
ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml | 2 +
6 files changed, 71 insertions(+), 12 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
index 0c428c8..9ad4413 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
@@ -215,7 +215,7 @@
}
/**
- * 宸℃鏃ュ巻
+ * 绠$悊绔�--宸℃鏃ュ巻
*/
@PreAuthorize("@ss.hasPermi('app:appPatrolplan:recordMonth')")
@ApiOperation("绠$悊绔�--宸℃鏃ュ巻")
@@ -225,13 +225,22 @@
}
/**
- * 宸℃鏃ュ巻
+ * 绠$悊绔�--鐐瑰嚮鏃ュ巻鑾峰彇璇ヨ褰曚笅浜哄憳鎵撳崱璁板綍
*/
- @PreAuthorize("@ss.hasPermi('app:appPatrolplan:recordMonth')")
+ @PreAuthorize("@ss.hasPermi('app:appPatrolplan:recordDetails')")
@ApiOperation("绠$悊绔�--鐐瑰嚮鏃ュ巻鑾峰彇璇ヨ褰曚笅浜哄憳鎵撳崱璁板綍")
@PostMapping("recordDetails")
public Results recordDetails(@RequestBody ArdAppPatrolpointRecordParam ardAppPatrolpointRecordParam) throws ParseException {
return recordService.recordDetails(ardAppPatrolpointRecordParam);
}
+ /**
+ * 绠$悊绔�--鍗曚汉璇︽儏
+ */
+ @PreAuthorize("@ss.hasPermi('app:appPatrolplan:recordSolo')")
+ @ApiOperation("绠$悊绔�--鍗曚汉璇︽儏")
+ @PostMapping("recordSolo")
+ public Results recordSolo(@RequestBody ArdAppPatrolpointRecordParam ardAppPatrolpointRecordParam) throws ParseException {
+ return recordService.recordSolo(ardAppPatrolpointRecordParam);
+ }
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/ArdAppPatrolpointRecordParam.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/ArdAppPatrolpointRecordParam.java
index a68a445..f616f4f 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/ArdAppPatrolpointRecordParam.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/ArdAppPatrolpointRecordParam.java
@@ -10,4 +10,5 @@
private String planId;
private String cycle;
private String toDay;
+ private String userId;
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/mapper/ArdAppPatrolpointRecordMapper.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/mapper/ArdAppPatrolpointRecordMapper.java
index 90067e8..b0bb88c 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/mapper/ArdAppPatrolpointRecordMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/mapper/ArdAppPatrolpointRecordMapper.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpointRecord;
+import com.ruoyi.app.patrolplan.domain.param.ArdAppPatrolpointRecordParam;
/**
* app宸℃璁″垝璁板綍Mapper鎺ュ彛
@@ -11,11 +12,10 @@
* @author ard
* @date 2023-08-02
*/
-public interface ArdAppPatrolpointRecordMapper extends BaseMapper<ArdAppPatrolpointRecord>
-{
+public interface ArdAppPatrolpointRecordMapper extends BaseMapper<ArdAppPatrolpointRecord> {
/**
* 鏌ヨapp宸℃璁″垝璁板綍
- *
+ *
* @param id app宸℃璁″垝璁板綍涓婚敭
* @return app宸℃璁″垝璁板綍
*/
@@ -23,7 +23,7 @@
/**
* 鏌ヨapp宸℃璁″垝璁板綍鍒楄〃
- *
+ *
* @param ardAppPatrolpointRecord app宸℃璁″垝璁板綍
* @return app宸℃璁″垝璁板綍闆嗗悎
*/
@@ -31,7 +31,7 @@
/**
* 鏂板app宸℃璁″垝璁板綍
- *
+ *
* @param ardAppPatrolpointRecord app宸℃璁″垝璁板綍
* @return 缁撴灉
*/
@@ -39,7 +39,7 @@
/**
* 淇敼app宸℃璁″垝璁板綍
- *
+ *
* @param ardAppPatrolpointRecord app宸℃璁″垝璁板綍
* @return 缁撴灉
*/
@@ -47,7 +47,7 @@
/**
* 鍒犻櫎app宸℃璁″垝璁板綍
- *
+ *
* @param id app宸℃璁″垝璁板綍涓婚敭
* @return 缁撴灉
*/
@@ -55,11 +55,10 @@
/**
* 鎵归噺鍒犻櫎app宸℃璁″垝璁板綍
- *
+ *
* @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
* @return 缁撴灉
*/
public int deleteArdAppPatrolpointRecordByIds(String[] ids);
-// List<ArdAppPatrolpointRecord> maxNum();
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/IArdAppPatrolpointRecordService.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/IArdAppPatrolpointRecordService.java
index 817ab72..d076d30 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/IArdAppPatrolpointRecordService.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/IArdAppPatrolpointRecordService.java
@@ -69,4 +69,6 @@
Results recordMonth(ArdAppPatrolpointRecordParam ardAppPatrolpointRecordParam) throws ParseException;
Results recordDetails(ArdAppPatrolpointRecordParam ardAppPatrolpointRecordParam) throws ParseException;
+
+ Results recordSolo(ArdAppPatrolpointRecordParam ardAppPatrolpointRecordParam);
}
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);
+ }
+
}
diff --git a/ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml b/ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml
index 64e943b..9e0e4a0 100644
--- a/ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml
+++ b/ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml
@@ -83,4 +83,6 @@
<!-- <select id="maxNum">-->
<!-- select user_id,user_name,max(points_num) pointsNum from ard_app_patrolpoint_record GROUP BY user_id,user_name-->
<!-- </select>-->
+
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3