gaodm 5 år sedan
förälder
incheckning
29531abcac

+ 9 - 8
doc/002.20200426第二版/qc_init.sql

@@ -2,23 +2,24 @@ use `qc`;
 
 ALTER TABLE `med_behospital_info` MODIFY COLUMN `doctor_id` varchar(16) DEFAULT NULL COMMENT '医生ID' AFTER `diagnose`;
 
-ALTER TABLE `sys_user_hospital` ADD  COLUMN `dept_id` varchar(16) NOT NULL COMMENT '科室ID' AFTER `hospital_id`;
-ALTER TABLE `sys_user_hospital` ADD  COLUMN `doctor_id` varchar(16) DEFAULT NULL COMMENT '医生ID' AFTER `dept_id`;
+ALTER TABLE `sys_menu` ADD  COLUMN `show_status` int(11) NOT NULL DEFAULT '0' COMMENT '是否在右侧菜单显示(0:不显示,1:显示)' AFTER `code`;
+ALTER TABLE `sys_menu` ADD  COLUMN `maintain_status` int(11) NOT NULL DEFAULT '0' COMMENT '是否可以维护(0:不可维护,1:可以维护)' AFTER `show_status`;
 
-ALTER TABLE `sys_menu` ADD  COLUMN `is_show` int(11) NOT NULL DEFAULT '0' COMMENT '是否在右侧菜单显示(0:不显示,1:显示)' AFTER `code`;
 
+ALTER TABLE `sys_permission` ADD  COLUMN `code` varchar(10) NOT NULL DEFAULT '' COMMENT '资源编码' AFTER `name`;
 
