From a6cf52adb35541aaae7d84c06d3bde4e881f45f5 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期六, 19 八月 2023 14:39:31 +0800
Subject: [PATCH] 巡检日历
---
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java | 81 ++++++++++++++++++----------------------
1 files changed, 37 insertions(+), 44 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 dba8f20..ce84672 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
@@ -113,7 +113,6 @@
monthZero = String.valueOf(month);
}
JSONArray jsonArray = new JSONArray();
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (int i = 1; i <= day; i++) {
String di;
if(i<10){
@@ -125,13 +124,12 @@
Boolean planBoolean = false;
//寰幆姣忎竴澶�
String ymd = year+"-"+monthZero+"-"+di;
-// Date ymdDate = dateFormat.parse(ymd);
//鍖归厤璁″垝鏃堕棿
String cycle = ardAppPatrolplan.getCycle();
if(cycle.equals("day")){
String createTime = ardAppPatrolplan.getCreateTime();
-// Date beginCreateDate = dateFormat.parse(createTime);
- int d = ymd.compareTo(createTime);
+ String st = createTime.substring(0,10);
+ int d = ymd.compareTo(st);
if(d>=0){
planBoolean = true;
}
@@ -142,41 +140,46 @@
if(num==0){
planBoolean = true;
}
-// Date onceBeginDate = dateFormat.parse(onceBegin);
-// String onceEnd = ardAppPatrolplan.getPatroEndTime();
-// Date onceEndDate = dateFormat.parse(onceEnd);
-// int bd = ymd.compareTo(onceBegin);
-// int ed = ymd.compareTo(onceEnd);
}
//鍖归厤鎵撳崱鏃堕棿
Boolean or = false;
if(planBoolean){
- for (int j = 0; j < list.size(); j++) {
- //鎵撳崱鏃堕棿鎷嗗垎
- String recordTime = list.get(j).getRecordTime();
- String[] part = recordTime.split("[-\\s:]");
- int recordYear = Integer.parseInt(part[0]);
- int recordMonth = Integer.parseInt(part[1]);
- String recordMonthZero;
- if(recordMonth<10){
- recordMonthZero = String.format("%02d", recordMonth);
- }else {
- recordMonthZero = String.valueOf(recordMonth);
- }
- int recordDay = Integer.parseInt(part[2]);
- String recordDayZero;
- if(recordDay<10){
- recordDayZero = String.format("%02d", recordDay);
- }else {
- recordDayZero = String.valueOf(recordDay);
- }
- String recordDate = recordYear+"-"+recordMonthZero+"-"+recordDayZero;
- //濡傛灉鐩哥瓑璇存槑杩欏ぉ鏈夋墦鍗¤褰曡褰�
- if(ymd.equals(recordDate)){
- or = true;
- break;
- }
+ //鏌ヨ璇ヨ鍒掔殑鎵�鏈夊叴瓒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 recordTime = list.get(j).getRecordTime();
+// String[] part = recordTime.split("[-\\s:]");
+// int recordYear = Integer.parseInt(part[0]);
+// int recordMonth = Integer.parseInt(part[1]);
+// String recordMonthZero;
+// if(recordMonth<10){
+// recordMonthZero = String.format("%02d", recordMonth);
+// }else {
+// recordMonthZero = String.valueOf(recordMonth);
+// }
+// int recordDay = Integer.parseInt(part[2]);
+// String recordDayZero;
+// if(recordDay<10){
+// recordDayZero = String.format("%02d", recordDay);
+// }else {
+// recordDayZero = String.valueOf(recordDay);
+// }
+// String recordDate = recordYear+"-"+recordMonthZero+"-"+recordDayZero;
+// //濡傛灉鐩哥瓑璇存槑杩欏ぉ鏈夋墦鍗¤褰曡褰�
+// if(ymd.equals(recordDate)){
+// or = true;
+// break;
+// }
+// }
}
jsonObject.put("toDay",ymd );
jsonObject.put("plan",planBoolean);
@@ -245,16 +248,6 @@
recordQueryWrapper.select("max(points_num) pointsNum","user_id","user_name").eq("plan_id", planId).le("record_time", u).groupBy("user_id","user_name");
}
List<ArdAppPatrolpointRecord> list = ardAppPatrolpointRecordMapper.selectList(recordQueryWrapper);
-// List<ArdAppPatrolpointRecord> list = new ArrayList<>();
-// RecordDetailsParam detailsParam = new RecordDetailsParam();
-// detailsParam.setPlanId(planId);
-// if(d<0){
-// detailsParam.setToDay(toDay);
-// list = ardAppPatrolpointRecordMapper.lt(detailsParam);
-// }else {
-// detailsParam.setToDay(dateFormatTime.format(new Date()));
-// list = ardAppPatrolpointRecordMapper.es(detailsParam);
-// }
//閫変腑杩欏ぉ璇ヨ鍒掍笅娌℃湁浠讳綍鎵撳崱璁板綍
if(list.size()==0){
for (int i = 0; i < users.size(); i++) {
--
Gitblit v1.9.3