gushoubang 8 сар өмнө
parent
commit
982cdd56fa

+ 13 - 4
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/tdgy/TdgyController.java

@@ -64,6 +64,15 @@ public class TdgyController {
         return requestResult;
     }
 
+    /**
+     * 闲置土地列表
+     */
+    @PostMapping("/idleLandList")
+    public RequestResult idleLandList(@Valid @RequestBody IdleLandListVo idleLandListVo) {
+        RequestResult requestResult = tdgyService.idleLandList(idleLandListVo);
+        return requestResult;
+    }
+
     /**
      * 闲置土地处置
      */
@@ -74,11 +83,11 @@ public class TdgyController {
     }
 
     /**
-     * 闲置土地列表
+     * 获取闲置土地处置详情
      */
-    @PostMapping("/idleLandList")
-    public RequestResult idleLandList(@Valid @RequestBody IdleLandListVo idleLandListVo) {
-        RequestResult requestResult = tdgyService.idleLandList(idleLandListVo);
+    @GetMapping("/idleLandDisposal/{landId}")
+    public RequestResult getIdleLandDisposalDetail(@PathVariable String landId) {
+        RequestResult requestResult = tdgyService.getIdleLandDisposal(landId);
         return requestResult;
     }
 }

+ 34 - 22
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/tdgy/TdgyServiceImp.java

@@ -102,7 +102,6 @@ public class TdgyServiceImp implements TdgyService {
     @Override
     public RequestResult getTdgyDetail(Integer id) {
         // DozerBeanMapper mapper = new DozerBeanMapper();
-
         TdgySjDTO tdgySjDTO = tdgyMapper.selectById(id);
         if (tdgySjDTO == null) {
             return RequestResult.error("地块不存在");
@@ -159,6 +158,29 @@ public class TdgyServiceImp implements TdgyService {
         return RequestResult.success();
     }
 
+    /**
+     * 获取闲置土地
+     */
+    @Override
+    public RequestResult idleLandList(IdleLandListVo idleLandListVo) {
+        if (idleLandListVo.getPageSize() == null) {
+            idleLandListVo.setPageSize(20);
+        }
+        if (idleLandListVo.getPageNum() == null) {
+            idleLandListVo.setPageNum(1);
+        }
+
+        idleLandListVo.setLimit(idleLandListVo.getPageSize());
+        idleLandListVo.setOffset((idleLandListVo.getPageNum() - 1) * idleLandListVo.getPageSize());
+        List<Map> mapList = landIdleConfirmMapper.getIdleLandList(idleLandListVo);
+        Integer count = landIdleConfirmMapper.getIdleLandListCount(idleLandListVo);
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("list", mapList);
+        map.put("count", count);
+        return RequestResult.success(map);
+    }
+
     /**
      * 添加闲置土地处置
      *
@@ -182,33 +204,23 @@ public class TdgyServiceImp implements TdgyService {
         landIdleDisposalMapper.insert(landIdleDisposalDTO);
 
         // 根据landId更新表t_land_idle_confirm的is_disposal字段
-        LandIdleConfirmDTO landIdleConfirmDTO = landIdleConfirmMapper.selectById(landId);
-        landIdleConfirmDTO.setIsDisposal(true);
-        landIdleConfirmMapper.updateById(landIdleConfirmDTO);
+        if (landIdleDisposalDTO.getDisposalTime() != null) {
+            LandIdleConfirmDTO landIdleConfirmDTO = landIdleConfirmMapper.selectById(landId);
+            landIdleConfirmDTO.setIsDisposal(true);
+            landIdleConfirmMapper.updateById(landIdleConfirmDTO);
+        }
 
         return RequestResult.success();
     }
 
     /**
-     * 获取闲置土地
+     * 获取闲置土地处置详情
      */
     @Override
-    public RequestResult idleLandList(IdleLandListVo idleLandListVo) {
-        if (idleLandListVo.getPageSize() == null) {
-            idleLandListVo.setPageSize(20);
-        }
-        if (idleLandListVo.getPageNum() == null) {
-            idleLandListVo.setPageNum(1);
-        }
-
-        idleLandListVo.setLimit(idleLandListVo.getPageSize());
-        idleLandListVo.setOffset((idleLandListVo.getPageNum() - 1) * idleLandListVo.getPageSize());
-        List<Map> mapList = landIdleConfirmMapper.getIdleLandList(idleLandListVo);
-        Integer count = landIdleConfirmMapper.getIdleLandListCount(idleLandListVo);
-
-        Map<String, Object> map = new HashMap<>();
-        map.put("list", mapList);
-        map.put("count", count);
-        return RequestResult.success(map);
+    public RequestResult getIdleLandDisposal(String landId) {
+        // 根据landId查询处置信息
+        LandIdleDisposalDTO landIdleDisposalDTO = landIdleDisposalMapper
+                .selectOne(new UpdateWrapper<LandIdleDisposalDTO>().eq("land_id", landId));
+        return RequestResult.success(landIdleDisposalDTO);
     }
 }

+ 2 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/tdgy/TdgyService.java

@@ -18,4 +18,6 @@ public interface TdgyService {
     RequestResult addIdleLandDisposal(LandIdleDisposalVo landIdleDisposalVo);
 
     RequestResult idleLandList(IdleLandListVo idleLandListVo);
+
+    RequestResult getIdleLandDisposal(String landId);
 }