From c4f5d1b543cfba611e05e55651d8b0419210d274 Mon Sep 17 00:00:00 2001 From: xy <748613696@qq.com> Date: Mon, 22 Jun 2026 13:45:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor(dict):=20=E9=87=8D=E6=9E=84=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E7=B1=BB=E5=9E=8B=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 queryDictType 方法的 lineId 参数从 String 类型改为 Integer 类型 - 更新接口定义中的参数类型声明 - 修改控制器层方法签名以匹配新的参数类型 - 调整业务逻辑中对参数的处理方式,从字符串末尾字符判断改为整数比较 - 移除不再需要的 SysDicTreePOMapper 导入 - 更新 API 文档注解中的参数描述信息 --- .../com/njcn/system/controller/DictTreeController.java | 7 +++---- .../java/com/njcn/system/service/SysDicTreePOService.java | 2 +- .../njcn/system/service/impl/SysDicTreePOServiceImpl.java | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/DictTreeController.java b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/DictTreeController.java index f5539eed9..858d4b236 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/DictTreeController.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/DictTreeController.java @@ -9,7 +9,6 @@ import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.LogUtil; -import com.njcn.system.mapper.SysDicTreePOMapper; import com.njcn.system.pojo.param.DictTreeParam; import com.njcn.system.pojo.po.SysDicTreePO; import com.njcn.system.pojo.vo.DictTreeVO; @@ -190,15 +189,15 @@ public class DictTreeController extends BaseController { @GetMapping("/queryDictType") @ApiOperation("获取指标类型") @ApiImplicitParams ({ - @ApiImplicitParam(name = "lineId", value = "监测点id", required = true), + @ApiImplicitParam(name = "lineType", value = "0:治理监测点 1:电能质量监测点", required = true), @ApiImplicitParam(name = "conType", value = "接线方式", required = true) }) - public HttpResult> queryDictType(@RequestParam @Validated String lineId, @RequestParam(required = false) @Validated Integer conType) { + public HttpResult> queryDictType(@RequestParam @Validated Integer lineType, @RequestParam(required = false) @Validated Integer conType) { String methodDescribe = getMethodDescribe("queryDictType"); if (conType == null) { throw new BusinessException("监测点缺失接线方式"); } - List result = sysDicTreePOService.queryDictType(lineId,conType); + List result = sysDicTreePOService.queryDictType(lineType,conType); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/SysDicTreePOService.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/SysDicTreePOService.java index a39165ada..e36383927 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/SysDicTreePOService.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/SysDicTreePOService.java @@ -71,5 +71,5 @@ public interface SysDicTreePOService extends IService { */ List queryByCodeList(String code); - List queryDictType(String lineId, Integer conType); + List queryDictType(Integer lineType, Integer conType); } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/SysDicTreePOServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/SysDicTreePOServiceImpl.java index 5c92a6958..bce25e680 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/SysDicTreePOServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/SysDicTreePOServiceImpl.java @@ -190,15 +190,14 @@ public class SysDicTreePOServiceImpl extends ServiceImpl queryDictType(String lineId, Integer conType) { + public List queryDictType(Integer lineType, Integer conType) { DictTreeVO vo = queryByCode("Statistical_Type"); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(SysDicTreePO::getPid,vo.getId()) .eq(SysDicTreePO::getStatus,0) .orderByAsc(SysDicTreePO::getSort); - char lastChar = lineId.charAt(lineId.length() - 1); //治理APF指标 - if (Objects.equals(lastChar,'0')) { + if (Objects.equals(lineType,0)) { queryWrapper.eq(SysDicTreePO::getType,3); } //通用指标