实体字段微调
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -47,13 +47,9 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
BeanUtils.copyProperties(dictTreeParam, dictTree);
|
||||
if (!Objects.equals(dictTree.getPid(), DictConst.FATHER_ID)) {
|
||||
QueryWrapper<DictTree> 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<DictTreeMapper, DictTree> i
|
||||
LambdaQueryWrapper<DictTree> query = new LambdaQueryWrapper<>();
|
||||
query.eq(DictTree::getPid, pid).eq(DictTree::getState, DictConst.ENABLE).orderByDesc(DictTree::getSort);
|
||||
List<DictTree> 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<DictTreeMapper, DictTree> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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参数";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user