From 8a8a13eb80498e9b905b47b8dc4d52cd8fdb8497 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期二, 24 十月 2023 16:36:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java | 69 ++++++++++++++++++++++++++--------
1 files changed, 53 insertions(+), 16 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 ce84672..b04585d 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
@@ -2,6 +2,8 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -144,15 +146,23 @@
//鍖归厤鎵撳崱鏃堕棿
Boolean or = false;
if(planBoolean){
- //鏌ヨ璇ヨ鍒掔殑鎵�鏈夊叴瓒g偣
- List<ArdAlarmpointsWell> wellList = wellMapper.wellByPlanId(planId);
- //鏌ヨ璇ヨ鍒掔殑鎵�鏈夋墽琛屼汉
- List<SysUser> userList = sysUserMapper.userByPlanId(planId);
- //婊″嫟澶氬皯鏉℃墦鍗¤褰�
- int maxNum = wellList.size()*userList.size();
- //瀵规瘮搴旀墦鍗¤褰曠浉绛夊垯true
- if(list.size()==maxNum){
- or = true;
+ for (int j = 0; j < list.size(); j++) {
+ //鑾峰彇鎵撳崱鏃堕棿
+ String toDayRecord = list.get(j).getRecordTime();
+ String dr = toDayRecord.substring(0,10);
+ //濡傛灉鎵撳紑鏃ユ湡鍜岃繖澶╃浉鍚�
+ if(ymd.equals(dr)){
+ //鏌ヨ璇ヨ鍒掔殑鎵�鏈夊叴瓒g偣
+ List<ArdAlarmpointsWell> wellList = wellMapper.wellByPlanId(planId);
+ //鏌ヨ璇ヨ鍒掔殑鎵�鏈夋墽琛屼汉
+ List<SysUser> userList = sysUserMapper.userByPlanId(planId);
+ //婊″嫟澶氬皯鏉℃墦鍗¤褰�
+ int maxNum = wellList.size()*userList.size();
+ //瀵规瘮搴旀墦鍗¤褰曠浉绛夊垯true
+ if(list.size()==maxNum){
+ or = true;
+ }
+ }
}
// for (int j = 0; j < list.size(); j++) {
// //鎵撳崱鏃堕棿鎷嗗垎
@@ -469,7 +479,7 @@
@Override
public Results executeDetailsOld(RecordDetailsParam recordDetailsParam) throws ParseException {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String userId = SecurityUtils.getUserId();
//鑾峰彇鍙傛暟
String planId = recordDetailsParam.getPlanId();
@@ -651,14 +661,14 @@
int planNum = dayNum+onceNum;
//杩欏ぉ鎬诲叴瓒g偣鏁�
int wellNum = dayWell+onceWell;
- QueryWrapper<ArdAppPatrolpointRecord> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("user_id",userId).like("record_time",ymd);
- List<ArdAppPatrolpointRecord> list = ardAppPatrolpointRecordMapper.selectList(queryWrapper);
//宸叉墦鍗℃�绘潯鏁�
+ QueryWrapper<ArdAppPatrolpointRecord> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("user_id",userId).like("record_time",ymd).isNull("del");
+ List<ArdAppPatrolpointRecord> list = ardAppPatrolpointRecordMapper.selectList(queryWrapper);
int num = list.size();
//搴旀墦鍗℃�绘潯鏁�
int record = planNum*wellNum;
- if(num==record){
+ if(num>=record){
recordBoolean = true;
}
}
@@ -779,7 +789,34 @@
@Override
public Results son() {
-
- return null;
+ DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+ //鑾峰彇鐢ㄦ埛鎵ц浜�
+ String userId = SecurityUtils.getUserId();
+ // 鍑忓皯 10 绉�
+ LocalDateTime now = LocalDateTime.now(); // 鑾峰彇褰撳墠鏃ユ湡鏃堕棿
+ LocalDateTime earlier = now.minusSeconds(10); // 鍑忓皯30绉�
+ RecordSonParam recordSonParam = new RecordSonParam();
+ recordSonParam.setUserId(userId);
+ String n = fmt.format(now);
+ recordSonParam.setTime(n);
+ String e = fmt.format(earlier);
+ recordSonParam.setBeforeTime(e);
+ //鏍规嵁濮撳悕ID涓烘墽琛屼汉鑾峰彇鎵�鏈夊搴旂殑璁″垝鍚嶇О
+ List<ArdAppPatrolplan> list = patrolplanMapper.planUser(recordSonParam);
+ JSONArray jsonArray = new JSONArray();
+ JSONObject jsonObject = new JSONObject();
+ if(list.size()>0){
+ jsonObject.put("plan",true);
+ jsonObject.put("user",list.get(0).getNickName());
+ jsonObject.put("name",list.get(0).getPlanName());
+// list.get(0).setSon("宸查�氱煡");
+// patrolplanMapper.updateById(list.get(0));
+ }else {
+ jsonObject.put("plan",false);
+ jsonObject.put("user",null);
+ jsonObject.put("name",null);
+ }
+ jsonArray.add(jsonObject);
+ return Results.succeed(jsonArray);
}
}
--
Gitblit v1.9.3