huangmp преди 4 години
родител
ревизия
a873b1f81e

+ 20 - 4
blade-service/community/src/main/java/org/springblade/community/controller/FloorController.java

@@ -25,12 +25,11 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
 import javax.validation.Valid;
 
+import org.springblade.community.dto.AgencyMngDelDTO;
 import org.springblade.community.entity.Building;
 import org.springblade.community.entity.Residential;
 import org.springblade.community.entity.Unit;
-import org.springblade.community.service.IBuildingService;
-import org.springblade.community.service.IResidentialService;
-import org.springblade.community.service.IUnitService;
+import org.springblade.community.service.*;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
@@ -38,13 +37,13 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.system.expand.feign.IOrgPositionClient;
 import org.springblade.system.expand.util.QueryWrapperUtil;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.community.entity.Floor;
 import org.springblade.community.vo.FloorVO;
 import org.springblade.community.wrapper.FloorWrapper;
-import org.springblade.community.service.IFloorService;
 import org.springblade.core.boot.ctrl.BladeController;
 
 import java.util.Map;
@@ -65,6 +64,7 @@ public class FloorController extends BladeController {
 	private final IUnitService unitService;
 	private final IResidentialService residentialService;
 	private final IBuildingService buildingService;
+	private final IRoomService roomService;
 
 	/**
 	 * 详情
@@ -171,5 +171,21 @@ public class FloorController extends BladeController {
 		return R.status(floorService.deleteLogic(Func.toLongList(ids)));
 	}
 
+	/**
+	 * 物理删除,及其所有子节点 楼层...房间
+	 */
+	@PostMapping("/removeAll")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	@Transactional(rollbackFor = Exception.class)
+	public R remove(@RequestParam Long id) {
+		AgencyMngDelDTO delDTO = new AgencyMngDelDTO();
+		delDTO.setFloorId(id);
+		//物理删除楼层
+		floorService.delete(delDTO);
+		//物理删除房间
+		roomService.delete(delDTO);
+		return R.status(true);
+	}
 
 }

+ 18 - 0
blade-service/community/src/main/java/org/springblade/community/controller/RoomController.java

@@ -25,6 +25,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
 import javax.validation.Valid;
 
+import org.springblade.community.dto.AgencyMngDelDTO;
 import org.springblade.community.entity.*;
 import org.springblade.community.service.*;
 import org.springblade.core.mp.support.Condition;
@@ -35,6 +36,7 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.SpringUtil;
 import org.springblade.system.expand.feign.IOrgPositionClient;
 import org.springblade.system.expand.util.QueryWrapperUtil;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -192,4 +194,20 @@ public class RoomController extends BladeController {
 	}
 
 
+	/**
+	 * 物理删除,及其所有子节点 楼层...房间
+	 */
+	@PostMapping("/removeAll")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	@Transactional(rollbackFor = Exception.class)
+	public R remove(@RequestParam Long id) {
+		AgencyMngDelDTO delDTO = new AgencyMngDelDTO();
+		delDTO.setRoomId(id);
+		//物理删除房间
+		roomService.delete(delDTO);
+		return R.status(true);
+	}
+
+
 }