From 1ee87a2e96058e49b7013fe6e2a42a07845c8f9a Mon Sep 17 00:00:00 2001 From: lijiarao Date: Wed, 31 Jan 2024 19:50:02 +0800 Subject: [PATCH] =?UTF-8?q?fix=2081462=20=E3=80=90=E5=9E=82=E7=9B=B4?= =?UTF-8?q?=E8=B6=8A=E6=9D=83=E3=80=91=E4=B8=93=E9=A1=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=BA=93=E6=9C=AA=E5=81=9A=E5=9E=82=E7=9B=B4=E8=B6=8A=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LawsSpecialProjectLibraryController.java | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/projectLibrary/controller/LawsSpecialProjectLibraryController.java b/laws-modules/src/main/java/com/jero/modules/projectLibrary/controller/LawsSpecialProjectLibraryController.java index c7bf7339..6cb3bc51 100644 --- a/laws-modules/src/main/java/com/jero/modules/projectLibrary/controller/LawsSpecialProjectLibraryController.java +++ b/laws-modules/src/main/java/com/jero/modules/projectLibrary/controller/LawsSpecialProjectLibraryController.java @@ -5,11 +5,13 @@ import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import com.jero.common.api.vo.Result; +import com.jero.common.api.vo.ResultCommon; import com.jero.modules.projectLibrary.entity.LawsSpecialProjectLibrary; import com.baomidou.mybatisplus.core.metadata.IPage; import com.jero.modules.projectLibrary.service.ILawsSpecialProjectLibraryService; import lombok.extern.slf4j.Slf4j; import com.jero.common.system.base.controller.JeroController; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -44,6 +46,7 @@ public class LawsSpecialProjectLibraryController extends JeroController add(@Validated @RequestBody LawsSpecialProjectLibrary lawsSpecialProjectLibrary) { - lawsSpecialProjectLibraryService.add(lawsSpecialProjectLibrary); - return Result.OK("操作成功!"); - } /** * 编辑 @@ -90,12 +81,13 @@ public class LawsSpecialProjectLibraryController extends JeroController edit(@Validated @RequestBody LawsSpecialProjectLibrary lawsSpecialProjectLibrary) { lawsSpecialProjectLibraryService.editById(lawsSpecialProjectLibrary); - return Result.OK("操作成功!"); + return Result.OK(ResultCommon.EDIT_OK); } /** @@ -104,16 +96,16 @@ public class LawsSpecialProjectLibraryController extends JeroController delete(@RequestBody Map map) { - if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ - return Result.error("请选择数据!"); - } - lawsSpecialProjectLibraryService.deleteById(map.get("id")); - return Result.OK("删除成功!"); - } + //@AutoLog(value = "专项项目库-通过id删除") + //@ApiOperation(value="专项项目库-通过id删除", notes="专项项目库-通过id删除") + //@PostMapping(value = "/delete") + //public Result delete(@RequestBody Map map) { + // if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ + // return Result.error("请选择数据!"); + // } + // lawsSpecialProjectLibraryService.deleteById(map.get("id")); + // return Result.OK("删除成功!"); + //} /** * 批量删除 @@ -121,15 +113,16 @@ public class LawsSpecialProjectLibraryController extends JeroController deleteBatch(@RequestBody Map map) { if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){ - return Result.error("请选择数据!"); + return Result.error(ResultCommon.PLEASE_SELECT_DATA); } this.lawsSpecialProjectLibraryService.deleteByIds(Arrays.asList(map.get("ids").split(","))); - return Result.OK("批量删除成功!"); + return Result.OK(ResultCommon.SUCCESSFULLY_DELETED_IN_BULK); } /** @@ -138,16 +131,16 @@ public class LawsSpecialProjectLibraryController extends JeroController queryById(@RequestParam(name="id",required=true) String id) { - LawsSpecialProjectLibrary lawsSpecialProjectLibrary = lawsSpecialProjectLibraryService.queryById(id); - if(lawsSpecialProjectLibrary==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(lawsSpecialProjectLibrary); - } + //@AutoLog(value = "专项项目库-通过id查询") + //@ApiOperation(value="专项项目库-通过id查询", notes="专项项目库-通过id查询") + //@GetMapping(value = "/queryById") + //public Result queryById(@RequestParam(name="id",required=true) String id) { + // LawsSpecialProjectLibrary lawsSpecialProjectLibrary = lawsSpecialProjectLibraryService.queryById(id); + // if(lawsSpecialProjectLibrary==null) { + // return Result.error(ResultCommon.NO_CORRESPONDING_DATA_FOUND); + // } + // return Result.OK(lawsSpecialProjectLibrary); + //} /** * 导出excel @@ -155,6 +148,9 @@ public class LawsSpecialProjectLibraryController extends JeroController