wangfeng преди 4 години
родител
ревизия
cda0bcfd5f
променени са 24 файла, в които са добавени 1068 реда и са изтрити 0 реда
  1. 198 0
      cdssman-service/src/main/java/com/diagbot/entity/User.java
  2. 155 0
      cdssman-service/src/main/java/com/diagbot/entity/UserHospital.java
  3. 156 0
      cdssman-service/src/main/java/com/diagbot/entity/UserRole.java
  4. 44 0
      cdssman-service/src/main/java/com/diagbot/facade/UserFacade.java
  5. 45 0
      cdssman-service/src/main/java/com/diagbot/facade/UserHospitalFacade.java
  6. 58 0
      cdssman-service/src/main/java/com/diagbot/facade/UserRoleFacade.java
  7. 16 0
      cdssman-service/src/main/java/com/diagbot/mapper/UserHospitalMapper.java
  8. 16 0
      cdssman-service/src/main/java/com/diagbot/mapper/UserMapper.java
  9. 16 0
      cdssman-service/src/main/java/com/diagbot/mapper/UserRoleMapper.java
  10. 16 0
      cdssman-service/src/main/java/com/diagbot/service/UserHospitalService.java
  11. 16 0
      cdssman-service/src/main/java/com/diagbot/service/UserRoleService.java
  12. 16 0
      cdssman-service/src/main/java/com/diagbot/service/UserService.java
  13. 20 0
      cdssman-service/src/main/java/com/diagbot/service/impl/UserHospitalServiceImpl.java
  14. 20 0
      cdssman-service/src/main/java/com/diagbot/service/impl/UserRoleServiceImpl.java
  15. 20 0
      cdssman-service/src/main/java/com/diagbot/service/impl/UserServiceImpl.java
  16. 23 0
      cdssman-service/src/main/java/com/diagbot/vo/UserHospitalInfoVO.java
  17. 43 0
      cdssman-service/src/main/java/com/diagbot/vo/UserInfoVO.java
  18. 47 0
      cdssman-service/src/main/java/com/diagbot/vo/UserRoleInfoVO.java
  19. 20 0
      cdssman-service/src/main/java/com/diagbot/web/UserController.java
  20. 20 0
      cdssman-service/src/main/java/com/diagbot/web/UserHospitalController.java
  21. 46 0
      cdssman-service/src/main/java/com/diagbot/web/UserRoleController.java
  22. 18 0
      cdssman-service/src/main/resources/mapper/UserHospitalMapper.xml
  23. 21 0
      cdssman-service/src/main/resources/mapper/UserMapper.xml
  24. 18 0
      cdssman-service/src/main/resources/mapper/UserRoleMapper.xml

+ 198 - 0
cdssman-service/src/main/java/com/diagbot/entity/User.java

@@ -0,0 +1,198 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统用户表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@TableName("sys_user")
+public class User implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 用户ID
+     */
+    @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 String username;
+
+    /**
+     * 用户密码
+     */
+    private String password;
+
+    /**
+     * 联系人
+     */
+    private String linkman;
+
+    /**
+     * 是否启用(0:停用,1:启用)
+     */
+    private Integer status;
+
+    /**
+     * 1内部用户,0外部用户(默认0)
+     */
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    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 getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getLinkman() {
+        return linkman;
+    }
+
+    public void setLinkman(String linkman) {
+        this.linkman = linkman;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "User{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", username=" + username +
+                ", password=" + password +
+                ", linkman=" + linkman +
+                ", status=" + status +
+                ", type=" + type +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 155 - 0
cdssman-service/src/main/java/com/diagbot/entity/UserHospital.java

@@ -0,0 +1,155 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 用户-机构表映射表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@TableName("sys_user_hospital")
+public class UserHospital 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 userId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 备注
+     */
+    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 getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "UserHospital{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", userId=" + userId +
+                ", hospitalId=" + hospitalId +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 156 - 0
cdssman-service/src/main/java/com/diagbot/entity/UserRole.java

@@ -0,0 +1,156 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统用户角色关联表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@TableName("sys_user_role")
+public class UserRole implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 用户和角色关联ID
+     */
+    @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;
+
+    /**
+     * 系统用户表.用户ID
+     */
+    private Long userId;
+
+    /**
+     * 系统角色表.角色ID
+     */
+    private Long roleId;
+
+    /**
+     * 备注
+     */
+    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 getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "UserRole{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", userId=" + userId +
+                ", roleId=" + roleId +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 44 - 0
cdssman-service/src/main/java/com/diagbot/facade/UserFacade.java

@@ -0,0 +1,44 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.User;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.UserServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.UserInfoVO;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-11 10:13
+ */
+@Component
+public class UserFacade extends UserServiceImpl {
+
+    public User addUser(UserInfoVO userInfoVO) {
+        Date now = DateUtil.now();
+        QueryWrapper<User> userQuery = new QueryWrapper<>();
+        userQuery.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("username", userInfoVO.getUsername());
+        int count = count(userQuery);
+        if(count>0){
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该数据已存在");
+        }
+        User user = new User();
+        BeanUtil.copyProperties(userInfoVO,user);
+        user.setGmtModified(now);
+        user.setGmtCreate(now);
+        user.setCreator(UserUtils.getCurrentPrincipleID());
+        user.setModifier(UserUtils.getCurrentPrincipleID());
+        boolean res = save(user);
+        return user;
+    }
+
+}

+ 45 - 0
cdssman-service/src/main/java/com/diagbot/facade/UserHospitalFacade.java

@@ -0,0 +1,45 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.User;
+import com.diagbot.entity.UserHospital;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.UserHospitalServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.UserHospitalInfoVO;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-11 11:24
+ */
+@Component
+public class UserHospitalFacade extends UserHospitalServiceImpl {
+
+    public UserHospital addUserHospital(UserHospitalInfoVO userHospitalInfoVO) {
+        Date now = DateUtil.now();
+        QueryWrapper<UserHospital> userQuery = new QueryWrapper<>();
+        userQuery.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("user_id", userHospitalInfoVO.getUserId())
+                .eq("hospital_id", userHospitalInfoVO.getHospitalId());
+        int count = count(userQuery);
+        if (count > 0) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该数据已存在");
+        }
+        UserHospital userHospital = new UserHospital();
+        BeanUtil.copyProperties(userHospitalInfoVO,userHospital);
+        userHospital.setGmtModified(now);
+        userHospital.setGmtCreate(now);
+        userHospital.setCreator(UserUtils.getCurrentPrincipleID());
+        userHospital.setModifier(UserUtils.getCurrentPrincipleID());
+        boolean res = save(userHospital);
+        return userHospital;
+    }
+}

