From 99a76ca58268ea1258212ecfb814860d82870758 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期四, 21 九月 2023 10:28:52 +0800
Subject: [PATCH] 修改单兵端-新任务轮询 任务详情数量 改为任务数
---
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java | 61 ++++++++++++++++++++++++------
1 files changed, 49 insertions(+), 12 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..5ca3909 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();
@@ -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