浏览代码

svr-base部分bug修改,新增居民端微服务

LiTaohong 6 年之前
父节点
当前提交
59864260a4
共有 38 个文件被更改,包括 1281 次插入323 次删除
  1. 17 11
      common/common-entity/src/main/java/com/yihu/jw/entity/UuidIdentityEntityWithOperator.java
  2. 0 41
      common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserRoleDO.java
  3. 1 0
      common/common-exception/src/main/java/com/yihu/jw/exception/code/BaseErrorCode.java
  4. 6 11
      sql/init.sql
  5. 6 0
      svr/svr-base/pom.xml
  6. 4 2
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/module/ModuleDao.java
  7. 4 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/system/SystemDictEntryDao.java
  8. 0 12
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/user/UserRoleDao.java
  9. 14 6
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/module/ModuleEndpoint.java
  10. 0 94
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/module/ModuleFunctionEndpoint.java
  11. 6 5
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/role/RoleEndpoint.java
  12. 0 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasTypeDictEndpoint.java
  13. 10 1
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/system/SystemDictEntryEndpoint.java
  14. 0 96
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserRoleEndpoint.java
  15. 5 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorRoleInfoService.java
  16. 11 11
      svr/svr-base/src/main/java/com/yihu/jw/base/service/module/ModuleService.java
  17. 0 5
      svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java
  18. 0 3
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasService.java
  19. 0 7
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasTypeDictService.java
  20. 27 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/system/SystemDictEntryService.java
  21. 0 15
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserRoleService.java
  22. 1 1
      svr/svr-base/src/main/resources/bootstrap.yml
  23. 205 0
      svr/svr-patient/pom.xml
  24. 4 0
      svr/svr-patient/readme.MD
  25. 26 0
      svr/svr-patient/src/main/java/com/yihu/SvrPatientApplication.java
  26. 23 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/config/SpringSecurityAuditorAware.java
  27. 44 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/config/SwaggerDocs.java
  28. 16 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/util/ConstantUtils.java
  29. 26 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/util/ErrorCodeUtil.java
  30. 115 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/util/HttpUtil.java
  31. 259 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/util/JavaBeanUtils.java
  32. 109 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/util/MessageUtil.java
  33. 48 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/util/ValidateUtil.java
  34. 59 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/util/threadPool/ThreadPool.java
  35. 32 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/util/threadPool/ThreadPoolUtil.java
  36. 156 0
      svr/svr-patient/src/main/resources/application.yml
  37. 7 0
      svr/svr-patient/src/main/resources/banner.txt
  38. 40 0
      svr/svr-patient/src/main/resources/bootstrap.yml

+ 17 - 11
common/common-entity/src/main/java/com/yihu/jw/entity/UuidIdentityEntityWithOperator.java

