Commit e0dbda54 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 0a753235 ed9bb0b2
...@@ -32,12 +32,12 @@ public enum DictTypeEnum { ...@@ -32,12 +32,12 @@ public enum DictTypeEnum {
/** /**
* 字典类型-系统内置(不可修改) * 字典类型-系统内置(不可修改)
*/ */
SYSTEM("1", "系统内置"), SYSTEM("0", "系统内置"),
/** /**
* 字典类型-业务类型 * 字典类型-业务类型
*/ */
BIZ("0", "业务类"); BIZ("1", "业务类");
/** /**
* 类型 * 类型
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.yifu.cloud.plus.v1.yifu.admin.api.entity; package com.yifu.cloud.plus.v1.yifu.admin.api.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
...@@ -23,6 +24,8 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -23,6 +24,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.List;
/** /**
* 字典表 * 字典表
* *
...@@ -80,4 +83,11 @@ public class SysDict extends BaseEntity { ...@@ -80,4 +83,11 @@ public class SysDict extends BaseEntity {
*/ */
@Schema(description = "联动上级类型") @Schema(description = "联动上级类型")
private String parentItemType; private String parentItemType;
/**
* 上级字典名称
*/
@TableField(exist = false)
private String parentItemName;
} }
...@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...@@ -62,7 +63,12 @@ public class DictController { ...@@ -62,7 +63,12 @@ public class DictController {
*/ */
@GetMapping("/{id:\\d+}") @GetMapping("/{id:\\d+}")
public R<SysDict> getById(@PathVariable Long id) { public R<SysDict> getById(@PathVariable Long id) {
return R.ok(sysDictService.getById(id)); SysDict sysDict = sysDictService.getById(id);
SysDict sysDict1 = sysDictService.getOne(Wrappers.<SysDict>query().lambda().eq(SysDict::getType, sysDict.getParentItemType()));
if (null != sysDict1) {
sysDict.setParentItemName(sysDict1.getDescription());
}
return R.ok(sysDict);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment