|
@@ -4,8 +4,10 @@ import java.util.List;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
+import com.ruoyi.zdsz.service.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.constraints.*;
|
|
|
|
|
@@ -24,7 +26,6 @@ import com.ruoyi.common.enums.BusinessType;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.zdsz.domain.vo.ZAreaVo;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZAreaBo;
|
|
|
-import com.ruoyi.zdsz.service.IZAreaService;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
|
/**
|
|
@@ -40,7 +41,12 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
public class ZAreaController extends BaseController {
|
|
|
|
|
|
private final IZAreaService iZAreaService;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private IZBuildingService buildingService;
|
|
|
+ @Resource
|
|
|
+ private IZEngineeringCivilService civilService;
|
|
|
+ @Resource
|
|
|
+ private IZEngineeringMaterialsResetsService materialsResetsService;
|
|
|
/**
|
|
|
* 小区下拉
|
|
|
*
|
|
@@ -113,7 +119,20 @@ public class ZAreaController extends BaseController {
|
|
|
@SaCheckPermission("zdsz:area:remove")
|
|
|
@Log(title = "小区管理", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
|
- public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) {
|
|
|
+ public R remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) {
|
|
|
+ //是否需要校验
|
|
|
+ int i = buildingService.getBuildingListByAreaId(Arrays.asList(ids));
|
|
|
+ if (i>0){
|
|
|
+ return R.fail("小区已关联楼栋不能删除!");
|
|
|
+ }
|
|
|
+ int j = civilService.getCivilByAreaId(Arrays.asList(ids));
|
|
|
+ if (j>0){
|
|
|
+ return R.fail("小区已关联民用工程不能删除!");
|
|
|
+ }
|
|
|
+ int k = materialsResetsService.getMaterialByAreaId(Arrays.asList(ids));
|
|
|
+ if (k>0){
|
|
|
+ return R.fail("小区已关联用料统计不能删除!");
|
|
|
+ }
|
|
|
return toAjax(iZAreaService.deleteWithValidByIds(Arrays.asList(ids), true));
|
|
|
}
|
|
|
}
|