|
|
@@ -49,7 +49,15 @@ public class SysDictApiController {
|
|
|
if (StrUtil.isBlank(sysDict.getCode())) {
|
|
|
return Result.error("参数错误,字典编码不能为空");
|
|
|
}
|
|
|
- SysDictEntity entity = sysDictService.getOne(new LambdaQueryWrapper<SysDictEntity>().eq(SysDictEntity::getCode,sysDict.getCode()));
|
|
|
+ LambdaQueryWrapper<SysDictEntity> codeWrapper = new LambdaQueryWrapper<SysDictEntity>()
|
|
|
+ .eq(SysDictEntity::getCode, sysDict.getCode())
|
|
|
+ .eq(SysDictEntity::getIsDelete, 0);
|
|
|
+ if (Objects.nonNull(sysDict.getAppId())) {
|
|
|
+ codeWrapper.eq(SysDictEntity::getAppId, sysDict.getAppId());
|
|
|
+ } else {
|
|
|
+ codeWrapper.isNull(SysDictEntity::getAppId);
|
|
|
+ }
|
|
|
+ SysDictEntity entity = sysDictService.getOne(codeWrapper);
|
|
|
if (Objects.nonNull(entity)) {
|
|
|
if (Objects.isNull(sysDict.getDictId())) {
|
|
|
return Result.error("字典"+sysDict.getCode()+"已被占用,请修改编码!");
|
|
|
@@ -93,6 +101,9 @@ public class SysDictApiController {
|
|
|
if (Objects.nonNull(dto.getDictType())) {
|
|
|
queryWrapper.eq(SysDictEntity::getDictType, dto.getDictType());
|
|
|
}
|
|
|
+ if (Objects.nonNull(dto.getAppId())) {
|
|
|
+ queryWrapper.eq(SysDictEntity::getAppId, dto.getAppId());
|
|
|
+ }
|
|
|
queryWrapper.like(SysDictEntity::getIsDelete, Integer.valueOf(0));
|
|
|
IPage<SysDictEntity> vos = sysDictService.page(page,queryWrapper);
|
|
|
return Result.result(vos);
|