diff --git a/system/src/main/java/com/njcn/gather/system/dictionary/controller/DictPqController.java b/system/src/main/java/com/njcn/gather/system/dictionary/controller/DictPqController.java index 8a50b324..2f58aeba 100644 --- a/system/src/main/java/com/njcn/gather/system/dictionary/controller/DictPqController.java +++ b/system/src/main/java/com/njcn/gather/system/dictionary/controller/DictPqController.java @@ -70,7 +70,7 @@ public class DictPqController extends BaseController { LogUtil.njcnDebug(log, "{},更新数据为:{}", methodDescribe, updateParam); boolean result = dictPqService.updateDictPq(updateParam); if (result) { - return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe); } else { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe); } diff --git a/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictDataParam.java b/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictDataParam.java index 02e57a7d..685e9d15 100644 --- a/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictDataParam.java +++ b/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictDataParam.java @@ -38,7 +38,7 @@ public class DictDataParam { @ApiModelProperty("排序") @NotNull(message = SystemValidMessage.SORT_NOT_NULL) - @Min(value = 0, message = SystemValidMessage.SORT_FORMAT_ERROR) + @Min(value = 1, message = SystemValidMessage.SORT_FORMAT_ERROR) @Max(value = 999, message = SystemValidMessage.SORT_FORMAT_ERROR) private Integer sort; diff --git a/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictPqParam.java b/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictPqParam.java index c0116c26..57b47b20 100644 --- a/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictPqParam.java +++ b/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictPqParam.java @@ -34,7 +34,7 @@ public class DictPqParam { @ApiModelProperty("排序") @NotNull(message = SystemValidMessage.SORT_NOT_NULL) - @Min(value = 0, message = SystemValidMessage.SORT_FORMAT_ERROR) + @Min(value = 1, message = SystemValidMessage.SORT_FORMAT_ERROR) @Max(value = 999, message = SystemValidMessage.SORT_FORMAT_ERROR) private Integer sort; diff --git a/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictTypeParam.java b/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictTypeParam.java index ff67b369..56895561 100644 --- a/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictTypeParam.java +++ b/system/src/main/java/com/njcn/gather/system/dictionary/pojo/param/DictTypeParam.java @@ -30,7 +30,7 @@ public class DictTypeParam { @ApiModelProperty("排序") @NotNull(message = SystemValidMessage.SORT_NOT_NULL) - @Min(value = 0, message = SystemValidMessage.SORT_FORMAT_ERROR) + @Min(value = 1, message = SystemValidMessage.SORT_FORMAT_ERROR) @Max(value = 999, message = SystemValidMessage.SORT_FORMAT_ERROR) private Integer sort; diff --git a/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTreeServiceImpl.java b/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTreeServiceImpl.java index 75a4d8f5..a807fb56 100644 --- a/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTreeServiceImpl.java +++ b/system/src/main/java/com/njcn/gather/system/dictionary/service/impl/DictTreeServiceImpl.java @@ -47,13 +47,9 @@ public class DictTreeServiceImpl extends ServiceImpl i BeanUtils.copyProperties(dictTreeParam, dictTree); if (!Objects.equals(dictTree.getPid(), DictConst.FATHER_ID)) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("id", dictTree.getPid()); DictTree instance = this.baseMapper.selectOne(queryWrapper); - - dictTree.setPids(instance.getPids() + StrPool.COMMA + instance.getId()); - } else { dictTree.setPids(DictConst.FATHER_ID); } @@ -92,9 +88,7 @@ public class DictTreeServiceImpl extends ServiceImpl i LambdaQueryWrapper query = new LambdaQueryWrapper<>(); query.eq(DictTree::getPid, pid).eq(DictTree::getState, DictConst.ENABLE).orderByDesc(DictTree::getSort); List resultList = this.list(query); - DictTree byId = this.getById(pid); - if (CollUtil.isNotEmpty(resultList)) { collect = resultList.stream().map(temp -> { DictTreeVO resultVO = new DictTreeVO(); @@ -112,13 +106,11 @@ public class DictTreeServiceImpl extends ServiceImpl i query.clear(); query.eq(DictTree::getCode, code).eq(DictTree::getState, DictConst.ENABLE); DictTree result = this.getOne(query); - if (result != null) { DictTreeVO resultVO = new DictTreeVO(); BeanUtils.copyProperties(result, resultVO); return resultVO; } - return null; } diff --git a/system/src/main/java/com/njcn/gather/system/pojo/constant/SystemValidMessage.java b/system/src/main/java/com/njcn/gather/system/pojo/constant/SystemValidMessage.java index ae85a3d1..1f10ff44 100644 --- a/system/src/main/java/com/njcn/gather/system/pojo/constant/SystemValidMessage.java +++ b/system/src/main/java/com/njcn/gather/system/pojo/constant/SystemValidMessage.java @@ -33,7 +33,7 @@ public interface SystemValidMessage { String SORT_NOT_NULL = "排序不能为空,请检查sort参数"; - String SORT_FORMAT_ERROR = "排序格式错误,请检查sort参数"; + String SORT_FORMAT_ERROR = "排序范围在1至999,请检查sort参数"; String OPEN_LEVEL_NOT_NULL = "开启等级不能为空,请检查openLevel参数";