微调
This commit is contained in:
@@ -86,7 +86,7 @@ public class DictTreeController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改")
|
@ApiOperation("修改字典树数据")
|
||||||
@ApiImplicitParam(name = "dicParam", value = "数据", required = true)
|
@ApiImplicitParam(name = "dicParam", value = "数据", required = true)
|
||||||
public HttpResult<Boolean> update(@RequestBody @Validated DictTreeParam.UpdateParam dicParam) {
|
public HttpResult<Boolean> update(@RequestBody @Validated DictTreeParam.UpdateParam dicParam) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
@@ -106,7 +106,7 @@ public class DictTreeController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除")
|
@ApiOperation("删除字典树数据")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true)
|
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||||
public HttpResult<Boolean> delete(@RequestParam @Validated String id) {
|
public HttpResult<Boolean> delete(@RequestParam @Validated String id) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
@@ -129,16 +129,6 @@ public class DictTreeController extends BaseController {
|
|||||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
|
||||||
// @GetMapping("/getByCode")
|
|
||||||
// @ApiOperation("根据Code查询字典")
|
|
||||||
// public HttpResult<DictTreeVO> getByCode(@RequestParam("code") String code) {
|
|
||||||
// String methodDescribe = getMethodDescribe("getByCode");
|
|
||||||
// LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, code);
|
|
||||||
// DictTreeVO result = dictTreeService.queryByCode(code);
|
|
||||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
// @GetMapping("/getByPid")
|
// @GetMapping("/getByPid")
|
||||||
// @ApiOperation("根据pid查询字典树")
|
// @ApiOperation("根据pid查询字典树")
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
|||||||
public List<DictTree> getTreeByName(String name) {
|
public List<DictTree> getTreeByName(String name) {
|
||||||
List<DictTree> dictTree = this.queryTree();
|
List<DictTree> dictTree = this.queryTree();
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(dictTree)) {
|
if (ObjectUtil.isNotEmpty(dictTree) && StrUtil.isNotBlank(name)) {
|
||||||
dictTree = dictTree.stream().filter(item -> item.getName().contains(name)).collect(Collectors.toList());
|
dictTree = dictTree.stream().filter(item -> item.getName().contains(name)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
return dictTree;
|
return dictTree;
|
||||||
@@ -69,7 +69,7 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public boolean addDictTree(DictTreeParam dictTreeParam) {
|
public boolean addDictTree(DictTreeParam dictTreeParam) {
|
||||||
//checkRepeat(dictTreeParam,false);
|
checkRepeat(dictTreeParam,false);
|
||||||
boolean result;
|
boolean result;
|
||||||
DictTree dictTree = new DictTree();
|
DictTree dictTree = new DictTree();
|
||||||
BeanUtils.copyProperties(dictTreeParam, dictTree);
|
BeanUtils.copyProperties(dictTreeParam, dictTree);
|
||||||
@@ -92,7 +92,7 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public boolean updateDictTree(DictTreeParam.UpdateParam param) {
|
public boolean updateDictTree(DictTreeParam.UpdateParam param) {
|
||||||
//checkRepeat(param,true);
|
checkRepeat(param,true);
|
||||||
boolean result;
|
boolean result;
|
||||||
DictTree dictTree = new DictTree();
|
DictTree dictTree = new DictTree();
|
||||||
BeanUtils.copyProperties(param, dictTree);
|
BeanUtils.copyProperties(param, dictTree);
|
||||||
@@ -194,7 +194,8 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
|||||||
// }
|
// }
|
||||||
private void checkRepeat(DictTreeParam dictTreeParam, boolean isExcludeSelf) {
|
private void checkRepeat(DictTreeParam dictTreeParam, boolean isExcludeSelf) {
|
||||||
LambdaQueryWrapper<DictTree> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<DictTree> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(DictTree::getCode, dictTreeParam.getCode())
|
wrapper.eq(DictTree::getPid, dictTreeParam.getPid()) // 同一父节点下不能有相同的code
|
||||||
|
.eq(DictTree::getCode, dictTreeParam.getCode())
|
||||||
.eq(DictTree::getState, DictConst.ENABLE);
|
.eq(DictTree::getState, DictConst.ENABLE);
|
||||||
if (isExcludeSelf) {
|
if (isExcludeSelf) {
|
||||||
if (dictTreeParam instanceof DictTreeParam.UpdateParam) {
|
if (dictTreeParam instanceof DictTreeParam.UpdateParam) {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public enum SystemResponseEnum {
|
|||||||
DELETE_DATA("A0303", "导入旧日志文件异常:删除数据失败"),
|
DELETE_DATA("A0303", "导入旧日志文件异常:删除数据失败"),
|
||||||
MULTIPLE_CLICKS_LOG_FILE_WRITER("A0304", "当前文件备份数据未结束,请勿多次点击"),
|
MULTIPLE_CLICKS_LOG_FILE_WRITER("A0304", "当前文件备份数据未结束,请勿多次点击"),
|
||||||
MULTIPLE_CLICKS_RECOVER_LOG_FILE("A0303", "当前文件恢复数据未结束,请勿多次点击"),
|
MULTIPLE_CLICKS_RECOVER_LOG_FILE("A0303", "当前文件恢复数据未结束,请勿多次点击"),
|
||||||
CODE_REPEAT("A0305","编码重复" );
|
CODE_REPEAT("A0305","该层级下已存在相同的编码" );
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user