zhaops %!s(int64=4) %!d(string=hai) anos
pai
achega
921761065b

+ 183 - 0
src/main/java/com/diagbot/entity/KlDictionaryInfo.java

@@ -0,0 +1,183 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.util.Date;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 字典表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-02-25
+ */
+public class KlDictionaryInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 分组(值自定义)
+     */
+    private Long groupType;
+
+    /**
+     * 内容
+     */
+    private String name;
+
+    /**
+     * 值
+     */
+    private String val;
+
+    /**
+     * 返回类型(0: 都返回,1:后台维护返回 2:界面返回)
+     */
+    private Integer returnType;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public Long getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(Long groupType) {
+        this.groupType = groupType;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getVal() {
+        return val;
+    }
+
+    public void setVal(String val) {
+        this.val = val;
+    }
+    public Integer getReturnType() {
+        return returnType;
+    }
+
+    public void setReturnType(Integer returnType) {
+        this.returnType = returnType;
+    }
+    public Integer getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(Integer orderNo) {
+        this.orderNo = orderNo;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "KlDictionaryInfo{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", groupType=" + groupType +
+            ", name=" + name +
+            ", val=" + val +
+            ", returnType=" + returnType +
+            ", orderNo=" + orderNo +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 3 - 3
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -56,7 +56,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
     @Autowired
     private KlConceptDetailFacade klConceptDetailFacade;
     @Autowired
-    private DictionaryFacade dictionaryFacade;
+    private KlDictionaryInfoFacade klDictionaryInfoFacade;
 
     @Autowired
     @Qualifier("klConceptDetailServiceImpl")
@@ -205,7 +205,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         Integer type = convertType(klConceptStaticPageVO.getType(), 1);
         klConceptStaticPageVO.setType(type);
 
-        List<DictionaryInfoDTO> dicTypeName = dictionaryFacade.getListByGroupType(13);
+        List<DictionaryInfoDTO> dicTypeName = klDictionaryInfoFacade.getListByGroupType(13);
         Map<String, String> dicTypeNameMap
                 = EntityUtil.makeMapWithKeyValue(dicTypeName, "val", "name");
 
@@ -335,7 +335,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
     public KlConceptStaticDTO getRecordById(IdVO idVO) {
         KlConceptStaticDTO klConceptStaticDTO = new KlConceptStaticDTO();
 
-        List<DictionaryInfoDTO> dicTypeName = dictionaryFacade.getListByGroupType(13);
+        List<DictionaryInfoDTO> dicTypeName = klDictionaryInfoFacade.getListByGroupType(13);
         Map<String, String> dicTypeNameMap
                 = EntityUtil.makeMapWithKeyValue(dicTypeName, "val", "name");
 

+ 66 - 0
src/main/java/com/diagbot/facade/KlDictionaryInfoFacade.java

@@ -0,0 +1,66 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.entity.KlDictionaryInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.KlDictionaryInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/25 16:48
+ */
+@Component
+public class KlDictionaryInfoFacade extends KlDictionaryInfoServiceImpl {
+    /**
+     * 返回字典信息
+     *
+     * @return
+     */
+    public Map<Long, List<DictionaryInfoDTO>> getList() {
+        List<KlDictionaryInfo> list = this.list(new QueryWrapper<KlDictionaryInfo>()
+                .in("return_type", ListUtil.arrayToList(new Long[] { 0L, 2L }))
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .orderByAsc("group_type", "order_no"));
+        List<DictionaryInfoDTO> listRes = BeanUtil.listCopyTo(list, DictionaryInfoDTO.class);
+        return EntityUtil.makeEntityListMap(listRes, "groupType");
+    }
+
+    /**
+     * 返回字典信息
+     *
+     * @return
+     */
+    public Map<Long, List<DictionaryInfoDTO>> getListBack() {
+        List<KlDictionaryInfo> list = this.list(new QueryWrapper<KlDictionaryInfo>()
+                .in("return_type", ListUtil.arrayToList(new Long[] { 0L, 1L }))
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .orderByAsc("group_type", "order_no"));
+        List<DictionaryInfoDTO> listRes = BeanUtil.listCopyTo(list, DictionaryInfoDTO.class);
+        return EntityUtil.makeEntityListMap(listRes, "groupType");
+    }
+
+
+    /**
+     * 返回指定字典信息
+     *
+     * @param groupType
+     * @return
+     */
+    public List<DictionaryInfoDTO> getListByGroupType(Integer groupType) {
+        List<KlDictionaryInfo> list = this.list(new QueryWrapper<KlDictionaryInfo>()
+                .eq("group_type", groupType)
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .orderByAsc("order_no"));
+        List<DictionaryInfoDTO> listRes = BeanUtil.listCopyTo(list, DictionaryInfoDTO.class);
+        return listRes;
+    }
+}

+ 16 - 0
src/main/java/com/diagbot/mapper/KlDictionaryInfoMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.KlDictionaryInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 字典表 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-02-25
+ */
+public interface KlDictionaryInfoMapper extends BaseMapper<KlDictionaryInfo> {
+
+}

+ 16 - 0
src/main/java/com/diagbot/service/KlDictionaryInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.KlDictionaryInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 字典表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-02-25
+ */
+public interface KlDictionaryInfoService extends IService<KlDictionaryInfo> {
+
+}

+ 20 - 0
src/main/java/com/diagbot/service/impl/KlDictionaryInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.KlDictionaryInfo;
+import com.diagbot.mapper.KlDictionaryInfoMapper;
+import com.diagbot.service.KlDictionaryInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 字典表 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-02-25
+ */
+@Service
+public class KlDictionaryInfoServiceImpl extends ServiceImpl<KlDictionaryInfoMapper, KlDictionaryInfo> implements KlDictionaryInfoService {
+
+}

+ 21 - 0
src/main/resources/mapper/KlDictionaryInfoMapper.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.KlDictionaryInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.KlDictionaryInfo">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="group_type" property="groupType" />
+        <result column="name" property="name" />
+        <result column="val" property="val" />
+        <result column="return_type" property="returnType" />
+        <result column="order_no" property="orderNo" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>