From 2c9f941cfa5991092d2a3321f16151e1b5de31b2 Mon Sep 17 00:00:00 2001 From: hzj <826100833@qq.com> Date: Thu, 12 Sep 2024 10:41:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/njcn/system/api/EpdFeignClient.java | 3 ++- .../api/fallback/EpdFeignClientFallbackFactory.java | 6 ++++++ .../njcn/system/controller/EleEpdPqdController.java | 10 ++++++++++ .../com/njcn/system/service/IEleEpdPqdService.java | 1 + .../njcn/system/service/impl/EleEpdPqdServiceImpl.java | 5 +++++ 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/api/EpdFeignClient.java b/pqs-system/system-api/src/main/java/com/njcn/system/api/EpdFeignClient.java index b710285e4..64a2bddbd 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/api/EpdFeignClient.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/api/EpdFeignClient.java @@ -7,7 +7,6 @@ import com.njcn.system.pojo.dto.EpdDTO; import com.njcn.system.pojo.param.EleEpdPqdParam; import com.njcn.system.pojo.po.EleEpdPqd; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; @@ -58,4 +57,6 @@ public interface EpdFeignClient { @PostMapping("/findListByShowName") HttpResult> findListByShowName(@RequestParam("name") String name); + @PostMapping("/selectByClassId") + HttpResult> selectByClassId(@RequestParam("id") String classId); } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EpdFeignClientFallbackFactory.java b/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EpdFeignClientFallbackFactory.java index c3d7f688d..32ce45295 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EpdFeignClientFallbackFactory.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/api/fallback/EpdFeignClientFallbackFactory.java @@ -106,6 +106,12 @@ public class EpdFeignClientFallbackFactory implements FallbackFactory> selectByClassId(String classId) { + log.error("{}异常,降级处理,异常为:{}","根据数据分类查询字典信息集合",cause.toString()); + throw new BusinessException(finalExceptionEnum); + } }; } } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleEpdPqdController.java b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleEpdPqdController.java index afb9abfc6..17caa75c3 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleEpdPqdController.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EleEpdPqdController.java @@ -164,6 +164,16 @@ public class EleEpdPqdController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqds, methodDescribe); } + @PostMapping("/selectByClassId") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("根据数据分类查询字典数据") + public HttpResult> selectByClassId(@RequestParam("classId") @Validated String classId){ + String methodDescribe = getMethodDescribe("selectByClassId"); + LogUtil.njcnDebug(log, "{},根据数据分类查询字典数据:", methodDescribe); + List eleEpdPqds = eleEpdPqdService.selectByClassId(classId); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqds, methodDescribe); + } + @PostMapping("/judgeExist") @OperateInfo(info = LogEnum.BUSINESS_COMMON) @ApiOperation("校验字典是否存在") diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleEpdPqdService.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleEpdPqdService.java index 2bee4685c..a3fe71a14 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleEpdPqdService.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEleEpdPqdService.java @@ -114,4 +114,5 @@ public interface IEleEpdPqdService extends IService { */ List findAll(); + List selectByClassId(String classId); } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleEpdPqdServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleEpdPqdServiceImpl.java index 2a9f08fb6..cec32fb55 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleEpdPqdServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EleEpdPqdServiceImpl.java @@ -253,6 +253,11 @@ public class EleEpdPqdServiceImpl extends ServiceImpl selectByClassId(String classId) { + return this.lambdaQuery().eq(EleEpdPqd::getClassId,classId).list(); + } + /** * 校验参数, * 1.检查是否存在相同名称的菜单