소스 검색

数据中心

韩福成 1 년 전
부모
커밋
11fc913022
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      src/main/java/com/sooka/sponest/data/digitalforest/controller/CenterdataTForestGridLevelController.java

+ 11 - 0
src/main/java/com/sooka/sponest/data/digitalforest/controller/CenterdataTForestGridLevelController.java

@@ -6,9 +6,11 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.digitalforest.domain.CenterdataTForestAfforestation;
 import com.sooka.sponest.data.digitalforest.domain.CenterdataTForestGridLevel;
 import com.sooka.sponest.data.digitalforest.domain.CenterdataTForestLinleader;
 import com.sooka.sponest.data.digitalforest.domain.vo.CenterdataTForestGridLevelVo;
+import com.sooka.sponest.data.digitalforest.service.ICenterdataTForestAfforestationService;
 import com.sooka.sponest.data.digitalforest.service.ICenterdataTForestGridLevelService;
 import com.sooka.sponest.data.digitalforest.service.ICenterdataTForestLinleaderService;
 import com.sooka.sponest.data.utils.DataConstants;
@@ -39,6 +41,9 @@ public class CenterdataTForestGridLevelController extends BaseController {
     @Autowired
     private ICenterdataTForestLinleaderService iCenterdataTForestLinleaderService;
 
+    @Autowired
+    private ICenterdataTForestAfforestationService centerdataTForestAfforestationService;
+
     /**
      * 查询林业网格层级信息列表
      */
@@ -154,6 +159,12 @@ public class CenterdataTForestGridLevelController extends BaseController {
         if (!list.isEmpty()) {
             return AjaxResult.error("已有下级资源");
         }
+        CenterdataTForestAfforestation centerdataTForestAfforestation = new CenterdataTForestAfforestation();
+        centerdataTForestAfforestation.setForestFarmId(String.valueOf(id));
+        List<CenterdataTForestAfforestation> afforestationList = centerdataTForestAfforestationService.selectCenterdataTForestAfforestationList(centerdataTForestAfforestation);
+        if (!afforestationList.isEmpty()) {
+            return AjaxResult.error("已有下级资源");
+        }
         int result = centerdataTForestGridLevelService.deleteCenterdataTForestGridLevelById(id);
         return toAjax(result);
     }