Commit ed9bb0b2 authored by huyuchen's avatar huyuchen

huyc 字典相关接口修改

parent 852d1e2f
......@@ -16,6 +16,7 @@
package com.yifu.cloud.plus.v1.yifu.admin.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
......@@ -23,6 +24,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 字典表
*
......@@ -80,4 +83,11 @@ public class SysDict extends BaseEntity {
*/
@Schema(description = "联动上级类型")
private String parentItemType;
/**
* 上级字典名称
*/
@TableField(exist = false)
private String parentItemName;
}
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.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.SysDictService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
......@@ -62,7 +63,12 @@ public class DictController {
*/
@GetMapping("/{id:\\d+}")
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