refactor(dict): 重构字典类型查询方法参数类型

- 将 queryDictType 方法的 lineId 参数从 String 类型改为 Integer 类型
- 更新接口定义中的参数类型声明
- 修改控制器层方法签名以匹配新的参数类型
- 调整业务逻辑中对参数的处理方式,从字符串末尾字符判断改为整数比较
- 移除不再需要的 SysDicTreePOMapper 导入
- 更新 API 文档注解中的参数描述信息
This commit is contained in:
xy
2026-06-22 13:45:54 +08:00
parent 6451cfeb88
commit c4f5d1b543
3 changed files with 6 additions and 8 deletions

View File

@@ -9,7 +9,6 @@ import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil; import com.njcn.common.utils.LogUtil;
import com.njcn.system.mapper.SysDicTreePOMapper;
import com.njcn.system.pojo.param.DictTreeParam; import com.njcn.system.pojo.param.DictTreeParam;
import com.njcn.system.pojo.po.SysDicTreePO; import com.njcn.system.pojo.po.SysDicTreePO;
import com.njcn.system.pojo.vo.DictTreeVO; import com.njcn.system.pojo.vo.DictTreeVO;
@@ -190,15 +189,15 @@ public class DictTreeController extends BaseController {
@GetMapping("/queryDictType") @GetMapping("/queryDictType")
@ApiOperation("获取指标类型") @ApiOperation("获取指标类型")
@ApiImplicitParams ({ @ApiImplicitParams ({
@ApiImplicitParam(name = "lineId", value = "监测点id", required = true), @ApiImplicitParam(name = "lineType", value = "0:治理监测点 1:电能质量监测点", required = true),
@ApiImplicitParam(name = "conType", value = "接线方式", required = true) @ApiImplicitParam(name = "conType", value = "接线方式", required = true)
}) })
public HttpResult<List<SysDicTreePO>> queryDictType(@RequestParam @Validated String lineId, @RequestParam(required = false) @Validated Integer conType) { public HttpResult<List<SysDicTreePO>> queryDictType(@RequestParam @Validated Integer lineType, @RequestParam(required = false) @Validated Integer conType) {
String methodDescribe = getMethodDescribe("queryDictType"); String methodDescribe = getMethodDescribe("queryDictType");
if (conType == null) { if (conType == null) {
throw new BusinessException("监测点缺失接线方式"); throw new BusinessException("监测点缺失接线方式");
} }
List<SysDicTreePO> result = sysDicTreePOService.queryDictType(lineId,conType); List<SysDicTreePO> result = sysDicTreePOService.queryDictType(lineType,conType);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
} }

View File

@@ -71,5 +71,5 @@ public interface SysDicTreePOService extends IService<SysDicTreePO> {
*/ */
List<SysDicTreePO> queryByCodeList(String code); List<SysDicTreePO> queryByCodeList(String code);
List<SysDicTreePO> queryDictType(String lineId, Integer conType); List<SysDicTreePO> queryDictType(Integer lineType, Integer conType);
} }

View File

@@ -190,15 +190,14 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
} }
@Override @Override
public List<SysDicTreePO> queryDictType(String lineId, Integer conType) { public List<SysDicTreePO> queryDictType(Integer lineType, Integer conType) {
DictTreeVO vo = queryByCode("Statistical_Type"); DictTreeVO vo = queryByCode("Statistical_Type");
LambdaQueryWrapper<SysDicTreePO> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysDicTreePO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysDicTreePO::getPid,vo.getId()) queryWrapper.eq(SysDicTreePO::getPid,vo.getId())
.eq(SysDicTreePO::getStatus,0) .eq(SysDicTreePO::getStatus,0)
.orderByAsc(SysDicTreePO::getSort); .orderByAsc(SysDicTreePO::getSort);
char lastChar = lineId.charAt(lineId.length() - 1);
//治理APF指标 //治理APF指标
if (Objects.equals(lastChar,'0')) { if (Objects.equals(lineType,0)) {
queryWrapper.eq(SysDicTreePO::getType,3); queryWrapper.eq(SysDicTreePO::getType,3);
} }
//通用指标 //通用指标