实体字段微调
This commit is contained in:
@@ -70,7 +70,7 @@ public class DictPqController extends BaseController {
|
|||||||
LogUtil.njcnDebug(log, "{},更新数据为:{}", methodDescribe, updateParam);
|
LogUtil.njcnDebug(log, "{},更新数据为:{}", methodDescribe, updateParam);
|
||||||
boolean result = dictPqService.updateDictPq(updateParam);
|
boolean result = dictPqService.updateDictPq(updateParam);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class DictDataParam {
|
|||||||
|
|
||||||
@ApiModelProperty("排序")
|
@ApiModelProperty("排序")
|
||||||
@NotNull(message = SystemValidMessage.SORT_NOT_NULL)
|
@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)
|
@Max(value = 999, message = SystemValidMessage.SORT_FORMAT_ERROR)
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class DictPqParam {
|
|||||||
|
|
||||||
@ApiModelProperty("排序")
|
@ApiModelProperty("排序")
|
||||||
@NotNull(message = SystemValidMessage.SORT_NOT_NULL)
|
@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)
|
@Max(value = 999, message = SystemValidMessage.SORT_FORMAT_ERROR)
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class DictTypeParam {
|
|||||||
|
|
||||||
@ApiModelProperty("排序")
|
@ApiModelProperty("排序")
|
||||||
@NotNull(message = SystemValidMessage.SORT_NOT_NULL)
|
@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)
|
@Max(value = 999, message = SystemValidMessage.SORT_FORMAT_ERROR)
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
|||||||
@@ -47,13 +47,9 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
|||||||
BeanUtils.copyProperties(dictTreeParam, dictTree);
|
BeanUtils.copyProperties(dictTreeParam, dictTree);
|
||||||
if (!Objects.equals(dictTree.getPid(), DictConst.FATHER_ID)) {
|
if (!Objects.equals(dictTree.getPid(), DictConst.FATHER_ID)) {
|
||||||
QueryWrapper<DictTree> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<DictTree> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
queryWrapper.eq("id", dictTree.getPid());
|
queryWrapper.eq("id", dictTree.getPid());
|
||||||
DictTree instance = this.baseMapper.selectOne(queryWrapper);
|
DictTree instance = this.baseMapper.selectOne(queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
dictTree.setPids(instance.getPids() + StrPool.COMMA + instance.getId());
|
dictTree.setPids(instance.getPids() + StrPool.COMMA + instance.getId());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dictTree.setPids(DictConst.FATHER_ID);
|
dictTree.setPids(DictConst.FATHER_ID);
|
||||||
}
|
}
|
||||||
@@ -92,9 +88,7 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
|||||||
LambdaQueryWrapper<DictTree> query = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<DictTree> query = new LambdaQueryWrapper<>();
|
||||||
query.eq(DictTree::getPid, pid).eq(DictTree::getState, DictConst.ENABLE).orderByDesc(DictTree::getSort);
|
query.eq(DictTree::getPid, pid).eq(DictTree::getState, DictConst.ENABLE).orderByDesc(DictTree::getSort);
|
||||||
List<DictTree> resultList = this.list(query);
|
List<DictTree> resultList = this.list(query);
|
||||||
|
|
||||||
DictTree byId = this.getById(pid);
|
DictTree byId = this.getById(pid);
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(resultList)) {
|
if (CollUtil.isNotEmpty(resultList)) {
|
||||||
collect = resultList.stream().map(temp -> {
|
collect = resultList.stream().map(temp -> {
|
||||||
DictTreeVO resultVO = new DictTreeVO();
|
DictTreeVO resultVO = new DictTreeVO();
|
||||||
@@ -112,13 +106,11 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
|||||||
query.clear();
|
query.clear();
|
||||||
query.eq(DictTree::getCode, code).eq(DictTree::getState, DictConst.ENABLE);
|
query.eq(DictTree::getCode, code).eq(DictTree::getState, DictConst.ENABLE);
|
||||||
DictTree result = this.getOne(query);
|
DictTree result = this.getOne(query);
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
DictTreeVO resultVO = new DictTreeVO();
|
DictTreeVO resultVO = new DictTreeVO();
|
||||||
BeanUtils.copyProperties(result, resultVO);
|
BeanUtils.copyProperties(result, resultVO);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public interface SystemValidMessage {
|
|||||||
|
|
||||||
String SORT_NOT_NULL = "排序不能为空,请检查sort参数";
|
String SORT_NOT_NULL = "排序不能为空,请检查sort参数";
|
||||||
|
|
||||||
String SORT_FORMAT_ERROR = "排序格式错误,请检查sort参数";
|
String SORT_FORMAT_ERROR = "排序范围在1至999,请检查sort参数";
|
||||||
|
|
||||||
String OPEN_LEVEL_NOT_NULL = "开启等级不能为空,请检查openLevel参数";
|
String OPEN_LEVEL_NOT_NULL = "开启等级不能为空,请检查openLevel参数";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user