From c1c0f451a834865aab8f20c6fd334ea6d90abe0a Mon Sep 17 00:00:00 2001 From: fl <3098731433@qq.com> Date: Mon, 14 Apr 2025 10:33:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=BB=E5=BA=93=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backstage/dao/SynthesisQueryDao.java | 2 +- .../service/SynthesisQueryService.java | 2 +- .../impl/SynthesisQueryServiceImpl.java | 4 ++-- .../impl/QualityInspectionServiceImpl.java | 6 ++--- .../impl/SafetyViolationServiceImpl.java | 22 ++----------------- .../backstage/SynthesisQueryMapper.xml | 3 ++- 6 files changed, 11 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java b/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java index 0eac842..7148ed0 100644 --- a/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java +++ b/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java @@ -81,7 +81,7 @@ public interface SynthesisQueryDao { */ List getProClassifyStatisticsList(QueryParamDto dto); - void deleteComprehensiveQuery(Long id); + void deleteComprehensiveQuery(@Param("id") Long id,@Param("uploadType")String uploadType); /** * 项目分类统计-查看图片 diff --git a/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java b/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java index 04c691b..318760f 100644 --- a/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java +++ b/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java @@ -81,7 +81,7 @@ public interface SynthesisQueryService { * 综合查询删除 * @param id */ - void deleteComprehensiveQuery(Long id); + void deleteComprehensiveQuery(Long id,String uploadType); /** * 项目分类统计-查看图片 diff --git a/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java b/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java index f27dc83..40d8e33 100644 --- a/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java +++ b/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java @@ -134,8 +134,8 @@ public class SynthesisQueryServiceImpl implements SynthesisQueryService { } @Override - public void deleteComprehensiveQuery(Long id) { - synthesisQueryDao.deleteComprehensiveQuery(id); + public void deleteComprehensiveQuery(Long id,String uploadType) { + synthesisQueryDao.deleteComprehensiveQuery(id,uploadType); } public String generateWatermarkData(SynthesisQueryVo vo){ diff --git a/src/main/java/com/bonus/imgTool/imgUpload/service/impl/QualityInspectionServiceImpl.java b/src/main/java/com/bonus/imgTool/imgUpload/service/impl/QualityInspectionServiceImpl.java index 225bf9d..0f4ef3f 100644 --- a/src/main/java/com/bonus/imgTool/imgUpload/service/impl/QualityInspectionServiceImpl.java +++ b/src/main/java/com/bonus/imgTool/imgUpload/service/impl/QualityInspectionServiceImpl.java @@ -95,6 +95,7 @@ public class QualityInspectionServiceImpl implements QualityInspectionService { } @Override + @Transactional public ServerResponse updateQualityInspectionById(SafetyViolationDto bean) { LoginUser loginUser = UserUtil.getLoginUser(); bean.setUpdateUserId(loginUser.getId()); @@ -116,7 +117,6 @@ public class QualityInspectionServiceImpl implements QualityInspectionService { if (delFileList != null && !delFileList.isEmpty()) { int j = safetyViolationDao.delImgPhoto(bean.getDelFileList()); } - //总库修改 TODO ComprehensiveQueryVo comprehensiveQueryVo = new ComprehensiveQueryVo(); BeanUtils.copyProperties(bean,comprehensiveQueryVo); synthesisQueryService.updateComprehensiveQuery(comprehensiveQueryVo); @@ -139,8 +139,8 @@ public class QualityInspectionServiceImpl implements QualityInspectionService { file.setSourceId(bean.getId()); file.setUploadType("2"); int j = safetyViolationDao.delImgPhotoBySourceId(file); - //总库删除 TODO - + //总库删除 + synthesisQueryService.deleteComprehensiveQuery(bean.getId(),bean.getUploadType()); return ServerResponse.createSuccess("删除成功",num); }else{ return ServerResponse.createErroe("删除失败"); diff --git a/src/main/java/com/bonus/imgTool/imgUpload/service/impl/SafetyViolationServiceImpl.java b/src/main/java/com/bonus/imgTool/imgUpload/service/impl/SafetyViolationServiceImpl.java index 4d8ff2e..94b4259 100644 --- a/src/main/java/com/bonus/imgTool/imgUpload/service/impl/SafetyViolationServiceImpl.java +++ b/src/main/java/com/bonus/imgTool/imgUpload/service/impl/SafetyViolationServiceImpl.java @@ -54,18 +54,9 @@ public class SafetyViolationServiceImpl implements SafetyViolationService { bean.setCreateUserId(loginUser.getId()); bean.setCreateUserName(loginUser.getUsername()); List fileList = bean.getFileList(); -// //判断是否有整改照片,有则为已整改 -// if (fileList != null && !fileList.isEmpty()) { -// fileList.forEach(item -> { -// if("2".equals(item.getSourceType()){ -// bean.setRectStatus("1"); -// } -// }); -// } //基础数据存入库 int i = dao.insertSafetyViolation(bean); if (i > 0) { - //照片入库 if (fileList != null && !fileList.isEmpty()) { fileList.forEach(item -> { @@ -75,7 +66,6 @@ public class SafetyViolationServiceImpl implements SafetyViolationService { }); int j = dao.insertImgPhoto(bean.getFileList()); } - //存入总库 TODO ComprehensiveQueryVo comprehensiveQueryVo = new ComprehensiveQueryVo(); BeanUtils.copyProperties(bean,comprehensiveQueryVo); synthesisQueryService.addComprehensiveQuery(comprehensiveQueryVo); @@ -109,7 +99,6 @@ public class SafetyViolationServiceImpl implements SafetyViolationService { if (num > 0) { List fileList = bean.getFileList(); List delFileList = bean.getDelFileList(); - //照片入库 if (fileList != null && !fileList.isEmpty()) { fileList.forEach(item -> { @@ -121,20 +110,13 @@ public class SafetyViolationServiceImpl implements SafetyViolationService { } //照片删除 if (delFileList != null && !delFileList.isEmpty()) { -// delFileList.forEach(item -> { -// item.setSourceId(bean.getId()); -// item.setCreateUser(bean.getUpdateUserId()); -// item.setCreateUserName(bean.getUpdateUserName()); -// }); int j = dao.delImgPhoto(bean.getDelFileList()); } - //总库修改 TODO ComprehensiveQueryVo comprehensiveQueryVo = new ComprehensiveQueryVo(); BeanUtils.copyProperties(bean,comprehensiveQueryVo); synthesisQueryService.updateComprehensiveQuery(comprehensiveQueryVo); return ServerResponse.createSuccess("修改成功"); } else { - return ServerResponse.createErroe("修改失败"); } } @@ -151,8 +133,8 @@ public class SafetyViolationServiceImpl implements SafetyViolationService { file.setSourceId(bean.getId()); file.setUploadType("1"); int j = dao.delImgPhotoBySourceId(file); - //总库删除 TODO - + //总库删除 + synthesisQueryService.deleteComprehensiveQuery(bean.getId(),bean.getUploadType()); return ServerResponse.createSuccess("删除成功",num); }else{ return ServerResponse.createErroe("删除失败"); diff --git a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml index 00fef63..f4916a6 100644 --- a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml +++ b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml @@ -81,9 +81,10 @@ #{tempFilePath}, + update tb_comprehensive_query set is_active ='0' - where id = #{id} + where id = #{id} and upload_type = #{uploadType}