|
@@ -4,12 +4,14 @@ import java.util.List;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
+import com.ruoyi.zdsz.service.IZUnitService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.constraints.*;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
@@ -41,6 +43,9 @@ public class ZBuildingController extends BaseController {
|
|
|
|
|
|
private final IZBuildingService iZBuildingService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IZUnitService unitService;
|
|
|
+
|
|
|
/**
|
|
|
* 楼宇下拉
|
|
|
*
|
|
@@ -113,6 +118,11 @@ public class ZBuildingController extends BaseController {
|
|
|
@Log(title = "楼栋管理", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) {
|
|
|
+ //是否需要校验
|
|
|
+ int i = unitService.getListByUnitId(Arrays.asList(ids));
|
|
|
+ if (i>0){
|
|
|
+ return R.fail("楼栋已关联单元不能删除!");
|
|
|
+ }
|
|
|
return toAjax(iZBuildingService.deleteWithValidByIds(Arrays.asList(ids), true));
|
|
|
}
|
|
|
}
|