Quellcode durchsuchen

修改删除逻辑

xiewenjie vor 4 Jahren
Ursprung
Commit
7362c5d060

+ 34 - 31
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/ManagerController.java

@@ -517,48 +517,51 @@ public class ManagerController extends BaseController {
 
         renovationPartsDetailService.updateById(renovationPartsDetailEntity);
         if ("I".equals(renovationPartsDetailEntity.getRecStatus())) {
+            renovationPartsDetailService.removeById(renovationPartsDetailEntity.getId());
             ModelUploadEntity modelUploadEntity = modelUploadService.findByPartsDetailId(renovationPartsDetailEntity.getId());
             if (modelUploadEntity != null) {
                 modelUploadService.removeById(modelUploadEntity.getId());
             }
-        }
+        }else {
+            RenovationPartsAttachingEntity renovationPartsAttachingEntity = renovationPartsAttachingService.findByDetailId(renovationPartsDetailEntity.getId());
+            if (renovationPartsAttachingEntity != null) {
+                if ("wall".equals(param.getAttachingType())) {
+                    renovationPartsAttachingEntity.setCeilAttaching(false);
+                    renovationPartsAttachingEntity.setWallAttaching(true);
+                    renovationPartsAttachingEntity.setFloorAttaching(false);
+                }
 
-        RenovationPartsAttachingEntity renovationPartsAttachingEntity = renovationPartsAttachingService.findByDetailId(renovationPartsDetailEntity.getId());
-        if (renovationPartsAttachingEntity != null) {
-            if ("wall".equals(param.getAttachingType())) {
-                renovationPartsAttachingEntity.setCeilAttaching(false);
-                renovationPartsAttachingEntity.setWallAttaching(true);
-                renovationPartsAttachingEntity.setFloorAttaching(false);
-            }
+                if ("ceil".equals(param.getAttachingType())) {
+                    renovationPartsAttachingEntity.setCeilAttaching(true);
+                    renovationPartsAttachingEntity.setWallAttaching(false);
+                    renovationPartsAttachingEntity.setFloorAttaching(false);
+                }
 
-            if ("ceil".equals(param.getAttachingType())) {
-                renovationPartsAttachingEntity.setCeilAttaching(true);
-                renovationPartsAttachingEntity.setWallAttaching(false);
-                renovationPartsAttachingEntity.setFloorAttaching(false);
+                if ("floor".equals(param.getAttachingType())) {
+                    renovationPartsAttachingEntity.setCeilAttaching(false);
+                    renovationPartsAttachingEntity.setWallAttaching(false);
+                    renovationPartsAttachingEntity.setFloorAttaching(true);
+                }
+                renovationPartsAttachingService.updateById(renovationPartsAttachingEntity);
             }
 
-            if ("floor".equals(param.getAttachingType())) {
-                renovationPartsAttachingEntity.setCeilAttaching(false);
-                renovationPartsAttachingEntity.setWallAttaching(false);
-                renovationPartsAttachingEntity.setFloorAttaching(true);
+            if (param.getX() != null && param.getY() != null && param.getZ() != null) {
+                ResponseRenovationPartsSize responseRenovationPartsSize = renovationPartsSizeService.findSizeByDetailId(renovationPartsDetailEntity.getId());
+                RenovationPartsSizeEntity renovationPartsSizeEntity = new RenovationPartsSizeEntity();
+                renovationPartsSizeEntity.setX(param.getX());
+                renovationPartsSizeEntity.setY(param.getY());
+                renovationPartsSizeEntity.setZ(param.getZ());
+                if (responseRenovationPartsSize != null) {
+                    renovationPartsSizeEntity.setId(responseRenovationPartsSize.getId());
+                    renovationPartsSizeService.updateById(renovationPartsSizeEntity);
+                } else {
+                    renovationPartsSizeEntity.setPartsDetailId(renovationPartsDetailEntity.getId());
+                    renovationPartsSizeService.save(renovationPartsSizeEntity);
+                }
             }
-            renovationPartsAttachingService.updateById(renovationPartsAttachingEntity);
         }
 
-        if (param.getX() != null && param.getY() != null && param.getZ() != null) {
-            ResponseRenovationPartsSize responseRenovationPartsSize = renovationPartsSizeService.findSizeByDetailId(renovationPartsDetailEntity.getId());
-            RenovationPartsSizeEntity renovationPartsSizeEntity = new RenovationPartsSizeEntity();
-            renovationPartsSizeEntity.setX(param.getX());
-            renovationPartsSizeEntity.setY(param.getY());
-            renovationPartsSizeEntity.setZ(param.getZ());
-            if (responseRenovationPartsSize != null) {
-                renovationPartsSizeEntity.setId(responseRenovationPartsSize.getId());
-                renovationPartsSizeService.updateById(renovationPartsSizeEntity);
-            } else {
-                renovationPartsSizeEntity.setPartsDetailId(renovationPartsDetailEntity.getId());
-                renovationPartsSizeService.save(renovationPartsSizeEntity);
-            }
-        }
+
 
         return Result.success();
     }