@ -28,22 +28,33 @@ import java.util.Date;
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity {
    //创建时间
	@CreatedDate
	protected Date createTime;
	//创建者
    @CreatedBy
	protected String createUser;
	//创建者
	protected String createUserName;
	//更新时间
    //创建者
    @CreatedBy
    protected String createUserName;
    //更新时间
    @LastModifiedDate
	protected Date updateTime;
	//更新者
    @LastModifiedBy
	protected String updateUser;
	//更新者
    @LastModifiedBy
	protected String updateUserName;
	@CreatedDate
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	@Column(name = "create_time", nullable = false, length = 0,updatable = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time", nullable = false, length = 0,updatable = false)
	public Date getCreateTime() {
		return createTime;
	}
@ -52,7 +63,6 @@ public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity
		this.createTime = createTime;
	}
	@CreatedBy
	@Column(name = "create_user",updatable = false)
	public String getCreateUser() {
		return createUser;
@ -62,7 +72,6 @@ public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity
		this.createUser = createUser;
	}
	@CreatedBy
	@Column(name = "create_user_name",updatable = false)
	public String getCreateUserName() {
		return createUserName;
@ -72,7 +81,6 @@ public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity
		this.createUserName = createUserName;
	}
	@LastModifiedDate
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	@Column(name = "update_time", nullable = false, length = 0)
	public Date getUpdateTime() {
@ -83,7 +91,6 @@ public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity
		this.updateTime = updateTime;
	}
	@LastModifiedBy
	@Column(name = "update_user")
	public String getUpdateUser() {
		return updateUser;
@ -93,7 +100,6 @@ public abstract class UuidIdentityEntityWithOperator extends UuidIdentityEntity
		this.updateUser = updateUser;
	}
	@LastModifiedBy
	@Column(name = "update_user_name")
	public String getUpdateUserName() {
		return updateUserName;

+ 0 - 41
common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserRoleDO.java

@ -1,41 +0,0 @@
package com.yihu.jw.entity.base.user;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Entity - 用户角色
 * Created by progr1mmer on 2018/8/27.
 */
@Entity
@Table(name = "base_user_role")
public class UserRoleDO extends IntegerIdentityEntity {
	//用户ID
	private String userId;
	//角色ID
	private String roleId;
	@Column(name = "user_id", length = 50)
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	@Column(name = "role_id", length = 50)
	public String getRoleId() {
		return roleId;
	}
	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
}

+ 1 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/code/BaseErrorCode.java

@ -82,6 +82,7 @@ public class BaseErrorCode {
    public static class Module{
        public static final String FINDDICTBYCODE = "-103000";
        public static final String NAME_IS_EXIST = "-103001";
        public static final String NAME_OR_PARENTID_NULL = "-103002";
    }
    /**

+ 6 - 11
sql/init.sql

@ -66,8 +66,8 @@ CREATE TABLE `base_doctor` (
  `salt` varchar(50) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL COMMENT '姓名',
  `sex` char(2) DEFAULT NULL COMMENT '性别(1男,2女) 用国家标准字典',
  `expertise` varchar(300) DEFAULT NULL COMMENT '医生专长',
  `introduce` varchar(1500) DEFAULT NULL COMMENT '医生介绍',
  `expertise` varchar(150) DEFAULT NULL COMMENT '医生专长',
  `introduce` varchar(150) DEFAULT NULL COMMENT '医生介绍',
  `idcard` varchar(20) DEFAULT NULL COMMENT ' 身份证',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `photo` varchar(100) DEFAULT NULL COMMENT '头像http地址',
@ -706,15 +706,6 @@ CREATE TABLE `base_role_authority` (
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='角色权限';
Drop table IF EXISTS base_user_menu_role;
CREATE TABLE `base_user_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` varchar(50) CHARACTER SET utf8 NOT NULL COMMENT '用户ID',
  `role_id` varchar(50) CHARACTER SET utf8 NOT NULL COMMENT '角色编码',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='用户角色';
-- 基于MQ的消息推送
Drop table IF EXISTS `base_mq_message`;
CREATE TABLE `base_mq_message` (
@ -837,4 +828,7 @@ create table `patient_medicare_card`
  `patient_code` varchar(50) not null COMMENT '居民标识',
  primary key (id)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='居民医保关联卡';
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='居民医保关联卡';
-- 纠正base_role角色表中备注长度,改为150
alter table base_role modify column remark varchar(150);

+ 6 - 0
svr/svr-base/pom.xml

@ -171,6 +171,12 @@
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <!--   poi xml导入导出工具 end -->

+ 4 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/dao/module/ModuleDao.java

@ -18,8 +18,10 @@ public interface ModuleDao extends PagingAndSortingRepository<ModuleDO, String>,
    @Query("update ModuleDO p set p.status=?2 where p.id=?1")
    void updateStatus(String id,Integer status);
    @Query("select count(*) from ModuleDO a where a.name = ?1 ")
    int isExistName(String name);
    boolean existsByNameAndParentId(String name,String parentId);
    boolean existsByNameAndParentIdAndIdNot(String name,String parentId,String id);
    List<ModuleDO> findByParentId(String parentId);
}

+ 4 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/system/SystemDictEntryDao.java

@ -24,4 +24,8 @@ public interface SystemDictEntryDao extends PagingAndSortingRepository<SystemDic
    @Transactional
    @Query("delete from SystemDictEntryDO  where dictCode=?1")
    void deleteByDictCode(String dictCode);
    boolean existsBySaasIdAndCode(String saasid,String code);
    Integer countBySaasIdAndCodeNot(String saasid,String code);
}

+ 0 - 12
svr/svr-base/src/main/java/com/yihu/jw/base/dao/user/UserRoleDao.java

@ -1,12 +0,0 @@
package com.yihu.jw.base.dao.user;
import com.yihu.jw.entity.base.user.UserRoleDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Dao - 用户角色
 * Created by progr1mmer on 2018/8/20.
 */
public interface UserRoleDao extends PagingAndSortingRepository<UserRoleDO, Integer>, JpaSpecificationExecutor<UserRoleDO> {
}

+ 14 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/module/ModuleEndpoint.java

@ -44,8 +44,8 @@ public class ModuleEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        ModuleDO module = toEntity(jsonData, ModuleDO.class);
        int count = moduleService.isExistName(module.getName());
        if(count>0){
        Boolean exist = moduleService.isExistName(module.getName(),module.getParentId(),null);
        if(null != exist && exist){
            return failed(errorCodeUtil.getErrorMsg(BaseErrorCode.Module.NAME_IS_EXIST), ObjEnvelop.class);
        }
        module = moduleService.addModule(module);
@ -67,8 +67,16 @@ public class ModuleEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "名称是否存在",notes = "返回值中的obj=1表示名称已经存在,0表示名称不存在")
    public ObjEnvelop isNameExist(
            @ApiParam(name = "name", value = "名称", required = true)
            @RequestParam(value = "name") String name) {
        return success(moduleService.isExistName(name));
            @RequestParam(value = "name") String name,
            @ApiParam(name = "parentId", value = "父级模块id", required = true)
            @RequestParam(value = "parentId") String parentId,
            @ApiParam(name = "id", value = "模块id", required = false)
            @RequestParam(value = "id") String id) {
        Boolean exist = moduleService.isExistName(name,parentId,id);
        if(null == exist){
            return failed(errorCodeUtil.getErrorMsg(BaseErrorCode.Module.NAME_OR_PARENTID_NULL), ObjEnvelop.class);
        }
        return success(exist);
    }
    @PostMapping(value = BaseRequestMapping.Module.DELETE)
@ -89,8 +97,8 @@ public class ModuleEndpoint extends EnvelopRestEndpoint {
        if (null == module.getId()) {
            return failed(errorCodeUtil.getErrorMsg(BaseErrorCode.Common.ID_IS_NULL), ObjEnvelop.class);
        }
        int count = moduleService.isExistName(module.getName());
        if(count > 1){
        Boolean exist = moduleService.isExistName(module.getName(),module.getParentId(),module.getId());
        if(null != exist && exist){
            return failed(errorCodeUtil.getErrorMsg(BaseErrorCode.Module.NAME_IS_EXIST), ObjEnvelop.class);
        }
        module = moduleService.updateModule(module);

+ 0 - 94
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/module/ModuleFunctionEndpoint.java

@ -1,94 +0,0 @@
//package com.yihu.jw.base.endpoint.module;
//
//import com.yihu.jw.base.service.ModuleFunctionService;
//import com.yihu.jw.entity.base.module.ModuleFunctionDO;
//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;
//
///**
// * Created by progr1mmer on 2018/8/16.
// */
//@RestController
//@RequestMapping(value = BaseRequestMapping.ModuleFunction.PREFIX)
//@Api(value = "模块功能管理", description = "模块功能管理服务接口", tags = {"wlyy基础服务 - 模块功能管理服务接口"})
//public class ModuleFunctionEndpoint extends EnvelopRestEndpoint {
//
//    @Autowired
//    private ModuleFunctionService moduleFunctionService;
//
//    @PostMapping(value = BaseRequestMapping.ModuleFunction.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    @ApiOperation(value = "创建")
//    public ObjEnvelop<ModuleFunctionDO> create (
//            @ApiParam(name = "json_data", value = "Json数据", required = true)
//            @RequestBody String jsonData) throws Exception {
//        ModuleFunctionDO moduleFunctionDO = toEntity(jsonData, ModuleFunctionDO.class);
//        moduleFunctionDO = moduleFunctionService.save(moduleFunctionDO);
//        return success(moduleFunctionDO);
//    }
//
//    @PostMapping(value = BaseRequestMapping.ModuleFunction.DELETE)
//    @ApiOperation(value = "删除")
//    public Envelop delete(
//            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
//            @RequestParam(value = "ids") String ids) {
//        moduleFunctionService.delete(ids);
//        return success("删除成功");
//    }
//
//    @PostMapping(value = BaseRequestMapping.ModuleFunction.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    @ApiOperation(value = "更新")
//    public Envelop update (
//            @ApiParam(name = "json_data", value = "Json数据", required = true)
//            @RequestBody String jsonData) throws Exception {
//        ModuleFunctionDO moduleFunctionDO = toEntity(jsonData, ModuleFunctionDO.class);
//        if (null == moduleFunctionDO.getId()) {
//            return failed("ID不能为空", Envelop.class);
//        }
//        moduleFunctionDO = moduleFunctionService.save(moduleFunctionDO);
//        return success(moduleFunctionDO);
//    }
//
//    @GetMapping(value = BaseRequestMapping.ModuleFunction.PAGE)
//    @ApiOperation(value = "获取分页")
//    public PageEnvelop<ModuleFunctionDO> 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<ModuleFunctionDO> moduleFunctionDOS = moduleFunctionService.search(fields, filters, sorts, page, size);
//        int count = (int)moduleFunctionService.getCount(filters);
//        return success(moduleFunctionDOS, count, page, size);
//    }
//
//    @GetMapping(value = BaseRequestMapping.ModuleFunction.LIST)
//    @ApiOperation(value = "获取列表")
//    public ListEnvelop<ModuleFunctionDO> 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<ModuleFunctionDO> moduleFunctionDOS = moduleFunctionService.search(fields, filters, sorts);
//        return success(moduleFunctionDOS);
//    }
//
//}

+ 6 - 5
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/role/RoleEndpoint.java

@ -36,10 +36,13 @@ public class RoleEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseRequestMapping.Module.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<RoleVO> create (
    public Envelop create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        RoleDO roleDO = toEntity(jsonData, RoleDO.class);
        if(roleDO.getName().length() > 50){
            return failed("角色名称必填,但是请不要超过50个字符!");
        }
        if(roleDO.getId()!=null){
            roleDO.setUpdateUser(getUID());
            roleDO.setUpdateUserName(getUNAME());
@ -111,10 +114,8 @@ public class RoleEndpoint extends EnvelopRestEndpoint {
            @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<RoleDO> roleDOS = roleService.search(fields, filters, sorts);
            @RequestParam(value = "filters", required = false) String filters) throws Exception {
        List<RoleDO> roleDOS = roleService.search(fields, filters, "-status,-createTime");
        return success(roleDOS, RoleVO.class);
    }

+ 0 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasTypeDictEndpoint.java

@ -8,7 +8,6 @@ import com.yihu.jw.entity.base.module.ModuleDO;
import com.yihu.jw.entity.base.module.SaasTypeModuleDO;
import com.yihu.jw.entity.base.saas.SaasTypeDictDO;
import com.yihu.jw.restmodel.base.module.ModuleVO;
import com.yihu.jw.restmodel.base.module.SaasTypeModuleVO;
import com.yihu.jw.restmodel.base.saas.SaasTypeDictVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -22,7 +21,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.*;

+ 10 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/system/SystemDictEntryEndpoint.java

@ -51,6 +51,10 @@ public class SystemDictEntryEndpoint extends EnvelopRestEndpoint {
        if(StringUtils.isNotBlank(systemDictEntryDO.getValue())){
            systemDictEntryDO.setPyCode(PinyinUtil.getPinYinHeadChar(systemDictEntryDO.getValue(), true));
        }
        Boolean existCode = systemDictEntryService.existCode(systemDictEntryDO.getSaasId(),systemDictEntryDO.getCode());
        if(null != existCode && existCode){
            return failed("字典项编码已存在!",ObjEnvelop.class);
        }
        systemDictEntryDO = systemDictEntryService.save(systemDictEntryDO);
        return success(systemDictEntryDO, SystemDictEntryVO.class);
    }
@ -75,9 +79,14 @@ public class SystemDictEntryEndpoint extends EnvelopRestEndpoint {
        }
        if(StringUtils.isBlank(systemDictEntryDO.getDictCode())){
            return failed("字典编码不能为空!",ObjEnvelop.class);
        }if(StringUtils.isBlank(systemDictEntryDO.getCode())){
        }
        if(StringUtils.isBlank(systemDictEntryDO.getCode())){
            return failed("字典项编码不能为空!",ObjEnvelop.class);
        }
        Integer countCode = systemDictEntryService.countByCodeNot(systemDictEntryDO.getSaasId(),systemDictEntryDO.getCode());
        if(null != countCode && countCode > 0){
            return failed("字典项编码已存在,不可重复!",ObjEnvelop.class);
        }
        if(StringUtils.isBlank(systemDictEntryDO.getSaasId())){
            systemDictEntryDO.setSaasId(defaultSaasId);
        }

+ 0 - 96
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserRoleEndpoint.java

@ -1,96 +0,0 @@
package com.yihu.jw.base.endpoint.user;
import com.yihu.jw.base.service.user.UserRoleService;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.jw.restmodel.base.user.UserRoleVO;
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;
/**
 * Endpoint - 用户角色
 * Created by progr1mmer on 2018/8/16.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.UserRole.PREFIX)
@Api(value = "用户角色管理", description = "用户角色管理服务接口", tags = {"wlyy基础服务 - 用户角色管理服务接口"})
public class UserRoleEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private UserRoleService userRoleService;
    @PostMapping(value = BaseRequestMapping.UserRole.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<UserRoleVO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        UserRoleDO userRoleDO = toEntity(jsonData, UserRoleDO.class);
        userRoleDO = userRoleService.save(userRoleDO);
        return success(userRoleDO, UserRoleVO.class);
    }
    @PostMapping(value = BaseRequestMapping.UserRole.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        userRoleService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.UserRole.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新")
    public Envelop update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        UserRoleDO userRoleDO = toEntity(jsonData, UserRoleDO.class);
        if (null == userRoleDO.getId()) {
            return failed("ID不能为空", Envelop.class);
        }
        userRoleDO = userRoleService.save(userRoleDO);
        return success(userRoleDO);
    }
    @GetMapping(value = BaseRequestMapping.UserRole.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<UserRoleVO> 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<UserRoleDO> userRoleDOS = userRoleService.search(fields, filters, sorts, page, size);
        int count = (int)userRoleService.getCount(filters);
        return success(userRoleDOS, count, page, size, UserRoleVO.class);
    }
    @GetMapping(value = BaseRequestMapping.UserRole.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<UserRoleVO> 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<UserRoleDO> userRoleDOS = userRoleService.search(fields, filters, sorts);
        return success(userRoleDOS, UserRoleVO.class);
    }
}

+ 5 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorRoleInfoService.java

@ -152,6 +152,11 @@ public class BaseDoctorRoleInfoService extends BaseJpaService<BaseDoctorRoleInfo
            result.put("response", ConstantUtils.FAIL);
            return result;
        }
        if(StringUtils.isEmpty(role.getString("name")) || role.getString("name").length() > 50){
            result.put("msg", "角色名称必填,但是请不要超过50个字符!");
            result.put("response", ConstantUtils.FAIL);
            return result;
        }
        //组装角色信息
        BaseDoctorRoleInfoDO roleInfoDO = null;
        try {

+ 11 - 11
svr/svr-base/src/main/java/com/yihu/jw/base/service/module/ModuleService.java

@ -59,10 +59,8 @@ public class ModuleService extends BaseJpaService<ModuleDO, ModuleDao> {
            parentModule = moduleDao.findOne(moduleDO.getParentId());
            moduleDO.setLevel(parentModule.getLevel()+1);
        }
        moduleDO.setDel(1);
        moduleDO.setIsEnd(1);
        moduleDao.save(moduleDO);
        //父节点设置非根节点
        if(!CommonContant.DEFAULT_PARENTID.equals(moduleDO.getParentId())){
            if(ModuleDO.End.no.getValue().equals(parentModule.getIsEnd())){
@ -72,11 +70,11 @@ public class ModuleService extends BaseJpaService<ModuleDO, ModuleDao> {
        }
        //若新增某必选业务模块,则需为所有已创建的租户和租户类型添加此业务模块
        if(ModuleDO.Must.nonMust.getValue().equals(oldModule.getIsMust())&&
                ModuleDO.Must.must.getValue().equals(moduleDO.getIsMust())){
        if(ModuleDO.Must.nonMust.getValue().equals(oldModule.getIsMust())&& ModuleDO.Must.must.getValue().equals(moduleDO.getIsMust())){
            addSubModule(moduleDO);
        }
        moduleDao.save(moduleDO);
        return moduleDO;
    }
@ -138,7 +136,6 @@ public class ModuleService extends BaseJpaService<ModuleDO, ModuleDao> {
            List<SaasTypeModuleDO> saasTypeModuleDOList = new ArrayList<>(16);
            for (SaasTypeDictDO saasTypeDictDO : saasTypeDictDOs) {
                SaasTypeModuleDO saasTypeModuleDO = new SaasTypeModuleDO();
                saasTypeModuleDO.setCreateTime(new Date());
                saasTypeModuleDO.setDel(moduleDO.getDel());
                saasTypeModuleDO.setStatus(moduleDO.getStatus());
                saasTypeModuleDO.setIsEnd(moduleDO.getIsEnd());
@ -158,7 +155,6 @@ public class ModuleService extends BaseJpaService<ModuleDO, ModuleDao> {
                    int count = saasTypeModuleDao.isExistModule(parentModule.getId());
                    if(count==0){
                        SaasTypeModuleDO typeModuleDO = new SaasTypeModuleDO();
                        typeModuleDO.setCreateTime(new Date());
                        typeModuleDO.setDel(parentModule.getDel());
                        typeModuleDO.setStatus(parentModule.getStatus());
                        typeModuleDO.setIsEnd(parentModule.getIsEnd());
@ -183,7 +179,6 @@ public class ModuleService extends BaseJpaService<ModuleDO, ModuleDao> {
            List<SaasModuleDO> saasModuleDOList = new ArrayList<>(16);
            for (SaasDO saasDO : saasDOs) {
                SaasModuleDO saasModuleDO = new SaasModuleDO();
                saasModuleDO.setCreateTime(new Date());
                saasModuleDO.setDel(moduleDO.getDel());
                saasModuleDO.setStatus(moduleDO.getStatus());
                saasModuleDO.setIsEnd(moduleDO.getIsEnd());
@ -203,7 +198,6 @@ public class ModuleService extends BaseJpaService<ModuleDO, ModuleDao> {
                    int count = saasModuleDao.isExistModule(parentModule.getId());
                    if(count==0){
                        SaasModuleDO saasModule = new SaasModuleDO();
                        saasModule.setCreateTime(new Date());
                        saasModule.setDel(parentModule.getDel());
                        saasModule.setStatus(parentModule.getStatus());
                        saasModule.setIsEnd(parentModule.getIsEnd());
@ -285,12 +279,18 @@ public class ModuleService extends BaseJpaService<ModuleDO, ModuleDao> {
    }
    /**
     * 名称是否存在
     * 同一个父级下的子菜单名称不可相同
     * @param name
     * @return
     */
    public int isExistName(String name){
        return moduleDao.isExistName(name);
    public Boolean isExistName(String name,String parentId,String id){
        if(StringUtils.isEmpty(name) || StringUtils.isEmpty(name)){
            return null;
        }
        if(StringUtils.isEmpty(id)){
            return moduleDao.existsByNameAndParentId(name,parentId);
        }
        return moduleDao.existsByNameAndParentIdAndIdNot(name,parentId,id);
    }
    public ModuleDO findOne(String id){

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

@ -8,14 +8,12 @@ import com.yihu.jw.base.dao.org.BaseOrgDao;
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.TreeNode;
import com.yihu.jw.base.service.user.UserRoleService;
import com.yihu.jw.base.service.user.UserService;
import com.yihu.jw.base.util.ConstantUtils;
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.user.UserDO;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -58,9 +56,6 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
    @Autowired
    private UserService userService;
    @Autowired
    private UserRoleService userRoleService;
    @Autowired
    private  BaseOrgUserService baseOrgUserService;

+ 0 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasService.java

@ -12,7 +12,6 @@ import com.yihu.jw.base.dao.saas.SaasThemeExtendDao;
import com.yihu.jw.base.dao.system.SystemDictDao;
import com.yihu.jw.base.dao.system.SystemDictEntryDao;
import com.yihu.jw.base.dao.user.UserDao;
import com.yihu.jw.base.dao.user.UserRoleDao;
import com.yihu.jw.base.service.dict.DictHospitalDeptService;
import com.yihu.jw.entity.base.dict.*;
import com.yihu.jw.entity.base.module.ModuleDO;
@ -58,8 +57,6 @@ public class SaasService extends BaseJpaService<SaasDO, SaasDao> {
    @Autowired
    private RoleDao roleDao;
    @Autowired
    private UserRoleDao userRoleDao;
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private SystemDictDao systemDictDao;

+ 0 - 7
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasTypeDictService.java

@ -2,18 +2,11 @@ package com.yihu.jw.base.service.saas;
import com.yihu.jw.base.dao.module.ModuleDao;
import com.yihu.jw.base.dao.module.SaasTypeModuleDao;
import com.yihu.jw.base.dao.role.RoleDao;
import com.yihu.jw.base.dao.saas.SaasTypeDictDao;
import com.yihu.jw.base.dao.user.UserDao;
import com.yihu.jw.base.dao.user.UserRoleDao;
import com.yihu.jw.entity.base.module.ModuleDO;
import com.yihu.jw.entity.base.module.SaasTypeModuleDO;
import com.yihu.jw.entity.base.role.RoleDO;
import com.yihu.jw.entity.base.saas.SaasTypeDictDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.hibernate.SQLQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

+ 27 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/system/SystemDictEntryService.java

@ -6,6 +6,7 @@ import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
/**
 * Service - 系统字典项
@ -24,4 +25,30 @@ public class SystemDictEntryService extends BaseJpaService<SystemDictEntryDO, Sy
    public void deleteByDictCode(String dictCode) {
        systemDictEntryDao.deleteByDictCode(dictCode);
    }
    /**
     * 字典项代码是否存在,某一个租户下的字典项代码不可重复
     * @param saasid
     * @param code
     * @return
     */
    public Boolean existCode(String saasid,String code){
        if(StringUtils.isEmpty(saasid) || StringUtils.isEmpty(code)){
            return null;
        }
        return systemDictEntryDao.existsBySaasIdAndCode(saasid,code);
    }
    /**
     * 字典项代码更新时,代码的修改值不可重复
     * @param saasid
     * @param code
     * @return
     */
    public Integer countByCodeNot(String saasid,String code){
        if(StringUtils.isEmpty(saasid) || StringUtils.isEmpty(code)){
            return null;
        }
        return systemDictEntryDao.countBySaasIdAndCodeNot(saasid,code);
    }
}

+ 0 - 15
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserRoleService.java

@ -1,15 +0,0 @@
package com.yihu.jw.base.service.user;
import com.yihu.jw.base.dao.user.UserRoleDao;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Service - 用户角色
 * Created by progr1mmer on 2018/8/20.
 */
@Service
public class UserRoleService extends BaseJpaService<UserRoleDO, UserRoleDao> {
}

+ 1 - 1
svr/svr-base/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-base
    name: svr-base-lith
  cloud:
    config:
      failFast: true

+ 205 - 0
svr/svr-patient/pom.xml

@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>wlyy-parent-pom</artifactId>
        <version>2.0.0</version>
        <relativePath>../../wlyy-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>svr-patient</artifactId>
    <packaging>war</packaging>
    <version>${parent.version}</version>
    <dependencies>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <!--注释掉就不会读取git的配置,只会读取yml中的配置-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>org.springframework.cloud</groupId>-->
            <!--<artifactId>spring-cloud-starter-zipkin</artifactId>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-activemq</artifactId>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-exception</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-web</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.yihu.jw</groupId>-->
            <!--<artifactId>common-tracer</artifactId>-->
        <!--</dependency>-->
        <!-- 文件服务器 -->
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>fastdfs-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <!-- Jzkl Starter -->
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>swagger-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>elasticsearch-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>io.github.swagger2markup</groupId>
            <artifactId>swagger2markup</artifactId>
            <version>1.3.2</version>
            <exclusions>
                <exclusion>
                    <artifactId>mailapi</artifactId>
                    <groupId>javax.mail</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- 发送邮件 -->
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <!--   poi xml导入导出工具 start-->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.yihu.ehr</groupId>
                    <artifactId>commons-util</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-collections4</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
        </dependency>
        <!-- xlsx  依赖这个包 -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <!--   poi xml导入导出工具 end -->
    </dependencies>
    <build>
        <finalName>svr-base</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>com.yihu.SvrPatientApplication</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

+ 4 - 0
svr/svr-patient/readme.MD

@ -0,0 +1,4 @@
基础微服务
    每个模块有自己独立的文件夹,这样做的好处是以后如果哪个模块需要独立成微服务,代码直接剪切到新的微服务即可。
    每个模块下面有独立的Endpoint,service,model和dao
  

+ 26 - 0
svr/svr-patient/src/main/java/com/yihu/SvrPatientApplication.java

@ -0,0 +1,26 @@
package com.yihu;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
/**
 * Created by chenweida on 2017/5/10.
 * localhost:10020/refresh  刷新当个微服务的配置 可以在需要刷新的bean上面@RefreshScope
 */
@SpringBootApplication
@EnableJpaAuditing
public class SvrPatientApplication extends SpringBootServletInitializer {
    public static void main(String[] args)  {
        SpringApplication.run(SvrPatientApplication.class, args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SvrPatientApplication.class);
    }
}

+ 23 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/config/SpringSecurityAuditorAware.java

@ -0,0 +1,23 @@
package com.yihu.jw.patient.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import java.util.Optional;
@Configuration
public class SpringSecurityAuditorAware implements AuditorAware {
    @Override
    public Object getCurrentAuditor() {
//        return Optional.ofNullable(SecurityContextHolder.getContext())
//                .map(SecurityContext::getAuthentication)
//                .filter(Authentication::isAuthenticated)
//                .map(Authentication::getPrincipal);
////                .map(Authentication::getDetails);
        return "123";
    }
}

+ 44 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/config/SwaggerDocs.java

@ -0,0 +1,44 @@
package com.yihu.jw.patient.config;
import io.github.swagger2markup.GroupBy;
import io.github.swagger2markup.Language;
import io.github.swagger2markup.Swagger2MarkupConfig;
import io.github.swagger2markup.Swagger2MarkupConverter;
import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder;
import io.github.swagger2markup.markup.builder.MarkupLanguage;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
 * Created by lith on 2018/11/23.
 */
public class SwaggerDocs {
    public static void main(String[] args) throws Exception {
        //1.请求 http://ip:port/swagger-resources获取group
        String group = "Default";
        //2.定义请求地址 new URL("http://ip:port/v2/api-docs?group=" + groupName)
        //项目的swagger-ui地址
        URL remoteSwaggerFile = new URL("http://127.0.0.1:10021/v2/api-docs?group=" + group);
        //3.定义文件输出路径
        String prefix = Thread.currentThread().getContextClassLoader().getResource("").getPath();
        //文档输出地址
        Path outputFile = Paths.get(prefix.substring(prefix.lastIndexOf(":") + 1, prefix.indexOf("target") - 1) + "/build/" + group);
        Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
                .withMarkupLanguage(MarkupLanguage.ASCIIDOC)
                .withOutputLanguage(Language.ZH)
                .withPathsGroupedBy(GroupBy.TAGS)
                .withGeneratedExamples()
                .withoutInlineSchema()
                //.withBasePathPrefix()
                .build();
        Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(remoteSwaggerFile)
                .withConfig(config)
                .build();
        converter.toFile(outputFile);
    }
}

+ 16 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/util/ConstantUtils.java

@ -0,0 +1,16 @@
package com.yihu.jw.patient.util;
/**
 * @author litaohong on 2018/10/11
 * @project jw2.0
 */
public class ConstantUtils {
    public static final String SUCCESS = "success";
    public static final String FAIL = "fail";
    // 状态失效
    public static final String STATUS_0 = "0";
    // 状态有效
    public static final String STATUS_1 = "1";
}

+ 26 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/util/ErrorCodeUtil.java

@ -0,0 +1,26 @@
package com.yihu.jw.patient.util;
import com.yihu.jw.exception.code.BaseErrorCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
/**
 * 错误码工具类
 * @author yeshijie on 2018/9/26.
 */
@Component
public class ErrorCodeUtil {
    @Autowired
    private StringRedisTemplate redisTemplate;
    /**
     * 根据错误码获取错误提示信息
     * @param errorCode
     * @return
     */
    public String getErrorMsg(String errorCode){
        return redisTemplate.opsForValue().get(BaseErrorCode.PREFIX + errorCode);
    }
}

+ 115 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/util/HttpUtil.java

@ -0,0 +1,115 @@
package com.yihu.jw.patient.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
/*
 * MD5 算法
 */
public class HttpUtil {
    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
    /**
     * 向指定URL发送GET方法的请求
     *
     * @param url
     *            发送请求的URL
     * @param param
     *            请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
     * @return URL 所代表远程资源的响应结果
     */
    public static String sendGet(String url, String param) {
        String result = "";
        BufferedReader in = null;
        try {
            String urlNameString = url + "?" + param;
            URL realUrl = new URL(urlNameString);
            // 打开和URL之间的连接
            URLConnection connection = realUrl.openConnection();
            // 设置通用的请求属性
            connection.setRequestProperty("accept", "*/*");
            connection.setRequestProperty("connection", "Keep-Alive");
            connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
            // 建立实际的连接
            connection.connect();
            // 定义 BufferedReader输入流来读取URL的响应
            in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            String line;
            while ((line = in.readLine()) != null) {
                result += line;
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (in != null) {
                    in.close();
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
        return result;
    }
    /**
     * 向指定 URL 发送POST方法的请求
     *
     * @param url
     *            发送请求的 URL带上参数
     * @param param
     *            POST参数。
     * @return 所代表远程资源的响应结果
     */
    public static String sendPost(String url, String param) {
        StringBuffer buffer = new StringBuffer();
        OutputStreamWriter osw = null;
        BufferedReader in = null;
        HttpURLConnection conn = null;
        try {
            URL realUrl = new URL(url);
            // 打开和URL之间的连接
            conn = (HttpURLConnection) realUrl.openConnection();
            conn.setRequestMethod("POST");
            conn.setConnectTimeout(5000);
            conn.setDoOutput(true);
            conn.setDoInput(true);
            conn.setUseCaches(false);
            conn.setRequestProperty("Content-Type", "application/text");
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
            osw = new OutputStreamWriter(conn.getOutputStream(), "UTF-8");
            osw.write(param.toString());
            osw.flush();
            // 读取返回内容
            in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
            String temp;
            while ((temp = in.readLine()) != null) {
                buffer.append(temp);
                buffer.append("\n");
            }
        } catch (Exception e) {
            logger.error("push message error:", e);
        } finally {
            try {
                if (osw != null) {
                    osw.close();
                }
                if (in != null) {
                    in.close();
                }
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
        return buffer.toString();
    }
}

+ 259 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/util/JavaBeanUtils.java

@ -0,0 +1,259 @@
package com.yihu.jw.patient.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.util.CollectionUtils;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.*;
/**
 * @author litaohong on 2018/9/10
 * @project jw2.0
 */
public class JavaBeanUtils {
    private static JavaBeanUtils javaBeanUtils = null;
    private JavaBeanUtils(){}
    public static JavaBeanUtils getInstance(){
        if (javaBeanUtils == null) {
            synchronized (JavaBeanUtils.class) {
                if (javaBeanUtils == null) {
                    javaBeanUtils = new JavaBeanUtils();
                }
                if (objectMapper == null) {
                    objectMapper = new ObjectMapper();
                }
            }
        }
        return javaBeanUtils;
    }
    private static ObjectMapper objectMapper = null;
    /**
     * 将一个 Map 对象转化为一个 JavaBean
     *
     * @param type
     *            要转化的类型
     * @param map
     *            包含属性值的 map
     * @return 转化出来的 JavaBean 对象
     * @throws IntrospectionException
     *             如果分析类属性失败
     * @throws IllegalAccessException
     *             如果实例化 JavaBean 失败
     * @throws InstantiationException
     *             如果实例化 JavaBean 失败
     * @throws InvocationTargetException
     *             如果调用属性的 setter 方法失败
     */
    @SuppressWarnings("unchecked")
    public  Object map2Bean(Class type, Map map)
            throws IntrospectionException, IllegalAccessException,
            InstantiationException, InvocationTargetException {
        Object obj = type.newInstance(); // 创建 JavaBean 对象
        BeanUtils.populate(obj, map);
        return obj;
    }
    /**
     * 将一个 JavaBean 对象转化为一个 Map
     *
     * @param bean
     *            要转化的JavaBean 对象
     * @return 转化出来的 Map 对象
     * @throws IntrospectionException
     *             如果分析类属性失败
     * @throws IllegalAccessException
     *             如果实例化 JavaBean 失败
     * @throws InvocationTargetException
     *             如果调用属性的 setter 方法失败
     */
    @SuppressWarnings("unchecked")
    public  Map bean2Map(Object bean) throws IntrospectionException,
            IllegalAccessException, InvocationTargetException {
        Class type = bean.getClass();
        Map returnMap = new HashMap();
        BeanInfo beanInfo = Introspector.getBeanInfo(type);
        PropertyDescriptor[] propertyDescriptors = beanInfo
                .getPropertyDescriptors();
        for (int i = 0; i < propertyDescriptors.length; i++) {
            PropertyDescriptor descriptor = propertyDescriptors[i];
            String propertyName = descriptor.getName();
            if (!propertyName.equals("class")) {
                Method readMethod = descriptor.getReadMethod();
                Object result = readMethod.invoke(bean, new Object[0]);
                if (result != null) {
                    returnMap.put(propertyName, result);
                } else {
                    returnMap.put(propertyName, "");
                }
            }
        }
        return returnMap;
    }
    /**
     * 将对象集合转为集合map
     *
     * @describe:TODO
     * @param beans
     * @return
     * @throws IllegalAccessException
     * @throws InvocationTargetException
     * @throws IntrospectionException
     * @time:2014年9月3日上午10:37:32
     */
    @SuppressWarnings("unchecked")
    public  List<Map> beans2Maps(List<Object> beans)
            throws IllegalAccessException, InvocationTargetException,
            IntrospectionException {
        List<Map> maps = new ArrayList<Map>();
        for (Iterator iterator = beans.iterator(); iterator.hasNext();) {
            Object bean = (Object) iterator.next();
            maps.add(bean2Map(bean));
        }
        return maps;
    }
    /**
     * 将对多个Map转对对象集合返回
     *
     * @describe:TODO
     * @param type
     * @param maps
     * @return
     * @throws IntrospectionException
     * @throws IllegalAccessException
     * @throws InstantiationException
     * @throws InvocationTargetException
     * @time:2014年9月3日上午10:40:00
     */
    @SuppressWarnings("unchecked")
    public  List<Object> mapstoBeans(Class type, List<Map> maps)
            throws IntrospectionException, IllegalAccessException,
            InstantiationException, InvocationTargetException {
        List<Object> beans = new ArrayList<Object>();
        for (Map map : maps) {
            beans.add(map2Bean(type, map));
        }
        return beans;
    }
    /**
     * 对象复制
     *
     * @describe:TODO
     * @param toBean
     *            目标对象
     * @param fromBean
     *            对象来源
     * @return
     * @throws IllegalAccessException
     * @throws InvocationTargetException
     * @time:2014年9月3日上午11:47:45
     */
    public  Object copyProperties(Object toBean, Object fromBean)
            throws IllegalAccessException, InvocationTargetException {
        if (fromBean == null) {
            return null;
        }
        org.springframework.beans.BeanUtils.copyProperties(toBean, fromBean);
        return toBean;
    }
    /**
     * 对象复制(将给定的对象转化为给定的Class 类型对象并返回)
     *
     * @describe:TODO
     * @param toClassBean
     * @param fromBean
     * @return
     * @throws IllegalAccessException
     * @throws InvocationTargetException
     * @throws InstantiationException
     * @throws ClassNotFoundException
     * @time:2014年9月3日下午12:05:23
     */
    public  Object copyProperties(Class toClassBean, Object fromBean)
            throws IllegalAccessException, InvocationTargetException,
            InstantiationException, ClassNotFoundException {
        if (fromBean == null) {
            return null;
        }
        Object toBean = Class.forName(toClassBean.getCanonicalName())
                .newInstance();
        return copyProperties(toBean, fromBean);
    }
    /**
     * 将给定的对象集合转换为指定的类对象集合
     *
     * @describe:TODO
     * @param toClassBean
     *            类 类型
     * @param beans
     *            对象集合
     * @return
     * @throws IllegalAccessException
     * @throws InvocationTargetException
     * @throws InstantiationException
     * @throws ClassNotFoundException
     * @time:2014年9月3日下午12:33:24
     */
    public List copyProperties(Class toClassBean, List beans)
            throws IllegalAccessException, InvocationTargetException,
            InstantiationException, ClassNotFoundException {
        List list = new ArrayList();
        for (Iterator iterator = beans.iterator(); iterator.hasNext();) {
            Object object = (Object) iterator.next();
            list.add(copyProperties(toClassBean, object));
        }
        return list;
    }
    /**
     * map转为json
     * @return
     */
    public String mapJson(Map<String, Object> map) throws Exception {
        if (CollectionUtils.isEmpty(map)) {
            return "paramter is null";
        }
        List<Map<String, Object>> result = new ArrayList<>();
        JSONArray jsonArray = new JSONArray();
        JSONObject jsonObject = JSONObject.parseObject(objectMapper.writeValueAsString(map));
        return jsonArray.toJSONString();
    }
    /**
     * map转为json
     * @return
     */
    public JSONArray mapListJson(Collection mapList) throws Exception {
        JSONArray jsonArray = new JSONArray();
        if (CollectionUtils.isEmpty(mapList)) {
            return jsonArray;
        }
        for(Object map : mapList){
            JSONObject jsonObject = JSONObject.parseObject(objectMapper.writeValueAsString(map));
            jsonArray.add(jsonObject);
        }
        return jsonArray;
    }
}

+ 109 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/util/MessageUtil.java

@ -0,0 +1,109 @@
package com.yihu.jw.patient.util;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by Administrator on 2017/5/23 0023.
 */
public class MessageUtil {
    /**
     * 返回消息类型:文本
     */
    public static final String RESP_MESSAGE_TYPE_TEXT = "text";
    /**
     * 返回消息类型:音乐
     */
    public static final String RESP_MESSAGE_TYPE_MUSIC = "music";
    /**
     * 返回消息类型:图文
     */
    public static final String RESP_MESSAGE_TYPE_NEWS = "news";
    /**
     * 请求消息类型:文本
     */
    public static final String REQ_MESSAGE_TYPE_TEXT = "text";
    /**
     * 请求消息类型:图片
     */
    public static final String REQ_MESSAGE_TYPE_IMAGE = "image";
    /**
     * 请求消息类型:链接
     */
    public static final String REQ_MESSAGE_TYPE_LINK = "link";
    /**
     * 请求消息类型:地理位置
     */
    public static final String REQ_MESSAGE_TYPE_LOCATION = "location";
    /**
     * 请求消息类型:音频
     */
    public static final String REQ_MESSAGE_TYPE_VOICE = "voice";
    /**
     * 请求消息类型:推送
     */
    public static final String REQ_MESSAGE_TYPE_EVENT = "event";
    /**
     * 事件类型:subscribe(订阅)
     */
    public static final String EVENT_TYPE_SUBSCRIBE = "subscribe";
    /**
     * 事件类型:unsubscribe(取消订阅)
     */
    public static final String EVENT_TYPE_UNSUBSCRIBE = "unsubscribe";
    /**
     * 事件类型:CLICK(自定义菜单点击事件)
     */
    public static final String EVENT_TYPE_CLICK = "CLICK";
    /**
     * 解析微信发来的请求(XML)
     *
     * @param request
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    public static Map<String, String> parseXml(HttpServletRequest request) throws Exception {
        // 将解析结果存储在HashMap中
        Map<String, String> map = new HashMap<String, String>();
        // 从request中取得输入流
        InputStream inputStream = request.getInputStream();
        // 读取输入流
        SAXReader reader = new SAXReader();
        Document document = reader.read(inputStream);
        // 得到xml根元素
        Element root = document.getRootElement();
        // 得到根元素的所有子节点
        List<Element> elementList = root.elements();
        // 遍历所有子节点
        for (Element e : elementList)
            map.put(e.getName(), e.getText());
        // 释放资源
        inputStream.close();
        inputStream = null;
        return map;
    }
}

+ 48 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/util/ValidateUtil.java

@ -0,0 +1,48 @@
package com.yihu.jw.patient.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * @author yeshijie on 2018/10/18.
 */
public class ValidateUtil {
    /**
     * 验证是否为正确的邮箱号
     *
     * @param email
     * @return
     */
    public static boolean isValidEmail(String email) {
        // 1、\\w+表示@之前至少要输入一个匹配字母或数字或下划线 \\w 单词字符:[a-zA-Z_0-9]
        // 2、(\\w+\\.)表示域名. 如新浪邮箱域名是sina.com.cn
        // {1,3}表示可以出现一次或两次或者三次.
        String reg = "\\w+@(\\w+\\.){1,3}\\w+";
        Pattern pattern = Pattern.compile(reg);
        boolean flag = false;
        if (email != null) {
            Matcher matcher = pattern.matcher(email);
            flag = matcher.matches();
        }
        return flag;
    }
    /**
     * 验证是否为手机号
     *
     * @param mobileNo
     * @return
     */
    public static boolean isValidMobileNo(String mobileNo) {
        // 1、1开头 11位数字
        boolean flag = false;
        String reg = "^1\\d{10}$";
        Pattern pattern = Pattern.compile(reg);
        Matcher match = pattern.matcher(mobileNo);
        if (mobileNo != null) {
            flag = match.matches();
        }
        return flag;
    }
}

+ 59 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/util/threadPool/ThreadPool.java

@ -0,0 +1,59 @@
package com.yihu.jw.patient.util.threadPool;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
/**
 * @author yeshijie on 2018/10/10.
 */
@Configuration
public class ThreadPool {
    /**
     * 线程池核心线程数
     */
    private int CORE_POOL_SIZE = 5;
    /**
     * 线程池最大线程数
     */
    private int MAX_POOL_SIZE = 100;
    /**
     * 额外线程空状态生存时间
     */
    private int KEEP_ALIVE_TIME = 10000;
    /**
     * 额外线程空状态生存时间单位秒
     */
    private TimeUnit unit = TimeUnit.SECONDS;
    /**
     * 阻塞队列。当核心线程都被占用,且阻塞队列已满的情况下,才会开启额外线程。
     */
    private BlockingQueue workQueue = new ArrayBlockingQueue(10);
    /**
     * 线程池对拒绝任务(无线程可用)的处理策略 ThreadPoolExecutor.CallerRunsPolicy策略 ,调用者的线程会执行该任务,如果执行器已关闭,则丢弃.
     */
    private RejectedExecutionHandler rejectedExecutionHandler = new ThreadPoolExecutor.AbortPolicy();
    /**
     * 线程工厂
     */
    private ThreadFactory threadFactory = new ThreadFactory() {
        private final AtomicInteger integer = new AtomicInteger();
        @Override
        public Thread newThread(Runnable r) {
            return new Thread(r, "myThreadPool thread:" + integer.getAndIncrement());
        }
    };
    @Bean
    ThreadPoolUtil threadPoolUtil(){
        ThreadPoolExecutor threadPool = new ThreadPoolExecutor(CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME,
                unit, workQueue, threadFactory ,rejectedExecutionHandler);
        ThreadPoolUtil threadPoolUtil = new ThreadPoolUtil(threadPool);
        return threadPoolUtil;
    }
}

+ 32 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/util/threadPool/ThreadPoolUtil.java

@ -0,0 +1,32 @@
package com.yihu.jw.patient.util.threadPool;
import java.util.concurrent.FutureTask;
import java.util.concurrent.ThreadPoolExecutor;
/**
 * @author yeshijie on 2018/9/30.
 */
public class ThreadPoolUtil {
    /**
     * 线程池
     */
    private ThreadPoolExecutor threadPool;
    public ThreadPoolUtil(ThreadPoolExecutor threadPool) {
        this.threadPool = threadPool;
    }
    public void execute(Runnable runnable) {
        threadPool.execute(runnable);
    }
    public void execute(FutureTask futureTask) {
        threadPool.execute(futureTask);
    }
    public void cancel(FutureTask futureTask) {
        futureTask.cancel(true);
    }
}

+ 156 - 0
svr/svr-patient/src/main/resources/application.yml

@ -0,0 +1,156 @@
#通用的配置不用区分环境变量
server:
  port: ${server.svr-patient-port}
spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 50
    max-idle: 50 #最大空闲连接
    min-idle: 10 #最小空闲连接
    validation-query-timeout: 20
    log-validation-errors: true
    validation-interval: 60000 #避免过度验证,保证验证不超过这个频率——以毫秒为单位。如果一个连接应该被验证,但上次验证未达到指定间隔,将不再次验证。
    validation-query: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
    test-on-borrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
    test-on-return: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
    idle-timeout: 30000
    connection-test-query: SELECT 1
    num-tests-per-eviction-run: 50 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
    test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
#  sleuth:
#    sampler:
#      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
  redis:
    database: 0 # Database index used by the connection factory.
    password: # Login password of the redis server.
    timeout: 120000 # 连接超时时间(毫秒) 60秒
    pool:
      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
      max-wait: -1  # 连接池最大阻塞等待时间(使用负值表示没有限制)
      max-idle: 20  # 连接池中的最大空闲连接
      min-idle: 5  # 连接池中的最小空闲连接
  mail:
    default-encoding: UTF-8
#端口
    port: 25
#协议
    protocol: smtp
    properties.mail.smtp.auth: true
    properties.mail.smtp.starttls.enable: true
    properties.mail.smtp.starttls.required: true
    host: smtp.163.com
#发送者的邮箱密码
    password: xmijk181016jkzl
#发送者的邮箱账号
    username: i_jiankang@163.com
es:
  index:
    servicePackLog: base_service_package_log
  type:
    servicePackLog: base_service_package_log
fast-dfs:
  tracker-server: 172.19.103.54:22122 #服务器地址
  connect-timeout: 2 #链接超时时间
  network-timeout: 30
  charset: ISO8859-1 #编码
  http:
    tracker-http-port: 80
    anti-steal-token: no
    secret-key: FastDFS1234567890
  pool: #连接池大小
    init-size: 5
    max-size: 20
    wait-time: 500
configDefault: # 默认配置
  saasId: xmjkzl_saasId
---
spring:
  profiles: jwdev
  datasource:
#    url: jdbc:mysql://172.17.110.160/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#    username: ssgg
#    password: ssgg
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.19.103.87:61616
    user: admin
    password: admin
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
#  zipkin:
#    base-url: http://localhost:9411 #日志追踪的地址
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
# 短信发送地址
jw:
  smsUrl: http://svr-base:10020/sms_gateway/send
---
spring:
  profiles: jwtest
  datasource:
    url: jdbc:mysql://172.17.110.160/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: ssgg
    password: ssgg
#    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
#    username: root
#    password: 123456
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.19.103.87:61616
    user: admin
    password: admin
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
---
spring:
  profiles: prod
  datasource:
    url: jdbc:mysql://59.61.92.90:9069/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: wlyy
    password: jkzlehr@123
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 59.61.92.90:9066,59.61.92.90:9068 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://59.61.92.90:9065,http://59.61.92.90:9067
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/

+ 7 - 0
svr/svr-patient/src/main/resources/banner.txt

@ -0,0 +1,7 @@
                                  _    _               _   
 ___ __   __ _ __   _ __    __ _ | |_ (_)  ___  _ __  | |_ 
/ __|\ \ / /| '__| | '_ \  / _` || __|| | / _ \| '_ \ | __|
\__ \ \ V / | |    | |_) || (_| || |_ | ||  __/| | | || |_ 
|___/  \_/  |_|    | .__/  \__,_| \__||_| \___||_| |_| \__|
                   |_|                                     

+ 40 - 0
svr/svr-patient/src/main/resources/bootstrap.yml

@ -0,0 +1,40 @@
spring:
  application:
    name: svr-patient
  cloud:
    config:
      failFast: true
      username: jw
      password: jkzl
---
spring:
  profiles: jwdev
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.17.110.212:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: jwtest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.17.110.212:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: prod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.153:1221}
      label: ${wlyy.spring.config.label:prod}
---
spring:
  profiles: local
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.153:1221}
      label: ${wlyy.spring.config.label:local}