-DROP TABLE IF EXISTS `sys_menu_user_type`;
-CREATE TABLE `sys_menu_user_type` (
+DROP TABLE IF EXISTS `sys_user_dept`;
+CREATE TABLE `sys_user_dept` (
   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
   `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
   `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
   `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
   `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
-  `menu_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '菜单id',
-  `user_type` int(11) NOT NULL DEFAULT '0' COMMENT '1内部用户,0外部用户(默认0)',
+  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '用户主键',
+  `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医院ID',
+  `dept_id` varchar(20) NOT NULL DEFAULT '' COMMENT '科室编码(HIS导入)',
   `remark` varchar(255) DEFAULT NULL COMMENT '备注',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='菜单和用户类型关联表';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户-医院科室映射表';
 

+ 11 - 114
src/main/java/com/diagbot/entity/SysMenu.java

@@ -2,6 +2,8 @@ package com.diagbot.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -14,6 +16,8 @@ import java.util.Date;
  * @author gaodm
  * @since 2020-04-12
  */
+@Getter
+@Setter
 public class SysMenu implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -67,7 +71,13 @@ public class SysMenu implements Serializable {
     /**
      * 是否在右侧菜单显示(0:不显示,1:显示)
      */
-    private Integer isShow;
+    private Integer showStatus;
+
+
+    /**
+     * 是否可以维护(0:不可维护,1:可以维护)
+     */
+    private Integer maintainStatus;
 
     /**
      * 排序,从小到大
@@ -79,117 +89,4 @@ public class SysMenu implements Serializable {
      */
     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 String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Long getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(Long parentId) {
-        this.parentId = parentId;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-
-    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;
-    }
-
-    public Integer getIsShow() {
-        return isShow;
-    }
-
-    public void setIsShow(Integer isShow) {
-        this.isShow = isShow;
-    }
-
-    @Override
-    public String toString() {
-        return "SysMenu{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", name=" + name +
-                ", parentId=" + parentId +
-                ", code=" + code +
-                ", isShow=" + isShow +
-                ", orderNo=" + orderNo +
-                ", remark=" + remark +
-                "}";
-    }
 }

+ 12 - 14
src/main/java/com/diagbot/entity/SysPermission.java

@@ -57,6 +57,11 @@ public class SysPermission implements Serializable {
      */
     private String name;
 
+    /**
+     * 资源编码
+     */
+    private String code;
+
     /**
      * 资源Url
      */
@@ -154,19 +159,12 @@ public class SysPermission implements Serializable {
         this.descritpion = descritpion;
     }
 
-    @Override
-    public String toString() {
-        return "Permission{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", name=" + name +
-                ", permissionUrl=" + permissionUrl +
-                ", method=" + method +
-                ", descritpion=" + descritpion +
-                "}";
+    public String getCode() {
+        return code;
     }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
 }

+ 173 - 0
src/main/java/com/diagbot/entity/SysRole.java

@@ -0,0 +1,173 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 系统角色表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+public class SysRole implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 角色ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 角色名称
+     */
+    private String name;
+
+    /**
+     * 角色等级
+     */
+    @TableField("roleLevel")
+    private Integer roleLevel;
+
+    /**
+     * 角色描述
+     */
+    private String descritpion;
+
+    /**
+     * 菜单ID:对应角色ID(暂无用处)
+     */
+    @TableField("menuItems")
+    private String menuItems;
+
+    /**
+     * 备注
+     */
+    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 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;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public Integer getRoleLevel() {
+        return roleLevel;
+    }
+
+    public void setRoleLevel(Integer roleLevel) {
+        this.roleLevel = roleLevel;
+    }
+    public String getDescritpion() {
+        return descritpion;
+    }
+
+    public void setDescritpion(String descritpion) {
+        this.descritpion = descritpion;
+    }
+    public String getMenuItems() {
+        return menuItems;
+    }
+
+    public void setMenuItems(String menuItems) {
+        this.menuItems = menuItems;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "SysRole{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", name=" + name +
+            ", roleLevel=" + roleLevel +
+            ", descritpion=" + descritpion +
+            ", menuItems=" + menuItems +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 12 - 0
src/main/java/com/diagbot/facade/SysRoleFacade.java

@@ -0,0 +1,12 @@
+package com.diagbot.facade;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/4/27 10:13
+ */
+@Component
+public class SysRoleFacade {
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.SysRole;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 系统角色表 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+public interface SysRoleMapper extends BaseMapper<SysRole> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.SysRole;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 系统角色表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+public interface SysRoleService extends IService<SysRole> {
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.SysRole;
+import com.diagbot.mapper.SysRoleMapper;
+import com.diagbot.service.SysRoleService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 系统角色表 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+@Service
+public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
+
+}

+ 1 - 1
src/main/java/com/diagbot/util/EncrypDES.java

@@ -9,7 +9,7 @@ import java.security.InvalidKeyException;
 
 /**
  * @ClassName org.diagbot.pub.utils.security.EncrypDES
- * @Description TODO
+ * @Description
  * @Author fyeman
  * @Date 2019/2/22/022 14:44
  * @Version 1.0

+ 27 - 0
src/main/java/com/diagbot/web/SysRoleController.java

@@ -0,0 +1,27 @@
+package com.diagbot.web;
+
+import com.diagbot.facade.SysRoleFacade;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 系统角色表 前端控制器
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+@RestController
+@Api(value = "用户角色API", tags = { "用户角色API" })
+@RequestMapping("/sys/role")
+@SuppressWarnings("unchecked")
+public class SysRoleController {
+    @Autowired
+    private SysRoleFacade sysRoleFacade;
+
+}

+ 5 - 0
src/main/java/com/diagbot/web/SysUserController.java

@@ -96,4 +96,9 @@ public class SysUserController {
         return RespDTO.onSuc(data);
     }
 
+    //TODO gaodm
+    //-------------用户维护BEGAIN------------------------
+
+    //-------------用户维护END---------------------------
+
 }

+ 1 - 1
src/main/resources/mapper/SysMenuMapper.xml

@@ -20,7 +20,7 @@
     <select id="getByRole" resultMap="BaseResultMap">
         select distinct a.* from sys_menu a, sys_role_menu b, sys_user_role c
         where a.id = b.menu_id and b.role_id and b.role_id = c.role_id and c.user_id = #{userId}
-        and a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N' and a.is_show = 1
+        and a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N' and a.show_status = 1
         ORDER BY a.parent_id , a.order_no
     </select>
 

+ 20 - 0
src/main/resources/mapper/SysRoleMapper.xml

@@ -0,0 +1,20 @@
+<?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.SysRoleMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysRole">
+        <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="name" property="name" />
+        <result column="roleLevel" property="roleLevel" />
+        <result column="descritpion" property="descritpion" />
+        <result column="menuItems" property="menuItems" />
+        <result column="remark" property="remark" />
+    </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_task_cron"}); // 需要生成的表
+        strategy.setInclude(new String[] { "sys_role"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);