Kaynağa Gözat

用户权限相关

gaodm 5 yıl önce
ebeveyn
işleme
9d10853b00

+ 23 - 0
src/main/java/com/diagbot/dto/BasDeptInfoDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/4/27 18:56
+ */
+@Getter
+@Setter
+public class BasDeptInfoDTO {
+    /**
+     * 科室编码(HIS导入)
+     */
+    private String deptId;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+}

+ 177 - 0
src/main/java/com/diagbot/entity/BasDeptInfo.java

@@ -0,0 +1,177 @@
+package com.diagbot.entity;
+
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 医院科室信息
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+public class BasDeptInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 科室编码(HIS导入)
+     */
+    private String deptId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    private String parentDeptId;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 科室类别
+     */
+    private String deptType;
+
+    /**
+     * 首字母拼音
+     */
+    private String spell;
+
+    /**
+     * 区域类别(门诊、工作站、住院等)
+     */
+    private String station;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getParentDeptId() {
+        return parentDeptId;
+    }
+
+    public void setParentDeptId(String parentDeptId) {
+        this.parentDeptId = parentDeptId;
+    }
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+    public String getDeptType() {
+        return deptType;
+    }
+
+    public void setDeptType(String deptType) {
+        this.deptType = deptType;
+    }
+    public String getSpell() {
+        return spell;
+    }
+
+    public void setSpell(String spell) {
+        this.spell = spell;
+    }
+    public String getStation() {
+        return station;
+    }
+
+    public void setStation(String station) {
+        this.station = station;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime 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;
+    }
+
+    @Override
+    public String toString() {
+        return "BasDeptInfo{" +
+            "deptId=" + deptId +
+            ", hospitalId=" + hospitalId +
+            ", parentDeptId=" + parentDeptId +
+            ", deptName=" + deptName +
+            ", deptType=" + deptType +
+            ", spell=" + spell +
+            ", station=" + station +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+        "}";
+    }
+}

+ 34 - 0
src/main/java/com/diagbot/facade/BasDeptInfoFacade.java

@@ -0,0 +1,34 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.BasDeptInfoDTO;
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.service.impl.BasDeptInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.SysUserUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/4/27 18:58
+ */
+@Component
+public class BasDeptInfoFacade extends BasDeptInfoServiceImpl {
+
+    public List<BasDeptInfoDTO> listForUser() {
+        List<BasDeptInfoDTO> basDeptInfoDTOList = new ArrayList<>();
+        List<BasDeptInfo> basDeptInfoList = this.list(new QueryWrapper<BasDeptInfo>()
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                .eq("station", "住院")
+        );
+        if (ListUtil.isNotEmpty(basDeptInfoList)) {
+            basDeptInfoDTOList = BeanUtil.listCopyTo(basDeptInfoList, BasDeptInfoDTO.class);
+        }
+        return basDeptInfoDTOList;
+    }
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 医院科室信息 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+public interface BasDeptInfoMapper extends BaseMapper<BasDeptInfo> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 医院科室信息 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+public interface BasDeptInfoService extends IService<BasDeptInfo> {
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.mapper.BasDeptInfoMapper;
+import com.diagbot.service.BasDeptInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 医院科室信息 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+@Service
+public class BasDeptInfoServiceImpl extends ServiceImpl<BasDeptInfoMapper, BasDeptInfo> implements BasDeptInfoService {
+
+}

+ 45 - 0
src/main/java/com/diagbot/web/BasDeptInfoController.java

@@ -0,0 +1,45 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.BasDeptInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysRoleDTO;
+import com.diagbot.facade.BasDeptInfoFacade;
+import com.diagbot.vo.SysRoleQueryVO;
+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.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 医院科室信息 前端控制器
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+@RestController
+@RequestMapping("/bas/dept")
+@Api(value = "医院科室API", tags = { "医院科室API" })
+@SuppressWarnings("unchecked")
+public class BasDeptInfoController {
+    @Autowired
+    private BasDeptInfoFacade basDeptInfoFacade;
+
+    @ApiOperation(value = "获取医院科室下拉列表信息[by:gaodm]",
+            notes = "")
+    @PostMapping("/listForUser")
+    @SysLogger("listForUser")
+    public RespDTO<List<BasDeptInfoDTO>> listForUser() {
+        return RespDTO.onSuc(basDeptInfoFacade.listForUser());
+    }
+}

+ 1 - 1
src/main/java/com/diagbot/web/SysRoleController.java

@@ -44,7 +44,7 @@ public class SysRoleController {
         return RespDTO.onSuc(sysRoleFacade.list(sysRoleQueryVO));
     }
 
-    @ApiOperation(value = "获取角色列表信息[by:gaodm]",
+    @ApiOperation(value = "获取角色下拉列表信息[by:gaodm]",
             notes = "")
     @PostMapping("/listForUser")
     @SysLogger("listForUser")

+ 21 - 0
src/main/resources/mapper/BasDeptInfoMapper.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.BasDeptInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.BasDeptInfo">
+        <id column="dept_id" property="deptId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="parent_dept_id" property="parentDeptId" />
+        <result column="dept_name" property="deptName" />
+        <result column="dept_type" property="deptType" />
+        <result column="spell" property="spell" />
+        <result column="station" property="station" />
+        <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" />
+    </resultMap>
+
+</mapper>

+ 1 - 1
src/test/java/com/diagbot/CodeGeneration.java

@@ -56,7 +56,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
 //        strategy.setTablePrefix(new String[] { "med_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "sys_role_menu","sys_role_permission"}); // 需要生成的表
+        strategy.setInclude(new String[] { "bas_dept_info"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);