From b0f656f209539a5ee52e103018e86e7b7692e313 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期五, 18 八月 2023 10:55:20 +0800
Subject: [PATCH] 单兵端--巡检单天计划
---
ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/RecordDetailsExParam.java | 10 +++++
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/IArdAppPatrolpointRecordService.java | 3 +
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java | 69 ++++++++++++++++++++++++++++++++++
ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java | 4 +-
4 files changed, 82 insertions(+), 4 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 1d3da58..27534a9 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
@@ -292,8 +292,8 @@
@PreAuthorize("@ss.hasPermi('app:appPatrolplan:executeDetails')")
@ApiOperation("鍗曞叺绔�--鐐瑰嚮鏃ュ巻鑾峰彇璇ヤ汉鍛樹笅鎵�鏈夊湴鐐规墦鍗¤褰�")
@PostMapping("executeDetails")
- public Results executeDetails(@RequestBody RecordDetailsParam recordDetailsParam) throws ParseException {
- return recordService.executeDetails(recordDetailsParam);
+ public Results executeDetails(@RequestBody RecordDetailsExParam recordDetailsExParam) throws ParseException {
+ return recordService.executeDetails(recordDetailsExParam);
}
/**
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/RecordDetailsExParam.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/RecordDetailsExParam.java
new file mode 100644
index 0000000..3933c78
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/param/RecordDetailsExParam.java
@@ -0,0 +1,10 @@
+package com.ruoyi.app.patrolplan.domain.param;
+
+import lombok.Data;
+
+@Data
+public class RecordDetailsExParam {
+
+ private Boolean plan;
+ private String toDay;
+}
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 353bc25..5d81105 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
@@ -28,7 +28,8 @@
Results executeMonthOld(RecordMonthParam recordMonthParam) throws ParseException;
Results executeMonth(RecordMonthExParam recordMonthExParam) throws ParseException;
- Results executeDetails(RecordDetailsParam recordDetailsParam) throws ParseException;
+ Results executeDetailsOld(RecordDetailsParam recordDetailsParam) throws ParseException;
+ Results executeDetails(RecordDetailsExParam recordDetailsExParam) throws ParseException;
Results executeSolo(RecordSoloExParam recordSoloExParam);
}
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 9aae3b1..c777b05 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
@@ -448,7 +448,7 @@
}
@Override
- public Results executeDetails(RecordDetailsParam recordDetailsParam) throws ParseException {
+ public Results executeDetailsOld(RecordDetailsParam recordDetailsParam) throws ParseException {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String userId = SecurityUtils.getUserId();
@@ -650,4 +650,71 @@
}
return Results.succeed(jsonArray);
}
+
+ @Override
+ public Results executeDetails(RecordDetailsExParam recordDetailsExParam) throws ParseException {
+ String userId = SecurityUtils.getUserId();
+ //鑾峰彇鍙傛暟
+ Boolean plan = recordDetailsExParam.getPlan();
+ String toDay = recordDetailsExParam.getToDay();
+ JSONArray jsonArray = new JSONArray();
+ if(plan){
+ //鏌ヨ杩欎釜鐢ㄦ埛涓嬩负鎵ц浜虹殑鎵�鏈夊贰妫�璁″垝
+ ArdAppPatrolplan ardAppPatrolplan = new ArdAppPatrolplan();
+ ardAppPatrolplan.setUserId(SecurityUtils.getUserId());
+ List<ArdAppPatrolplan> list = patrolplanMapper.executeList(ardAppPatrolplan);
+ //鎵惧嚭浠婂ぉ鐨勫崟娆″拰姣忔棩璁″垝
+ List<ArdAppPatrolplan> patrolplanList = new ArrayList<>();
+ for (int i = 0; i < list.size(); i++) {
+ String cycle = list.get(i).getCycle();
+ //濡傛灉鏄崟娆′换鍔�
+ if(cycle.equals("once")){
+ String begin = list.get(i).getPatroBeginTime();
+ String b = begin.substring(0,10);
+ if(b.equals(toDay)){
+ //鏄粖澶╃殑璁″垝
+ patrolplanList.add(list.get(i));
+ }
+ }
+ //濡傛灉鏄瘡鏃ヤ换鍔�
+ else if(cycle.equals("day")){
+ String create = list.get(i).getCreateTime();
+ String c = create.substring(0,10);
+ if(c.compareTo(toDay)<=0){
+ //鏈変粖澶╃殑璁″垝
+ patrolplanList.add(list.get(i));
+ }
+ }
+ }
+ if(patrolplanList.size()>0){
+ //閬嶅巻浠婂ぉ鐨勮鍒�
+ for (int i = 0; i < patrolplanList.size(); i++) {
+ String planId = patrolplanList.get(i).getId();
+ String planName = patrolplanList.get(i).getPlanName();
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("planId",planId);
+ jsonObject.put("planName",planName);
+ //鏌ヨ杩欏ぉ鏈夊灏戠偣
+ List<ArdAlarmpointsWell> dayWells = wellMapper.wellByPlanId(planId);
+ int dayWellNum = dayWells.size();
+ //鏌ヨ杩欎釜鐢ㄦ埛鐨勮繖涓鍒掑湪浠婂ぉ鎵撳崱鐨勬潯鏁�
+ QueryWrapper<ArdAppPatrolpointRecord> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("user_id",userId).eq("plan_id",planId).like("record_time",toDay);
+ List<ArdAppPatrolpointRecord> recordList = ardAppPatrolpointRecordMapper.selectList(queryWrapper);
+ int recordNum = recordList.size();
+ //濡傛灉鐩哥瓑閭h繖鏉′粖澶╃殑璁″垝灏辨槸鍏ㄩ儴瀹屾垚浜�
+ if(recordNum==dayWellNum){
+ jsonObject.put("type",true);
+ }else {
+ jsonObject.put("type",false);
+ }
+ jsonArray.add(jsonObject);
+ }
+ }
+ }else {
+ //娌℃湁璁″垝
+ return Results.succeed("[]");
+ }
+ return Results.succeed(jsonArray);
+ }
}
--
Gitblit v1.9.3