jihs 4 năm trước cách đây
mục cha
commit
73abc3185f

+ 41 - 3
src/main/java/org/jeecg/modules/archives/service/impl/ProjectManageArchivesServiceImpl.java

@@ -32,6 +32,7 @@ import org.springframework.util.CollectionUtils;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 import java.util.stream.Collectors;
 
  /** 
@@ -117,11 +118,30 @@ public class ProjectManageArchivesServiceImpl extends ServiceImpl<ProjectManageA
     public boolean deleteById(ProjectManageArchives projectManageArchives) {
         updateById(projectManageArchives);
         //逻辑删除 相关子表
-        deleteArchivesAndBusiness(projectManageArchives.getId());
+        deleteArchivesChildren(projectManageArchives.getId());
         return true;
     }
 
+     /**
+      * @desc 逻辑删除 相关子表
+      */
+     private void deleteArchivesChildren(String id) {
+         //删除项目档案--里程碑信息表
+         QueryWrapper<ProjectManageArchivesAndBusiness> businessQueryWrapper = new QueryWrapper<>();
+         businessQueryWrapper.eq("del_flag", 0).eq("pro_archives_id", id);
+         List<ProjectManageArchivesAndBusiness> businessList = projectManageArchivesAndBusinessService.list(businessQueryWrapper);
+         if(!CollectionUtils.isEmpty(businessList)){
+            projectManageArchivesAndBusinessService.deleteBatch(businessList);
+         }
+         //删除项目档案--计划表
+         QueryWrapper<ProjectManageBusinessOther> archivesAndBusinessQueryWrapper = new QueryWrapper<>();
+         archivesAndBusinessQueryWrapper.eq("del_flag", 0).eq("pro_archives_id", id);
+         List<ProjectManageBusinessOther>  businessOtherList = projectManageBusinessOtherService.list(archivesAndBusinessQueryWrapper);
 
+         if(!CollectionUtils.isEmpty(businessOtherList)){
+            projectManageBusinessOtherService.deleteBatch(businessOtherList);
+         }
+     }
 
      /**
      * @desc 设置里程碑数据
@@ -217,14 +237,32 @@ public class ProjectManageArchivesServiceImpl extends ServiceImpl<ProjectManageA
         businessQueryWrapper.eq("del_flag", 0).eq("pro_archives_id", id);
         List<ProjectManageArchivesAndBusiness> businessList = projectManageArchivesAndBusinessService.list(businessQueryWrapper);
         if(!CollectionUtils.isEmpty(businessList)){
-            projectManageArchivesAndBusinessService.deleteBatch(businessList);
+            for(ProjectManageArchivesAndBusiness business : businessList){
+                QueryWrapper<ProjectManageArchivesAndBusiness> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("id", business.getId());
+                business.setId(UUID.randomUUID().toString());
+                business.setDelFlag("1");
+                projectManageArchivesAndBusinessService.update(business, queryWrapper);
+            }
+            //(作废)
+//            projectManageArchivesAndBusinessService.deleteBatch(businessList);
         }
         //删除项目档案--计划表
         QueryWrapper<ProjectManageBusinessOther> archivesAndBusinessQueryWrapper = new QueryWrapper<>();
         archivesAndBusinessQueryWrapper.eq("del_flag", 0).eq("pro_archives_id", id);
         List<ProjectManageBusinessOther>  businessOtherList = projectManageBusinessOtherService.list(archivesAndBusinessQueryWrapper);
+
         if(!CollectionUtils.isEmpty(businessOtherList)){
-            projectManageBusinessOtherService.deleteBatch(businessOtherList);
+            for(ProjectManageBusinessOther other : businessOtherList) {
+                QueryWrapper<ProjectManageBusinessOther> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("id", other.getId());
+                other.setId(UUID.randomUUID().toString());
+                other.setDelFlag("1");
+                projectManageBusinessOtherService.update(other, queryWrapper);
+            }
+
+            //(作废)
+//            projectManageBusinessOtherService.deleteBatch(businessOtherList);
         }
     }
 

+ 0 - 2
src/main/java/org/jeecg/modules/payment/controller/ManagerPaymentAndReceiptSlipController.java

@@ -2,7 +2,6 @@ package org.jeecg.modules.payment.controller;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -32,7 +31,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
-
 import java.util.List;
 
 /**