From b81f154077218a32c0d133a43a55823665acfdb7 Mon Sep 17 00:00:00 2001 From: yangfuda <945208611@qq.com> Date: Tue, 23 Sep 2025 08:58:10 +0800 Subject: [PATCH] =?UTF-8?q?BUG=2024491=E3=80=90=E5=9C=B0=E5=9D=97=E7=BB=8F?= =?UTF-8?q?=E8=90=A5=E3=80=91=E2=80=94=E2=80=94=201.=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=E4=B8=8E=E5=BD=95=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E4=B8=8D=E7=AC=A6=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TResourceOperationController.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/resource/TResourceOperationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/resource/TResourceOperationController.java index 74d892a..5caf933 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/resource/TResourceOperationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/resource/TResourceOperationController.java @@ -192,7 +192,16 @@ public class TResourceOperationController extends BaseController if(dept.getOrgCode().length() < 12){ return error("非村、组级行政区划,不允许添加地块!"); } - + TResourceLand land = tResourceLandService.selectTResourceLandByDkbm(tResourceOperation.getDkbm()); + if(land != null){ + tResourceOperation.setDkmc(land.getDkmc()); + tResourceOperation.setDkdz(land.getDkdz()); + tResourceOperation.setDkxz(land.getDkxz()); + tResourceOperation.setDknz(land.getDknz()); + tResourceOperation.setDkbz(land.getDkbz()); + }else{ + return error("地块代码无法查询到地块!"); + } tResourceOperation.setImportCode(dept.getImportCode()); return toAjax(tResourceOperationService.insertTResourceOperation(tResourceOperation)); } @@ -205,7 +214,16 @@ public class TResourceOperationController extends BaseController @PostMapping("/update") public AjaxResult edit(@RequestBody TResourceOperation tResourceOperation) { - + TResourceLand land = tResourceLandService.selectTResourceLandByDkbm(tResourceOperation.getDkbm()); + if(land != null){ + tResourceOperation.setDkmc(land.getDkmc()); + tResourceOperation.setDkdz(land.getDkdz()); + tResourceOperation.setDkxz(land.getDkxz()); + tResourceOperation.setDknz(land.getDknz()); + tResourceOperation.setDkbz(land.getDkbz()); + }else{ + return error("地块代码无法查询到地块!"); + } return toAjax(tResourceOperationService.updateTResourceOperation(tResourceOperation)); }