From b207529cad1d89f1ae780bc7f0f0e70b4a756209 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期四, 21 九月 2023 13:47:54 +0800
Subject: [PATCH] 单兵端巡检日历修改
---
ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecord.java | 12 ++++++
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java | 35 +++++++++++++----
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolpointRecordServiceImpl.java | 8 ++--
ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecordImg.java | 12 ++++++
4 files changed, 55 insertions(+), 12 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecord.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecord.java
index fe3164b..e0515d6 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecord.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecord.java
@@ -64,6 +64,18 @@
@TableField(exist = false)
private List<String> img;
+ /** 鍒犻櫎鏍囪 */
+ @Excel(name = "鍒犻櫎鏍囪")
+ private Integer del;
+
+ public Integer getDel() {
+ return del;
+ }
+
+ public void setDel(Integer del) {
+ this.del = del;
+ }
+
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecordImg.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecordImg.java
index f7dffc2..5bf55c2 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecordImg.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolpointRecordImg.java
@@ -26,6 +26,18 @@
@Excel(name = "宸℃鍥剧墖")
private String img;
+ /** 鍒犻櫎鏍囪 */
+ @Excel(name = "鍒犻櫎鏍囪")
+ private Integer del;
+
+ public Integer getDel() {
+ return del;
+ }
+
+ public void setDel(Integer del) {
+ this.del = del;
+ }
+
public void setId(String id)
{
this.id = id;
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java
index 55a739f..9c4f482 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java
@@ -14,12 +14,8 @@
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellVo;
import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper;
-import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpoint;
-import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpointRecord;
-import com.ruoyi.app.patrolplan.domain.ArdAppPatroluser;
-import com.ruoyi.app.patrolplan.mapper.ArdAppPatrolpointMapper;
-import com.ruoyi.app.patrolplan.mapper.ArdAppPatrolpointRecordMapper;
-import com.ruoyi.app.patrolplan.mapper.ArdAppPatroluserMapper;
+import com.ruoyi.app.patrolplan.domain.*;
+import com.ruoyi.app.patrolplan.mapper.*;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.SysUserVo;
import com.ruoyi.common.utils.DateUtils;
@@ -31,8 +27,6 @@
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import com.ruoyi.app.patrolplan.mapper.ArdAppPatrolplanMapper;
-import com.ruoyi.app.patrolplan.domain.ArdAppPatrolplan;
import com.ruoyi.app.patrolplan.service.IArdAppPatrolplanService;
import org.springframework.transaction.annotation.Transactional;
@@ -63,6 +57,9 @@
@Resource
private ArdAppPatrolpointRecordMapper recordMapper;
+
+ @Resource
+ private ArdAppPatrolpointRecordImgMapper recordImgMapper;
/**
* 鏌ヨapp宸℃璁″垝
@@ -294,6 +291,28 @@
if(result<1){
return Results.error("淇敼澶辫触锛屽師鏁版嵁鍋滅敤鍑洪敊锛�");
}
+ String planId = planList.getId();
+ QueryWrapper<ArdAppPatrolpointRecord> patrolpointRecordQueryWrapper = new QueryWrapper<>();
+ patrolpointRecordQueryWrapper.eq("plan_id",planId);
+ List<ArdAppPatrolpointRecord> records = recordMapper.selectList(patrolpointRecordQueryWrapper);
+ if(records.size()>0){
+ for (int i = 0; i < records.size(); i++) {
+ ArdAppPatrolpointRecord record = records.get(i);
+ record.setDel(1);
+ recordMapper.updateById(record);
+ String id = record.getId();
+ QueryWrapper<ArdAppPatrolpointRecordImg> recordImgQueryWrapper = new QueryWrapper<>();
+ recordImgQueryWrapper.eq("plan_id",planId);
+ List<ArdAppPatrolpointRecordImg> recordImgs = recordImgMapper.selectList(recordImgQueryWrapper);
+ if(recordImgs.size()>0){
+ for (int j = 0; j < recordImgs.size(); j++) {
+ ArdAppPatrolpointRecordImg recordImg = recordImgs.get(j);
+ recordImg.setDel(1);
+ recordImgMapper.updateById(recordImg);
+ }
+ }
+ }
+ }
int num = insertArdAppPatrolplan(para);
if(num==1){
return Results.succeed("淇敼鎴愬姛锛屽凡閲嶆柊閮ㄧ讲浠诲姟锛�");
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 5ca3909..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
@@ -661,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;
}
}
--
Gitblit v1.9.3