From e5146b61a9dd244fb9a2bb2eb019da58f682b36a Mon Sep 17 00:00:00 2001 From: lijiarao Date: Mon, 21 Aug 2023 14:45:44 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=8C=BA=E5=9F=9F=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=A1=A8-=20=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tag/controller/LawsAreaController.java | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/LawsAreaController.java b/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/LawsAreaController.java index faa33a78..8e255b8b 100644 --- a/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/LawsAreaController.java +++ b/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/LawsAreaController.java @@ -14,6 +14,8 @@ import com.jero.modules.tag.service.ILawsTagService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.annotations.Results; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; @@ -150,26 +152,26 @@ public class LawsAreaController extends JeroController delete(@RequestParam(name="id",required=true) String id, - @RequestParam(name="cut",required=true) String cut) { + public Result delete(@RequestBody Map map) { + if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ + return Result.error("请选择数据!"); + } + String id = map.get("id"); LawsArea lawsArea = lawsAreaService.queryById(id); int count= lawsTagService.queryExitArea(lawsArea); if (count > 0) { //中英切换提示语 // TODO 只改一半?编辑和新增改了,删除不改? - if(LanguageEnum.CN.getValue().equals(cut)) { + //if(LanguageEnum.CN.getValue().equals(cut)) { return Result.error("该展示区域有关联数据,无法删除!"); - }else{ - return Result.error("This exhibition area has associated data and cannot be deleted!"); - } + //}else{ + // return Result.error("This exhibition area has associated data and cannot be deleted!"); + //} }else { lawsAreaService.deleteById(id); return Result.OK("删除成功!"); @@ -179,15 +181,15 @@ public class LawsAreaController extends JeroController deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.lawsAreaService.deleteByIds(Arrays.asList(ids.split(","))); + public Result deleteBatch(@RequestBody Map map) { + if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){ + return Result.error("请选择数据!"); + } + this.lawsAreaService.deleteByIds(Arrays.asList(map.get("ids").split(","))); return Result.OK("批量删除成功!"); }