Kaynağa Gözat

医生管理归属角色纠正为业务模块角色,新增功能菜单角色以及业务模块角色功能表

LiTaohong 6 yıl önce
ebeveyn
işleme
b55b950aaa
28 değiştirilmiş dosya ile 847 ekleme ve 129 silme
  1. 13 41
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorHospitalDO.java
  2. 54 10
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorRoleDO.java
  3. 3 2
      common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java
  4. 5 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgSaasDO.java
  5. 88 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/role/BaseRoleMenuDO.java
  6. 75 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/role/BaseRoleModuleDO.java
  7. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserDO.java
  8. 13 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  9. 10 10
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorHospitalVO.java
  10. 91 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/role/BaseRoleMenuVO.java
  11. 78 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/role/BaseRoleModuleVO.java
  12. 12 3
      sql/init.sql
  13. 12 13
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorDao.java
  14. 3 3
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorHospitalDao.java
  15. 4 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorRoleDao.java
  16. 21 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/role/BaseRoleMenuDao.java
  17. 21 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/role/BaseRoleModuleDao.java
  18. 9 9
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorEndpoint.java
  19. 104 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/role/BaseRoleMenuEndpoint.java
  20. 104 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/role/BaseRoleModuleEndpoint.java
  21. 6 6
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserEndpoint.java
  22. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorHospitalService.java
  23. 15 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorRoleService.java
  24. 34 27
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  25. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java
  26. 22 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/role/BaseRoleMenuService.java
  27. 22 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/role/BaseRoleModuleService.java
  28. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

+ 13 - 41
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorHospitalDO.java

@ -1,11 +1,9 @@
package com.yihu.jw.entity.base.doctor;
package com.yihu.jw.entity.base.doctor;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
import java.util.Date;
/**
/**
@ -21,28 +19,18 @@ public class BaseDoctorHospitalDO extends IntegerIdentityEntity {
    /**
    /**
	 * 医院标识
	 * 医院标识
	 */
	 */
	private String hospCode;
	private String orgCode;
    /**
    /**
	 * 医院名称
	 * 医院名称
	 */
	 */
	private String hospName;
	private String orgName;
    /**
    /**
     * 医生标识
     * 医生标识
     */
     */
	private String doctorCode;
	private String doctorCode;
    /**
	 * 职称代码
	 */
	private String jobTitleCode;
    /**
	 * 职称名称
	 */
	private String jobTitleName;
    /**
    /**
     * 医生所在机构部门标识
     * 医生所在机构部门标识
     */
     */
@ -65,27 +53,27 @@ public class BaseDoctorHospitalDO extends IntegerIdentityEntity {
	public BaseDoctorHospitalDO(){}
	public BaseDoctorHospitalDO(){}
	public BaseDoctorHospitalDO(String hospCode,String hospName,String doctorDutyCode,String doctorDutyName){
	    this.hospCode = hospCode;
	    this.hospName = hospName;
	public BaseDoctorHospitalDO(String orgCode, String orgName, String doctorDutyCode, String doctorDutyName){
	    this.orgCode = orgCode;
	    this.orgName = orgName;
	    this.doctorDutyCode = doctorDutyCode;
	    this.doctorDutyCode = doctorDutyCode;
	    this.doctorDutyName = doctorDutyName;
	    this.doctorDutyName = doctorDutyName;
    }
    }
	@Column(name = "hosp_code")
	@Column(name = "hosp_code")
    public String getHospCode() {
        return hospCode;
    public String getOrgCode() {
        return orgCode;
    }
    }
    public void setHospCode(String hospCode) {
        this.hospCode = hospCode;
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    }
	@Column(name = "hosp_name")
	@Column(name = "hosp_name")
    public String getHospName() {
        return hospName;
    public String getOrgName() {
        return orgName;
    }
    }
    public void setHospName(String hospName) {
        this.hospName = hospName;
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    }
    @Column(name = "doctor_code")
    @Column(name = "doctor_code")
@ -97,22 +85,6 @@ public class BaseDoctorHospitalDO extends IntegerIdentityEntity {
        this.doctorCode = doctorCode;
        this.doctorCode = doctorCode;
    }
    }
	@Column(name = "job_title_code")
    public String getJobTitleCode() {
        return jobTitleCode;
    }
    public void setJobTitleCode(String jobTitleCode) {
        this.jobTitleCode = jobTitleCode;
    }
	@Column(name = "job_title_name")
    public String getJobTitleName() {
        return jobTitleName;
    }
    public void setJobTitleName(String jobTitleName) {
        this.jobTitleName = jobTitleName;
    }
	@Column(name = "del")
	@Column(name = "del")
    public String getDel() {
    public String getDel() {
        return del;
        return del;

+ 54 - 10
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorRoleDO.java

@ -1,6 +1,7 @@
package com.yihu.jw.entity.base.doctor;
package com.yihu.jw.entity.base.doctor;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
@ -14,24 +15,48 @@ import javax.persistence.Table;
 */
 */
@Entity
@Entity
@Table(name = "base_doctor_role")
@Table(name = "base_doctor_role")
public class BaseDoctorRoleDO extends IntegerIdentityEntity {
public class BaseDoctorRoleDO extends IntegerIdentityEntityWithOperator {
    /**
    /**
	 * saasid
	 */
	private String saasid;
	/**
	 * 医生code
	 * 医生code
	 */
	 */
	private String doctorCode;
	private String doctorCode;
    /**
    /**
	 * 医生角色code
	 * 角色名称
	 */
	 */
	private String roleCode;
	private String name;
    /**
	 * 医生业务模块角色code
	 */
	private String roleModuleCode;
	/**
	 * 角色说明
	 */
	private String description;
    /**
    /**
	 * 作废标识,1正常,0作废
	 * 作废标识,1正常,0作废
	 */
	 */
	private String del;
	private String del;
	@Column(name = "doctor_code")
    @Column(name = "saasid")
    public String getSaasid() {
        return saasid;
    }
    public void setSaasid(String saasid) {
        this.saasid = saasid;
    }
    @Column(name = "doctor_code")
    public String getDoctorCode() {
    public String getDoctorCode() {
        return doctorCode;
        return doctorCode;
    }
    }
@ -39,12 +64,22 @@ public class BaseDoctorRoleDO extends IntegerIdentityEntity {
        this.doctorCode = doctorCode;
        this.doctorCode = doctorCode;
    }
    }
	@Column(name = "role_code")
    public String getRoleCode() {
        return roleCode;
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "role_module_code")
    public String getRoleModuleCode() {
        return roleModuleCode;
    }
    }
    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    public void setRoleModuleCode(String roleModuleCode) {
        this.roleModuleCode = roleModuleCode;
    }
    }
	@Column(name = "del")
	@Column(name = "del")
@ -54,4 +89,13 @@ public class BaseDoctorRoleDO extends IntegerIdentityEntity {
    public void setDel(String del) {
    public void setDel(String del) {
        this.del = del;
        this.del = del;
    }
    }
    @Column(name = "description")
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
}
}

