From b495b133520e49f583a3e03f880d528e13d77117 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期六, 19 八月 2023 14:11:12 +0800
Subject: [PATCH] 巡检管理端日历
---
ard-work/src/main/java/com/ruoyi/app/patrolplan/mapper/ArdAppPatrolpointRecordMapper.java | 4 ++++
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java | 29 +++++++++++++++++++++--------
ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml | 12 ++++++++----
3 files changed, 33 insertions(+), 12 deletions(-)
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 b0bb88c..7f637b8 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
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpointRecord;
import com.ruoyi.app.patrolplan.domain.param.ArdAppPatrolpointRecordParam;
+import com.ruoyi.app.patrolplan.domain.param.RecordDetailsParam;
/**
* app宸℃璁″垝璁板綍Mapper鎺ュ彛
@@ -61,4 +62,7 @@
*/
public int deleteArdAppPatrolpointRecordByIds(String[] ids);
+ List<ArdAppPatrolpointRecord> es(RecordDetailsParam recordDetailsParam);
+ List<ArdAppPatrolpointRecord> lt(RecordDetailsParam recordDetailsParam);
+
}
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 1923dba..dba8f20 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
@@ -137,14 +137,16 @@
}
}else if(cycle.equals("once")){
String onceBegin = ardAppPatrolplan.getPatroBeginTime();
-// Date onceBeginDate = dateFormat.parse(onceBegin);
- String onceEnd = ardAppPatrolplan.getPatroEndTime();
-// Date onceEndDate = dateFormat.parse(onceEnd);
- int bd = ymd.compareTo(onceBegin);
- int ed = ymd.compareTo(onceEnd);
- if(bd>=0 && ed<=0){
+ String onceT = onceBegin.substring(0,10);
+ int num = ymd.compareTo(onceT);
+ 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;
@@ -187,7 +189,7 @@
@Override
public Results recordDetails(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 planId = recordDetailsParam.getPlanId();
String toDay = recordDetailsParam.getToDay();
@@ -238,10 +240,21 @@
//灏忎簬0鏄巻鍙�
recordQueryWrapper.select("max(points_num) pointsNum","user_id","user_name").eq("plan_id", planId).like("record_time", toDay).groupBy("user_id","user_name");
}else{
+ String u = dateFormatTime.format(new Date());
//绛変簬0閫変腑鐨勬棩鏈熷氨鏄粖澶╋紝闇�瑕佽繘涓�姝ュ垽鏂皬浜庡綋鍓嶆椂鍒嗙鐨勮褰�
- recordQueryWrapper.select("max(points_num) pointsNum","user_id","user_name").eq("plan_id", planId).le("record_time", dateFormatTime.format(new Date())).groupBy("user_id","user_name");;
+ 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++) {
diff --git a/ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml b/ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml
index 2255b0e..9812a3b 100644
--- a/ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml
+++ b/ard-work/src/main/resources/mapper/app/ArdAppPatrolpointRecordMapper.xml
@@ -92,9 +92,13 @@
</foreach>
</delete>
-<!-- <select id="maxNum">-->
-<!-- select user_id,user_name,max(points_num) pointsNum from ard_app_patrolpoint_record GROUP BY user_id,user_name-->
-<!-- </select>-->
+ <select id="es" parameterType="RecordDetailsParam" resultMap="ArdAppPatrolpointRecordResult">
+ SELECT max(points_num) pointsNum,user_id,user_name FROM ard_app_patrolpoint_record
+ WHERE plan_id = #{planId} AND record_time <= #{toDay} GROUP BY user_id,user_name
+ </select>
-
+ <select id="lt" parameterType="RecordDetailsParam" resultMap="ArdAppPatrolpointRecordResult">
+ SELECT max(points_num) pointsNum,user_id,user_name FROM ard_app_patrolpoint_record
+ WHERE plan_id = #{planId} AND record_time like #{toDay} GROUP BY user_id,user_name
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3