+ 58 - 0
cdssman-service/src/main/java/com/diagbot/facade/UserRoleFacade.java

@@ -0,0 +1,58 @@
+package com.diagbot.facade;
+
+import com.diagbot.entity.User;
+import com.diagbot.entity.UserRole;
+import com.diagbot.service.UserRoleService;
+import com.diagbot.service.impl.UserRoleServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.UserHospitalInfoVO;
+import com.diagbot.vo.UserInfoVO;
+import com.diagbot.vo.UserRoleInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-11 9:56
+ */
+@Component
+public class UserRoleFacade extends UserRoleServiceImpl {
+
+    @Autowired
+    UserFacade userFacade;
+    @Autowired
+    UserHospitalFacade userHospitalFacade;
+    @Autowired
+    UserRoleService userRoleService;
+
+    public boolean addUserRoles(UserRoleInfoVO userRoleInfoVO) {
+        boolean res = false;
+        Date now = DateUtil.now();
+        UserInfoVO userInfoVO = new UserInfoVO();
+        BeanUtil.copyProperties(userRoleInfoVO, userInfoVO);
+        //建立超级管理员基本信息
+        User user = userFacade.addUser(userInfoVO);
+        Long userId = user.getId();
+        if (userId != null) {
+            UserHospitalInfoVO userHospitalInfoVO = new UserHospitalInfoVO();
+            userHospitalInfoVO.setHospitalId(userRoleInfoVO.getHospitalId());
+            userHospitalInfoVO.setUserId(userId);
+            userHospitalFacade.addUserHospital(userHospitalInfoVO);
+            //
+            UserRole userRole = new UserRole();
+            userRole.setRoleId(-1L);
+            userRole.setUserId(userId);
+            userRole.setCreator(UserUtils.getCurrentPrincipleID());
+            userRole.setModifier(UserUtils.getCurrentPrincipleID());
+            userRole.setGmtCreate(now);
+            userRole.setGmtModified(now);
+            res = userRoleService.save(userRole);
+        }
+        return res;
+    }
+}

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/mapper/UserHospitalMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.UserHospital;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 用户-机构表映射表 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+public interface UserHospitalMapper extends BaseMapper<UserHospital> {
+
+}

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/mapper/UserMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.User;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 系统用户表 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+public interface UserMapper extends BaseMapper<User> {
+
+}

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/mapper/UserRoleMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.UserRole;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 系统用户角色关联表 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+public interface UserRoleMapper extends BaseMapper<UserRole> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.UserHospital;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 用户-机构表映射表 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+public interface UserHospitalService extends IService<UserHospital> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.UserRole;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 系统用户角色关联表 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+public interface UserRoleService extends IService<UserRole> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.User;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 系统用户表 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+public interface UserService extends IService<User> {
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.UserHospital;
+import com.diagbot.mapper.UserHospitalMapper;
+import com.diagbot.service.UserHospitalService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 用户-机构表映射表 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@Service
+public class UserHospitalServiceImpl extends ServiceImpl<UserHospitalMapper, UserHospital> implements UserHospitalService {
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.UserRole;
+import com.diagbot.mapper.UserRoleMapper;
+import com.diagbot.service.UserRoleService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 系统用户角色关联表 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@Service
+public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.User;
+import com.diagbot.mapper.UserMapper;
+import com.diagbot.service.UserService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 系统用户表 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@Service
+public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
+
+}

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/vo/UserHospitalInfoVO.java

@@ -0,0 +1,23 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-11 11:26
+ */
+@Setter
+@Getter
+public class UserHospitalInfoVO {
+    /**
+     * 用户主键
+     */
+    private Long userId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+}

+ 43 - 0
cdssman-service/src/main/java/com/diagbot/vo/UserInfoVO.java

@@ -0,0 +1,43 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-11 11:00
+ */
+@Setter
+@Getter
+public class UserInfoVO {
+    /**
+     * 用户名
+     */
+    private String username;
+
+    /**
+     * 用户密码
+     */
+    private String password;
+
+    /**
+     * 联系人
+     */
+    private String linkman;
+
+    /**
+     * 是否启用(0:停用,1:启用)
+     */
+    private Integer status;
+
+    /**
+     * 1内部用户,0外部用户(默认0)
+     */
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 47 - 0
cdssman-service/src/main/java/com/diagbot/vo/UserRoleInfoVO.java

@@ -0,0 +1,47 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-11 10:07
+ */
+@Setter
+@Getter
+public class UserRoleInfoVO {
+    /**
+     * 用户名
+     */
+    private String username;
+
+    /**
+     * 用户密码
+     */
+    @ApiModelProperty(hidden = true)
+    private String password = "{bcrypt}$2a$10$qhV.bPLz1xsjQKQc35Ohz.oMU2y.lffnogvLEK69u3Z1rbLpQVFh2";
+
+    /**
+     * 联系人
+     */
+    private String linkman;
+
+    /**
+     * 是否启用(0:停用,1:启用)
+     */
+    @ApiModelProperty(hidden = true)
+    private Integer status = 1;
+
+    /**
+     * 1内部用户,0外部用户(默认0)
+     */
+    @ApiModelProperty(hidden = true)
+    private Integer type = 0;
+
+    private Long hospitalId;
+
+    @ApiModelProperty(hidden = true)
+    private Long roleId = -1L;
+}

+ 20 - 0
cdssman-service/src/main/java/com/diagbot/web/UserController.java

@@ -0,0 +1,20 @@
+package com.diagbot.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 系统用户表 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@Controller
+@RequestMapping("/user")
+public class UserController {
+
+}

+ 20 - 0
cdssman-service/src/main/java/com/diagbot/web/UserHospitalController.java

@@ -0,0 +1,20 @@
+package com.diagbot.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 用户-机构表映射表 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@Controller
+@RequestMapping("/userHospital")
+public class UserHospitalController {
+
+}

+ 46 - 0
cdssman-service/src/main/java/com/diagbot/web/UserRoleController.java

@@ -0,0 +1,46 @@
+package com.diagbot.web;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TokenHospitaDTO;
+import com.diagbot.facade.UserRoleFacade;
+import com.diagbot.vo.TokenHospitalVO;
+import com.diagbot.vo.UserRoleInfoVO;
+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 javax.validation.Valid;
+
+/**
+ * <p>
+ * 系统用户角色关联表 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@RestController
+@RequestMapping("/userRole")
+@Api(value = "医院管理员相关API", tags = { "医院管理员相关API" })
+@SuppressWarnings("unchecked")
+public class UserRoleController {
+    @Autowired
+    UserRoleFacade userRoleFacade;
+
+    @ApiOperation(value = "添加医院管理员[by:wangfeng]",notes = "添加医院管理员")
+    @PostMapping("/addUserRole")
+    @SysLogger("addUserRole")
+    public RespDTO<Boolean> addUserRole(@RequestBody @Valid UserRoleInfoVO userRoleInfoVO) {
+        boolean res = userRoleFacade.addUserRoles(userRoleInfoVO);
+        return RespDTO.onSuc(res);
+    }
+}

+ 18 - 0
cdssman-service/src/main/resources/mapper/UserHospitalMapper.xml

@@ -0,0 +1,18 @@
+<?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.UserHospitalMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.UserHospital">
+        <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="user_id" property="userId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 21 - 0
cdssman-service/src/main/resources/mapper/UserMapper.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.UserMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.User">
+        <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="username" property="username" />
+        <result column="password" property="password" />
+        <result column="linkman" property="linkman" />
+        <result column="status" property="status" />
+        <result column="type" property="type" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 18 - 0
cdssman-service/src/main/resources/mapper/UserRoleMapper.xml

@@ -0,0 +1,18 @@
+<?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.UserRoleMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.UserRole">
+        <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="user_id" property="userId" />
+        <result column="role_id" property="roleId" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>