+ 3 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java

@ -1,6 +1,9 @@
package com.yihu.jw.entity.base.org;
package com.yihu.jw.entity.base.org;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
@ -17,8 +20,6 @@ import java.util.Date;
@Table(name = "base_org")
@Table(name = "base_org")
public class BaseOrgDO extends UuidIdentityEntityWithOperator {
public class BaseOrgDO extends UuidIdentityEntityWithOperator {
    /**
    /**
	 * saas化配置
	 * saas化配置
	 */
	 */

+ 5 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgSaasDO.java

@ -2,6 +2,10 @@ package com.yihu.jw.entity.base.org;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
@ -15,6 +19,7 @@ import javax.persistence.Table;
*/
*/
@Entity
@Entity
@Table(name = "base_org_saas")
@Table(name = "base_org_saas")
@Component
public class BaseOrgSaasDO extends IntegerIdentityEntity {
public class BaseOrgSaasDO extends IntegerIdentityEntity {
    /**
    /**

+ 88 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/role/BaseRoleMenuDO.java

@ -0,0 +1,88 @@
package com.yihu.jw.entity.base.role;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 角色菜单表实体
 * 
 * @author litaohong on  2018年10月23日
 *
 */
@Entity
@Table(name = "base_role_menu")
public class BaseRoleMenuDO extends IntegerIdentityEntity {
    /**
	 * 角色标识
	 */
	private String code;
    /**
	 * 角色名称
	 */
	private String name;
    /**
	 * 角色拥有的菜单id列表,逗号分隔,对应base_menu表
	 */
	private String menuId;
    /**
	 * 角色状态,0失效 1有效
	 */
	private String del;
    /**
	 * 角色说明
	 */
	private String description;
	@Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
	@Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
	@Column(name = "menu_id")
    public String getMenuId() {
        return menuId;
    }
    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }
	@Column(name = "del")
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
	@Column(name = "description")
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
}

+ 75 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/role/BaseRoleModuleDO.java

@ -0,0 +1,75 @@
package com.yihu.jw.entity.base.role;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 业务模块角色实体
 * 
 * @author litaohong on  2018年10月23日
 *
 */
@Entity
@Table(name = "base_role_module")
public class BaseRoleModuleDO extends IntegerIdentityEntity {
    /**
	 * 角色标识
	 */
	private String code;
    /**
	 * 角色名称
	 */
	private String name;
    /**
	 * 业务模块id,多个用逗号分割
	 */
	private String moduleId;
    /**
	 * 状态,0失效,1有效
	 */
	private String del;
	@Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
	@Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
	@Column(name = "module_id")
    public String getModuleId() {
        return moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
	@Column(name = "del")
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
}

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserDO.java

@ -58,6 +58,9 @@ public class UserDO extends UuidIdentityEntityWithOperator {
    //saas化的id
    //saas化的id
    private String  saasId;
    private String  saasId;
    //平台角色标识(超管,租管,机管)
    private String  roleCode;
    public UserDO(){}
    public UserDO(){}
    public UserDO(String username,String password,String mobile){
    public UserDO(String username,String password,String mobile){
@ -199,4 +202,12 @@ public class UserDO extends UuidIdentityEntityWithOperator {
    public void setSaasId(String saasId) {
    public void setSaasId(String saasId) {
        this.saasId = saasId;
        this.saasId = saasId;
    }
    }
    public String getRoleCode() {
        return roleCode;
    }
    @Column(name = "role_code",nullable = false)
    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }
}
}

+ 13 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -616,5 +616,18 @@ public class BaseRequestMapping {
    public static class MqMessageSubscriber extends Basic {
    public static class MqMessageSubscriber extends Basic {
        public static final String PREFIX  = "/mq_message_subscriber";
        public static final String PREFIX  = "/mq_message_subscriber";
    }
    }
    /**
     * 业务模块角色
     */
    public static class BaseRoleModule extends Basic {
        public static final String PREFIX  = "/baseRoleModule";
    }
    /**
     * 功能菜单角色
     */
    public static class BaseRoleMenu extends Basic {
        public static final String PREFIX  = "/baseRoleMenu";
    }
}
}

+ 10 - 10
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorHospitalVO.java

@ -26,13 +26,13 @@ public class BaseDoctorHospitalVO extends IntegerIdentityVO{
	 * 医院标识
	 * 医院标识
	 */
	 */
	@ApiModelProperty(value = "医院标识", example = "")
	@ApiModelProperty(value = "医院标识", example = "")
    private String hospCode;
    private String orgCode;
    /**
    /**
	 * 医院名称
	 * 医院名称
	 */
	 */
	@ApiModelProperty(value = "医院名称", example = "厦门市中医院")
	@ApiModelProperty(value = "医院名称", example = "厦门市中医院")
    private String hospName;
    private String orgName;
    /**
    /**
	 * 职称代码
	 * 职称代码
@ -72,18 +72,18 @@ public class BaseDoctorHospitalVO extends IntegerIdentityVO{
    private Date createTime;
    private Date createTime;
    public String getHospCode() {
        return hospCode;
    public String getOrgCode() {
        return orgCode;
    }
    }
    public void setHospCode(String hospCode) {
        this.hospCode = hospCode;
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    }
    public String getHospName() {
        return hospName;
    public String getOrgName() {
        return orgName;
    }
    }
    public void setHospName(String hospName) {
        this.hospName = hospName;
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    }
    public String getJobTitleCode() {
    public String getJobTitleCode() {

+ 91 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/role/BaseRoleMenuVO.java

@ -0,0 +1,91 @@
package com.yihu.jw.restmodel.base.role;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * 
 * 角色菜单表vo
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  2018年10月23日 Created
 *
 * </pre>
 * @since 1.
 */
@ApiModel(value = "BaseRoleMenuVO", description = "角色菜单表")
public class BaseRoleMenuVO extends IntegerIdentityVO{
    /**
	 * 角色标识
	 */
	@ApiModelProperty(value = "角色标识", example = "模块1")
    private String code;
    /**
	 * 角色名称
	 */
	@ApiModelProperty(value = "角色名称", example = "模块1")
    private String name;
    /**
	 * 角色拥有的菜单id列表,逗号分隔,对应base_menu表
	 */
	@ApiModelProperty(value = "角色拥有的菜单id列表,逗号分隔,对应base_menu表", example = "模块1")
    private String menuId;
    /**
	 * 角色状态,0失效 1有效
	 */
	@ApiModelProperty(value = "角色状态,0失效 1有效", example = "模块1")
    private String del;
    /**
	 * 角色说明
	 */
	@ApiModelProperty(value = "角色说明", example = "模块1")
    private String description;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getMenuId() {
        return menuId;
    }
    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
}

+ 78 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/role/BaseRoleModuleVO.java

@ -0,0 +1,78 @@
package com.yihu.jw.restmodel.base.role;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * 
 * 业务模块角色vo
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  2018年10月23日 Created
 *
 * </pre>
 * @since 1.
 */
@ApiModel(value = "BaseRoleModuleVO", description = "业务模块角色")
public class BaseRoleModuleVO extends IntegerIdentityVO{
    /**
	 * 角色标识
	 */
	@ApiModelProperty(value = "角色标识", example = "模块1")
    private String code;
    /**
	 * 角色名称
	 */
	@ApiModelProperty(value = "角色名称", example = "模块1")
    private String name;
    /**
	 * 业务模块id,多个用逗号分割
	 */
	@ApiModelProperty(value = "业务模块id,多个用逗号分割", example = "模块1")
    private String moduleId;
    /**
	 * 状态,0失效,1有效
	 */
	@ApiModelProperty(value = "状态,0失效,1有效", example = "模块1")
    private String del;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getModuleId() {
        return moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
}

+ 12 - 3
sql/init.sql

@ -787,9 +787,18 @@ drop table IF EXISTS `base_role_module`;
create table `base_role_module`
create table `base_role_module`
(
(
  `id` int(11) NOT NULL AUTO_INCREMENT  COMMENT '表id,自增长,字典型',
  `id` int(11) NOT NULL AUTO_INCREMENT  COMMENT '表id,自增长,字典型',
  `role_id` varchar(100) DEFAULT NULL COMMENT '角色id',
  `module_id` varchar(50) not null COMMENT '业务模块id',
  primary key (id)
  `code` varchar(100) DEFAULT NULL COMMENT '角色标识',
  `name` varchar(100) DEFAULT NULL COMMENT '角色名称',
  `module_id` varchar(50) not null COMMENT '业务模块id,多个用逗号分割',
  `del` varchar(1) not null COMMENT '状态,0失效,1有效',
  `create_user` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建人',
  `create_user_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建人名',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_user` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '修改人',
  `update_user_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '修改人名',
  `update_time` datetime NOT NULL COMMENT '修改时间',
  primary key (id),
  key `code` (`code`)
)
)
  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='业务模块角色';
  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='业务模块角色';

Dosya farkı çok büyük olduğundan ihmal edildi
+ 12 - 13
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorDao.java


+ 3 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorHospitalDao.java

@ -25,11 +25,11 @@ import java.util.Set;
 */
 */
public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDoctorHospitalDO, Integer>, JpaSpecificationExecutor<BaseDoctorHospitalDO>  {
public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDoctorHospitalDO, Integer>, JpaSpecificationExecutor<BaseDoctorHospitalDO>  {
    List<BaseDoctorHospitalDO> findByHospCodeAndDoctorCode(String hospCode,String doctorCode);
    List<BaseDoctorHospitalDO> findByOrgCodeAndDoctorCode(String orgCode, String doctorCode);
    @Query("select id from BaseDoctorHospitalDO where doctorCode = ?1")
    @Query("select id from BaseDoctorHospitalDO where doctorCode = ?1")
    Set<Object> findIdListByHospCodeAndDoctorCode(String doctorCode);
    Set<Object> findIdListByOrgCodeAndDoctorCode(String doctorCode);
    @Query("select new BaseDoctorHospitalDO(hospCode,hospName,doctorDutyCode,doctorDutyName) from BaseDoctorHospitalDO where doctorCode = ?1")
    @Query("select new BaseDoctorHospitalDO(orgCode,orgName,doctorDutyCode,doctorDutyName) from BaseDoctorHospitalDO where doctorCode = ?1")
    List<BaseDoctorHospitalDO> getOrgAndDutyByDoctorCode(String doctorCode);
    List<BaseDoctorHospitalDO> getOrgAndDutyByDoctorCode(String doctorCode);
}
}

+ 4 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorRoleDao.java

@ -5,6 +5,8 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Set;
/**
/**
@ -23,4 +25,6 @@ public interface BaseDoctorRoleDao extends PagingAndSortingRepository<BaseDoctor
    @Query("select id from BaseDoctorRoleDO where doctorCode = ?1")
    @Query("select id from BaseDoctorRoleDO where doctorCode = ?1")
    Set<Object> findIdListByDoctorCode(String doctorCode);
    Set<Object> findIdListByDoctorCode(String doctorCode);
    List<BaseDoctorRoleDO> findByDoctorCodeAndDel(String doctorCode,String del);
}
}

+ 21 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/role/BaseRoleMenuDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.base.dao.role;
import com.yihu.jw.entity.base.role.BaseRoleMenuDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 角色菜单表 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年10月23日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseRoleMenuDao extends PagingAndSortingRepository<BaseRoleMenuDO, Integer>, JpaSpecificationExecutor<BaseRoleMenuDO>  {
}

+ 21 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/role/BaseRoleModuleDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.base.dao.role;
import com.yihu.jw.entity.base.role.BaseRoleModuleDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 业务模块角色 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年10月23日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseRoleModuleDao extends PagingAndSortingRepository<BaseRoleModuleDO, Integer>, JpaSpecificationExecutor<BaseRoleModuleDO>  {
}

+ 9 - 9
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorEndpoint.java

@ -44,7 +44,7 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    @Autowired
    @Autowired
    private OrgTreeService orgTreeService;
    private OrgTreeService orgTreeService;
    @PostMapping(value = BaseRequestMapping.BaseDoctor.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @PostMapping(value = BaseRequestMapping.BaseDoctor.CREATE)
    @ApiOperation(value = "新增医生")
    @ApiOperation(value = "新增医生")
    public Envelop create(
    public Envelop create(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
@ -67,7 +67,7 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
        return success("删除成功");
        return success("删除成功");
    }
    }
    @PostMapping(value = BaseRequestMapping.BaseDoctor.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @PostMapping(value = BaseRequestMapping.BaseDoctor.UPDATE)
    @ApiOperation(value = "更新医生")
    @ApiOperation(value = "更新医生")
    public Envelop update(
    public Envelop update(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
@ -112,9 +112,8 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    }
    }
    /**
    /**
     * 单个医生信息(基本信息 + 医院执业信息)
     * 单个医生信息(基本信息 + 医院执业及角色信息)
     *
     *
     * @param orgId
     * @param doctorId
     * @param doctorId
     * @return
     * @return
     * @throws Exception
     * @throws Exception
@ -122,12 +121,13 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseRequestMapping.BaseDoctor.DOCINFO)
    @PostMapping(value = BaseRequestMapping.BaseDoctor.DOCINFO)
    @ApiOperation(value = "获取单个医生及其执业信息")
    @ApiOperation(value = "获取单个医生及其执业信息")
    public Envelop doctorHosplist(
    public Envelop doctorHosplist(
            @ApiParam(name = "orgId", value = "医院id")
            @RequestParam(value = "orgId", required = true) String orgId,
            @ApiParam(name = "doctorId", value = "医生id")
            @ApiParam(name = "doctorId", value = "医生标识")
            @RequestParam(value = "doctorId", required = true) String doctorId) throws Exception {
            @RequestParam(value = "doctorId", required = true) String doctorId) throws Exception {
        Map<String, Object> map = baseDoctorService.getOneDoctorInfo(orgId, doctorId);
        return success(map.toString());
        JSONObject jsonObject = baseDoctorService.getOneDoctorInfo(doctorId);
        if (jsonObject.getString("response").equalsIgnoreCase(ConstantUtils.FAIL)) {
            return failed(jsonObject.getString("msg"));
        }
        return success(jsonObject.getString("msg"));
    }
    }
    /**
    /**

+ 104 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/role/BaseRoleMenuEndpoint.java

@ -0,0 +1,104 @@
package com.yihu.jw.base.endpoint.role;
import com.yihu.jw.base.service.role.BaseRoleMenuService;
import com.yihu.jw.entity.base.role.BaseRoleMenuDO;
import com.yihu.jw.restmodel.base.role.BaseRoleMenuVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* 角色菜单表控制器
*
* @version
* <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年10月23日 	Created
 *
 * </pre>
* @since 1.
*/
@RestController
@RequestMapping(value = BaseRequestMapping.BaseRoleMenu.PREFIX)
@Api(value = "角色菜单表管理", description = "角色菜单表管理服务接口", tags = {"wlyy基础服务 - 角色菜单表管理服务接口"})
public class BaseRoleMenuEndpoint extends EnvelopRestEndpoint {
@Autowired
private BaseRoleMenuService baseRoleMenuService;
@PostMapping(value = BaseRequestMapping.BaseRoleMenu.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ApiOperation(value = "创建")
public ObjEnvelop<BaseRoleMenuVO> create (
    @ApiParam(name = "json_data", value = "Json数据", required = true)
    @RequestBody String jsonData) throws Exception {
    BaseRoleMenuDO baseRoleMenu = toEntity(jsonData, BaseRoleMenuDO.class);
    baseRoleMenu = baseRoleMenuService.save(baseRoleMenu);
    return success(baseRoleMenu, BaseRoleMenuVO.class);
    }
    @PostMapping(value = BaseRequestMapping.BaseRoleMenu.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
    @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
    @RequestParam(value = "ids") String ids) {
    baseRoleMenuService.delete(ids.split(","));
    return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.BaseRoleMenu.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<BaseRoleMenuVO> update (
        @ApiParam(name = "json_data", value = "Json数据", required = true)
        @RequestBody String jsonData) throws Exception {
        BaseRoleMenuDO baseRoleMenu = toEntity(jsonData, BaseRoleMenuDO.class);
        if (null == baseRoleMenu.getId()) {
        return failed("ID不能为空", ObjEnvelop.class);
        }
        baseRoleMenu = baseRoleMenuService.save(baseRoleMenu);
        return success(baseRoleMenu, BaseRoleMenuVO.class);
        }
        @GetMapping(value = BaseRequestMapping.BaseRoleMenu.PAGE)
        @ApiOperation(value = "获取分页")
        public PageEnvelop<BaseRoleMenuVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            List<BaseRoleMenuDO> baseRoleMenus = baseRoleMenuService.search(fields, filters, sorts, page, size);
                int count = (int)baseRoleMenuService.getCount(filters);
                return success(baseRoleMenus, count, page, size, BaseRoleMenuVO.class);
         }
         @GetMapping(value = BaseRequestMapping.BaseRoleMenu.LIST)
         @ApiOperation(value = "获取列表")
         public ListEnvelop<BaseRoleMenuVO> list (
             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
             @RequestParam(value = "fields", required = false) String fields,
             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
             @RequestParam(value = "filters", required = false) String filters,
             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
             List<BaseRoleMenuDO> baseRoleMenus = baseRoleMenuService.search(fields, filters, sorts);
                  return success(baseRoleMenus, BaseRoleMenuVO.class);
         }
 }

+ 104 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/role/BaseRoleModuleEndpoint.java

@ -0,0 +1,104 @@
package com.yihu.jw.base.endpoint.role;
import com.yihu.jw.base.service.role.BaseRoleModuleService;
import com.yihu.jw.entity.base.role.BaseRoleModuleDO;
import com.yihu.jw.restmodel.base.role.BaseRoleModuleVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* 业务模块角色控制器
*
* @version
* <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年10月23日 	Created
 *
 * </pre>
* @since 1.
*/
@RestController
@RequestMapping(value = BaseRequestMapping.BaseRoleModule.PREFIX)
@Api(value = "业务模块角色管理", description = "业务模块角色管理服务接口", tags = {"wlyy基础服务 - 业务模块角色管理服务接口"})
public class BaseRoleModuleEndpoint extends EnvelopRestEndpoint {
@Autowired
private BaseRoleModuleService baseRoleModuleService;
@PostMapping(value = BaseRequestMapping.BaseRoleModule.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ApiOperation(value = "创建")
public ObjEnvelop<BaseRoleModuleVO> create (
    @ApiParam(name = "json_data", value = "Json数据", required = true)
    @RequestBody String jsonData) throws Exception {
    BaseRoleModuleDO baseRoleModule = toEntity(jsonData, BaseRoleModuleDO.class);
    baseRoleModule = baseRoleModuleService.save(baseRoleModule);
    return success(baseRoleModule, BaseRoleModuleVO.class);
    }
    @PostMapping(value = BaseRequestMapping.BaseRoleModule.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
    @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
    @RequestParam(value = "ids") String ids) {
    baseRoleModuleService.delete(ids.split(","));
    return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.BaseRoleModule.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<BaseRoleModuleVO> update (
        @ApiParam(name = "json_data", value = "Json数据", required = true)
        @RequestBody String jsonData) throws Exception {
        BaseRoleModuleDO baseRoleModule = toEntity(jsonData, BaseRoleModuleDO.class);
        if (null == baseRoleModule.getId()) {
        return failed("ID不能为空", ObjEnvelop.class);
        }
        baseRoleModule = baseRoleModuleService.save(baseRoleModule);
        return success(baseRoleModule, BaseRoleModuleVO.class);
        }
        @GetMapping(value = BaseRequestMapping.BaseRoleModule.PAGE)
        @ApiOperation(value = "获取分页")
        public PageEnvelop<BaseRoleModuleVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            List<BaseRoleModuleDO> baseRoleModules = baseRoleModuleService.search(fields, filters, sorts, page, size);
                int count = (int)baseRoleModuleService.getCount(filters);
                return success(baseRoleModules, count, page, size, BaseRoleModuleVO.class);
         }
         @GetMapping(value = BaseRequestMapping.BaseRoleModule.LIST)
         @ApiOperation(value = "获取列表")
         public ListEnvelop<BaseRoleModuleVO> list (
             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
             @RequestParam(value = "fields", required = false) String fields,
             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
             @RequestParam(value = "filters", required = false) String filters,
             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
             List<BaseRoleModuleDO> baseRoleModules = baseRoleModuleService.search(fields, filters, sorts);
                  return success(baseRoleModules, BaseRoleModuleVO.class);
         }
 }

+ 6 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserEndpoint.java

@ -94,26 +94,26 @@ public class UserEndpoint extends EnvelopRestEndpoint {
    }
    }
    @GetMapping(value = BaseRequestMapping.User.CHECK_USERNAME)
    @GetMapping(value = BaseRequestMapping.User.CHECK_USERNAME)
    @ApiOperation(value = "检查用户名是否可用(message=1代表可用,message=0代表不可用)")
    @ApiOperation(value = "检查用户名是否可用(message=available代表可用,message=inavailable代表不可用)")
    public Envelop checkName (
    public Envelop checkName (
            @ApiParam(name = "username", value = "用户名", required = true)
            @ApiParam(name = "username", value = "用户名", required = true)
            @RequestParam(value = "username", required = false) String username) throws Exception {
            @RequestParam(value = "username", required = false) String username) throws Exception {
        if (userService.existUserName(username)) {
        if (userService.existUserName(username)) {
            return success("1");
            return success("inavailable");
        } else {
        } else {
            return success("0");
            return success("available");
        }
        }
    }
    }
    @GetMapping(value = BaseRequestMapping.User.CHECK_MOBILE)
    @GetMapping(value = BaseRequestMapping.User.CHECK_MOBILE)
    @ApiOperation(value = "检查手机号是否可用(message=1代表可用,message=0代表不可用)")
    @ApiOperation(value = "检查手机号是否可用(message=available代表可用,message=inavailable代表不可用)")
    public Envelop checkMobile (
    public Envelop checkMobile (
            @ApiParam(name = "mobile", value = "手机号", required = true)
            @ApiParam(name = "mobile", value = "手机号", required = true)
            @RequestParam(value = "mobile", required = false) String mobile) throws Exception {
            @RequestParam(value = "mobile", required = false) String mobile) throws Exception {
        if (userService.existMobile(mobile)) {
        if (userService.existMobile(mobile)) {
            return success("1");
            return success("inavailable");
        } else {
        } else {
            return success("0");
            return success("available");
        }
        }
    }
    }

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorHospitalService.java

@ -40,7 +40,7 @@ public class BaseDoctorHospitalService extends BaseJpaService<BaseDoctorHospital
        if (StringUtils.isEmpty(hospCode) || StringUtils.isEmpty(doctorCode)) {
        if (StringUtils.isEmpty(hospCode) || StringUtils.isEmpty(doctorCode)) {
            return result;
            return result;
        }
        }
        return baseDoctorHospitalDao.findByHospCodeAndDoctorCode(hospCode, doctorCode);
        return baseDoctorHospitalDao.findByOrgCodeAndDoctorCode(hospCode, doctorCode);
    }
    }
    /**
    /**
@ -54,7 +54,7 @@ public class BaseDoctorHospitalService extends BaseJpaService<BaseDoctorHospital
        if (StringUtils.isEmpty(doctorCode)) {
        if (StringUtils.isEmpty(doctorCode)) {
            return result;
            return result;
        }
        }
        return baseDoctorHospitalDao.findIdListByHospCodeAndDoctorCode(doctorCode);
        return baseDoctorHospitalDao.findIdListByOrgCodeAndDoctorCode(doctorCode);
    }
    }
    /**
    /**

+ 15 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorRoleService.java

@ -7,8 +7,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import java.util.HashSet;
import java.util.Set;
import java.util.*;
/**
/**
 * 医生角色关联信息服务service
 * 医生角色关联信息服务service
@ -39,4 +38,18 @@ public class BaseDoctorRoleService extends BaseJpaService<BaseDoctorRoleDO, Base
        }
        }
        return baseDoctorRoleDao.findIdListByDoctorCode(doctorCode);
        return baseDoctorRoleDao.findIdListByDoctorCode(doctorCode);
    }
    }
    /**
     * 根据医生标识获取医生相关联的角色Id列表
     *
     * @param doctorCode
     * @return
     */
    public List<BaseDoctorRoleDO> queryDoctorRoleList(String doctorCode,String del) {
        List<BaseDoctorRoleDO> result = new ArrayList<>();
        if (StringUtils.isEmpty(doctorCode)) {
            return result;
        }
        return baseDoctorRoleDao.findByDoctorCodeAndDel(doctorCode,del);
    }
}
}

+ 34 - 27
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -6,7 +6,6 @@ import com.alibaba.fastjson.serializer.SimplePropertyPreFilter;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.doctor.BaseDoctorDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorDao;
import com.yihu.jw.base.service.org.OrgTree;
import com.yihu.jw.base.service.org.OrgTree;
import com.yihu.jw.base.service.org.OrgTreeService;
import com.yihu.jw.base.service.org.tree.SimpleTree;
import com.yihu.jw.base.service.org.tree.SimpleTree;
import com.yihu.jw.base.service.org.tree.SimpleTreeNode;
import com.yihu.jw.base.service.org.tree.SimpleTreeNode;
import com.yihu.jw.base.service.org.tree.TreeNode;
import com.yihu.jw.base.service.org.tree.TreeNode;
@ -14,6 +13,7 @@ import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
@ -25,7 +25,6 @@ import org.springframework.util.StringUtils;
import java.io.IOException;
import java.io.IOException;
import java.util.*;
import java.util.*;
import java.util.regex.Pattern;
/**
/**
 * 
 * 
@ -60,34 +59,40 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    /**
    /**
     * 获取医生信息
     * 获取医生信息
     * @param orgId 医生所属机构id
     * @param doctorId 医生id
     * @param doctorId 医生id
     * @return
     * @return
     */
     */
    public Map<String,Object> getOneDoctorInfo(String orgId, String doctorId) throws Exception{
        Map<String,Object> resultMap = new HashMap<>();
        if(StringUtils.isEmpty(orgId) || StringUtils.isEmpty(doctorId)){
            return resultMap;
    public JSONObject getOneDoctorInfo(String doctorId) throws Exception{
        JSONObject result = new JSONObject();
        if(StringUtils.isEmpty(doctorId)){
            result.put("msg","parameter doctorId is null ");
            result.put("response",ConstantUtils.FAIL);
            return result;
        }
        }
        //医生基本信息
        //医生基本信息
        List<BaseDoctorDO> doctors = this.findByField("id",doctorId);
        List<BaseDoctorDO> doctors = this.findByField("id",doctorId);
        if(CollectionUtils.isEmpty(doctors)){
        if(CollectionUtils.isEmpty(doctors)){
            return resultMap;
            result.put("msg","doctor not exist for id:" + doctorId);
            result.put("response",ConstantUtils.FAIL);
            return result;
        }
        }
        resultMap = JavaBeanUtils.getInstance().bean2Map(doctors.get(0));
        //医生执业信息
        String[] paramNames = {"hospCode","doctorCode"};
        Object[] paramValue = {orgId,doctorId};
        List<BaseDoctorHospitalDO> baseDoctorHospitalDOS = baseDoctorHospitalService.findByFields(paramNames,paramValue);
        if(CollectionUtils.isEmpty(baseDoctorHospitalDOS)){
            return resultMap;
        //医生归属业务模块角色信息
        String[] paramNames = {"doctorCode","del"};
        Object[] paramValue = {doctorId,"1"};
        List<BaseDoctorRoleDO> roleList = baseDoctorRoleService.findByFields(paramNames,paramValue);
        if(CollectionUtils.isEmpty(roleList)){
            result.put("msg","doctor role not exist for id:" + doctorId);
            result.put("response",ConstantUtils.FAIL);
            return result;
        }
        }
        Map<String,Object> doctorHospMap = JavaBeanUtils.getInstance().bean2Map(baseDoctorHospitalDOS.get(0));
        resultMap.putAll(doctorHospMap);
        return resultMap;
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("doctor",doctors.get(0));
        jsonObject.put("role",roleList);
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg",jsonObject);
        return result;
    }
    }
    /**
    /**
@ -111,6 +116,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                "  tb.sex as sex,  " +
                "  tb.sex as sex,  " +
                "  tb.mobile as mobile,  " +
                "  tb.mobile as mobile,  " +
                "  GROUP_CONCAT(tb.org SEPARATOR ',') as orgInfo,  " +
                "  GROUP_CONCAT(tb.org SEPARATOR ',') as orgInfo,  " +
                "  tb.job_title_name as jobTitleName,  " +
                "  tb.status as status " +
                "  tb.status as status " +
                "from  " +
                "from  " +
                "  (  " +
                "  (  " +
@ -120,7 +126,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                "     doc.idcard,  " +
                "     doc.idcard,  " +
                "     case doc.sex when 1 then '男' when 2 then '女' else '未知' end as sex,  " +
                "     case doc.sex when 1 then '男' when 2 then '女' else '未知' end as sex,  " +
                "     doc.mobile,  " +
                "     doc.mobile,  " +
                "     concat(hos.hosp_name,'/',dept.name,'/',hos.doctor_duty_name,'/',hos.job_title_name) as org,  " +
                "     concat(hos.org_name,'/',dept.name,'/',hos.doctor_duty_name) as org,  " +
                "     doc.job_title_name,  " +
                "     case doc.del when 0 then '无效' when 1 then '有效' end as status,  " +
                "     case doc.del when 0 then '无效' when 1 then '有效' end as status,  " +
                "      doc.create_time  " +
                "      doc.create_time  " +
                "   from  " +
                "   from  " +
@ -132,9 +139,9 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                "    and  " +
                "    and  " +
                "    hos.dept_code = dept.code  " +
                "    hos.dept_code = dept.code  " +
                "    and  " +
                "    and  " +
                "    ((doc.idcard like '{idcard}' or ''= '{idcard}'  ) and (hos.hosp_code = '{orgCode}' or ''= '{orgCode}') and (doc.del = '{docStatus}' or ''= '{docStatus}'))  " +
                "    ((doc.idcard like '{idcard}' or ''= '{idcard}'  ) and (hos.org_code = '{orgCode}' or ''= '{orgCode}') and (doc.del = '{docStatus}' or ''= '{docStatus}'))  " +
                "      or  " +
                "      or  " +
                "    ((doc.name like '{name}'  or ''= '{name}' )  and (hos.hosp_code = '{orgCode}' or ''= '{orgCode}') and (doc.del = '{docStatus}' or ''= '{docStatus}'))  " +
                "    ((doc.name like '{name}'  or ''= '{name}' )  and (hos.org_code = '{orgCode}' or ''= '{orgCode}') and (doc.del = '{docStatus}' or ''= '{docStatus}'))  " +
                "  ) tb  " +
                "  ) tb  " +
                "GROUP BY tb.id order by tb.create_time desc limit {start},{end} ";
                "GROUP BY tb.id order by tb.create_time desc limit {start},{end} ";
        String finalSql = sql
        String finalSql = sql
@ -156,9 +163,9 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                "    and " +
                "    and " +
                "    hos.dept_code = dept.code " +
                "    hos.dept_code = dept.code " +
                "    and " +
                "    and " +
                "    ((doc.idcard like '{idcard}' or ''= '{idcard}' ) and (hos.hosp_code = '{orgCode}' or ''= '{orgCode}') and (doc.del = '{docStatus}' or ''= '{docStatus}')) " +
                "    ((doc.idcard like '{idcard}' or ''= '{idcard}' ) and (hos.org_code = '{orgCode}' or ''= '{orgCode}') and (doc.del = '{docStatus}' or ''= '{docStatus}')) " +
                "      or " +
                "      or " +
                "    ((doc.name like '{name}' or ''= '{name}')  and (hos.hosp_code = '{orgCode}' or ''= '{orgCode}') and (doc.del = '{docStatus}' or ''= '{docStatus}')) ";
                "    ((doc.name like '{name}' or ''= '{name}')  and (hos.org_code = '{orgCode}' or ''= '{orgCode}') and (doc.del = '{docStatus}' or ''= '{docStatus}')) ";
        String finalCountSql = countSql
        String finalCountSql = countSql
                .replace("{idcard}",nameOrIdcardValue)
                .replace("{idcard}",nameOrIdcardValue)
                .replace("{name}",nameOrIdcardValue)
                .replace("{name}",nameOrIdcardValue)
@ -359,12 +366,12 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        for(BaseDoctorHospitalDO one : list){
        for(BaseDoctorHospitalDO one : list){
            OrgTree orgTreeParent = new OrgTree();
            OrgTree orgTreeParent = new OrgTree();
            orgTreeParent.setParentCode("");
            orgTreeParent.setParentCode("");
            orgTreeParent.setCode(one.getHospCode());
            orgTreeParent.setName(one.getHospName());
            orgTreeParent.setCode(one.getOrgCode());
            orgTreeParent.setName(one.getOrgName());
            orgTreeList.add(orgTreeParent);
            orgTreeList.add(orgTreeParent);
            OrgTree orgTreeChild = new OrgTree();
            OrgTree orgTreeChild = new OrgTree();
            orgTreeChild.setParentCode(one.getHospCode());
            orgTreeChild.setParentCode(one.getOrgCode());
            orgTreeChild.setCode(one.getDoctorDutyCode());
            orgTreeChild.setCode(one.getDoctorDutyCode());
            orgTreeChild.setName(one.getDoctorDutyName());
            orgTreeChild.setName(one.getDoctorDutyName());
            orgTreeList.add(orgTreeChild);
            orgTreeList.add(orgTreeChild);

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java

@ -12,11 +12,13 @@ import com.yihu.jw.base.service.user.UserRoleService;
import com.yihu.jw.base.service.user.UserService;
import com.yihu.jw.base.service.user.UserService;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.entity.base.org.BaseOrgSaasDO;
import com.yihu.jw.entity.base.org.BaseOrgUserDO;
import com.yihu.jw.entity.base.org.BaseOrgUserDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
@ -40,9 +42,15 @@ import java.util.*;
@Service
@Service
public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
    @Value("${configDefault.saasId}")
    private String defaultSaasId;
    @Autowired
    @Autowired
    private BaseOrgDao baseOrgDao;
    private BaseOrgDao baseOrgDao;
    @Autowired
    private BaseOrgSaasService baseOrgSaasService;
    @Autowired
    @Autowired
    private OrgTreeService orgTreeService;
    private OrgTreeService orgTreeService;
@ -146,6 +154,12 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
            baseOrgDO.setOrgAdmin(adminName);
            baseOrgDO.setOrgAdmin(adminName);
            baseOrgDao.save(baseOrgDO);
            baseOrgDao.save(baseOrgDO);
            //新增机构与saas关联关系,初始saas设置为默认值,机构分配给租户在租户管理中操作
            BaseOrgSaasDO baseOrgSaasDO = new BaseOrgSaasDO();
            baseOrgSaasDO.setOrgCode(baseOrgDO.getCode());
            baseOrgSaasDO.setSaasid(defaultSaasId);
            baseOrgSaasService.save(baseOrgSaasDO);
            //新增机构与管理员关联关系
            //新增机构与管理员关联关系
            BaseOrgUserDO baseOrgUserDO = new BaseOrgUserDO();
            BaseOrgUserDO baseOrgUserDO = new BaseOrgUserDO();
            baseOrgUserDO.setOrgCode(baseOrgDO.getCode());
            baseOrgUserDO.setOrgCode(baseOrgDO.getCode());

+ 22 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/role/BaseRoleMenuService.java

@ -0,0 +1,22 @@
package com.yihu.jw.base.service.role;
import com.yihu.jw.base.dao.role.BaseRoleMenuDao;
import com.yihu.jw.entity.base.role.BaseRoleMenuDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 
 * 角色菜单表服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong    1.0  2018年10月23日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class BaseRoleMenuService extends BaseJpaService<BaseRoleMenuDO, BaseRoleMenuDao> {
}

+ 22 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/role/BaseRoleModuleService.java

@ -0,0 +1,22 @@
package com.yihu.jw.base.service.role;
import com.yihu.jw.base.dao.role.BaseRoleModuleDao;
import com.yihu.jw.entity.base.role.BaseRoleModuleDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 
 * 业务模块角色服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong    1.0  2018年10月23日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class BaseRoleModuleService extends BaseJpaService<BaseRoleModuleDO, BaseRoleModuleDao> {
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -85,7 +85,7 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
    }
    }
    /**
    /**
     * 判断手机号是否存在
     * 判断用户名是否存在
     * @param username
     * @param username
     * @return
     * @return
     */
     */