提交 c722653f 编写于 作者: sq3536's avatar sq3536

转移

上级 1d76608a
package cn.ibizlab.core.dict.extensions.vo;
import cn.ibizlab.util.annotation.DEField;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Catalog
{
private String code;
private String name;
@JSONField(name = "items")
@JsonProperty("items")
private List<Option> options = new ArrayList<>();
}
package cn.ibizlab.core.dict.extensions.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.List;
import java.util.Map;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class CodeItem
{
private String id;
private Object value;
private String label;
@JsonIgnore
@JSONField(serialize = false)
private List<CodeItem> children;
private String iconClass;
private String filter;
private Boolean disabled;
@JSONField(name = "pvalue")
@JsonProperty("pvalue")
private String parent;
private Map<String,Object> extension;
@JSONField(name = "text")
@JsonProperty("text")
public String getText()
{
return label;
}
}
package cn.ibizlab.core.dict.extensions.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class CodeList
{
@JSONField(name = "srfkey")
@JsonProperty("srfkey")
private String code;
private String name;
@JSONField(name = "emptytext")
@JsonProperty("emptytext")
public String getEmptytext()
{
return "";
}
@JSONField(name = "items")
@JsonProperty("items")
private List<CodeItem> options = new ArrayList<>();
}
package cn.ibizlab.core.dict.extensions.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.List;
import java.util.Map;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Option
{
private String id;
private Object value;
private String label;
private List<Option> children;
private String iconClass;
private String filter;
private Boolean disabled;
@JsonIgnore
@JSONField(serialize = false)
private String parent;
private Map<String,Object> extension;
}
...@@ -5,15 +5,15 @@ import cn.ibizlab.api.mapping.DictCatalogMapping; ...@@ -5,15 +5,15 @@ import cn.ibizlab.api.mapping.DictCatalogMapping;
import cn.ibizlab.core.dict.domain.DictCatalog; import cn.ibizlab.core.dict.domain.DictCatalog;
import cn.ibizlab.core.dict.domain.DictOption; import cn.ibizlab.core.dict.domain.DictOption;
import cn.ibizlab.core.dict.extensions.service.DictCoreService; import cn.ibizlab.core.dict.extensions.service.DictCoreService;
import cn.ibizlab.core.dict.extensions.vo.Catalog;
import cn.ibizlab.core.dict.extensions.vo.CodeItem;
import cn.ibizlab.core.dict.extensions.vo.CodeList;
import cn.ibizlab.core.dict.extensions.vo.Option;
import cn.ibizlab.core.dict.filter.DictCatalogSearchContext; import cn.ibizlab.core.dict.filter.DictCatalogSearchContext;
import cn.ibizlab.core.dict.filter.DictOptionSearchContext; import cn.ibizlab.core.dict.filter.DictOptionSearchContext;
import cn.ibizlab.core.dict.service.IDictCatalogService; import cn.ibizlab.core.dict.service.IDictCatalogService;
import cn.ibizlab.core.dict.service.IDictOptionService; import cn.ibizlab.core.dict.service.IDictOptionService;
import cn.ibizlab.util.annotation.VersionCheck; import cn.ibizlab.util.annotation.VersionCheck;
import cn.ibizlab.util.dict.Catalog;
import cn.ibizlab.util.dict.CodeItem;
import cn.ibizlab.util.dict.CodeList;
import cn.ibizlab.util.dict.Option;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -67,7 +67,7 @@ public class DictCoreResource { ...@@ -67,7 +67,7 @@ public class DictCoreResource {
} }
@RequestMapping(method = {RequestMethod.GET}, value = "/dictionarys/catalogs/{code}/options") @RequestMapping(method = {RequestMethod.GET}, value = "/dictionarys/catalogs/{code}/options")
public ResponseEntity<List<Option>> getOptions(@PathVariable("code") String code,DictOptionSearchContext context) { public ResponseEntity<List<Option>> getOptions(@PathVariable("code") String code, DictOptionSearchContext context) {
Catalog catalog = null; Catalog catalog = null;
if(context==null||StringUtils.isEmpty(context.getSelectCond().getSqlSegment())) if(context==null||StringUtils.isEmpty(context.getSelectCond().getSqlSegment()))
catalog = dictCoreService.getDictCatalog(code); catalog = dictCoreService.getDictCatalog(code);
...@@ -90,7 +90,7 @@ public class DictCoreResource { ...@@ -90,7 +90,7 @@ public class DictCoreResource {
@RequestMapping(method = {RequestMethod.GET}, value = "/dictionarys/codelist/{code}/items") @RequestMapping(method = {RequestMethod.GET}, value = "/dictionarys/codelist/{code}/items")
public ResponseEntity<List<CodeItem>> getCodeItems(@PathVariable("code") String code,DictOptionSearchContext context) { public ResponseEntity<List<CodeItem>> getCodeItems(@PathVariable("code") String code, DictOptionSearchContext context) {
CodeList catalog = null; CodeList catalog = null;
if(context==null||StringUtils.isEmpty(context.getSelectCond().getSqlSegment())) if(context==null||StringUtils.isEmpty(context.getSelectCond().getSqlSegment()))
catalog = dictCoreService.getCodeListCatalog(code); catalog = dictCoreService.getCodeListCatalog(code);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册