gaodm пре 4 година
родитељ
комит
b7aa3a019a

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -122,6 +122,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/sys/planDetail/cancelPlanDetails").permitAll()
                 .antMatchers("/sys/planDetail/revStopPlanDetails").permitAll()
                 .antMatchers("/sys/plan/getDefaultPlans").permitAll()
+                .antMatchers("/sys/dictionaryInfo/getList").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -164,6 +164,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/sys/planDetail/cancelPlanDetails", request)
                 || matchers("/sys/planDetail/revStopPlanDetails", request)
                 || matchers("/sys/plan/getDefaultPlans", request)
+                || matchers("/sys/dictionaryInfo/getList", request)
                 || matchers("/", request)) {
             return true;
         }

+ 48 - 0
src/main/java/com/diagbot/dto/DictionaryInfoDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * icss字典表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@Getter
+@Setter
+public class DictionaryInfoDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 分组(值自定义)
+     */
+    private Long groupType;
+
+    /**
+     * 内容
+     */
+    private String name;
+
+    /**
+     * 值
+     */
+    private String val;
+
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 88 - 0
src/main/java/com/diagbot/entity/DictionaryInfo.java

@@ -0,0 +1,88 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * CDSS字典表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@TableName("sys_dictionary_info")
+@Getter
+@Setter
+public class DictionaryInfo 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:icss界面返回)
+     */
+    private Integer returnType;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 37 - 0
src/main/java/com/diagbot/facade/DictionaryFacade.java

@@ -0,0 +1,37 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.entity.DictionaryInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.DictionaryInfoServiceImpl;
+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:zhoutg
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class DictionaryFacade extends DictionaryInfoServiceImpl {
+
+    /**
+     * 返回字典信息
+     *
+     * @return
+     */
+    public Map<Long, List<DictionaryInfoDTO>> getList() {
+        List<DictionaryInfo> list = this.list(new QueryWrapper<DictionaryInfo>()
+                .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");
+    }
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.DictionaryInfo;
+
+/**
+ * <p>
+ * CDSS字典表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+public interface DictionaryInfoMapper extends BaseMapper<DictionaryInfo> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.DictionaryInfo;
+
+/**
+ * <p>
+ * CDSS字典表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+public interface DictionaryInfoService extends IService<DictionaryInfo> {
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.DictionaryInfo;
+import com.diagbot.mapper.DictionaryInfoMapper;
+import com.diagbot.service.DictionaryInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * CDSS字典表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@Service
+public class DictionaryInfoServiceImpl extends ServiceImpl<DictionaryInfoMapper, DictionaryInfo> implements DictionaryInfoService {
+
+}

+ 40 - 0
src/main/java/com/diagbot/web/DictionaryInfoController.java

@@ -0,0 +1,40 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.DictionaryFacade;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: CDSS字典表 前端控制器
+ * @author: gaodm
+ * @time: 2020/8/17 9:34
+ */
+@RequestMapping("/sys/dictionaryInfo")
+@RestController
+@SuppressWarnings("unchecked")
+@Api(value = "字典信息API", tags = { "字典信息API" })
+public class DictionaryInfoController {
+
+
+    @Autowired
+    DictionaryFacade dictionaryFacade;
+
+    @ApiOperation(value = "返回字典信息[by:gaodm]",
+            notes = "")
+    @PostMapping("/getList")
+    @SysLogger("getList")
+    public RespDTO<Map<Long, List<DictionaryInfoDTO>>> getList() {
+        Map<Long, List<DictionaryInfoDTO>> data = dictionaryFacade.getList();
+        return RespDTO.onSuc(data);
+    }
+}

+ 21 - 0
src/main/resources/mapper/DictionaryInfoMapper.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.DictionaryInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.DictionaryInfo">
+        <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>