作者 啊雷

畅悦息重构

正在显示 85 个修改的文件 包含 4682 行增加0 行删除

要显示太多修改。

为保证性能只显示 85 of 85+ 个文件。

  1 +######################################################################
  2 +# Build Tools
  3 +
  4 +.gradle
  5 +/build/
  6 +!gradle/wrapper/gradle-wrapper.jar
  7 +
  8 +target/
  9 +!.mvn/wrapper/maven-wrapper.jar
  10 +
  11 +######################################################################
  12 +# IDE
  13 +
  14 +### STS ###
  15 +.apt_generated
  16 +.classpath
  17 +.factorypath
  18 +.project
  19 +.settings
  20 +.springBeans
  21 +
  22 +### IntelliJ IDEA ###
  23 +.idea
  24 +*.iws
  25 +*.iml
  26 +*.ipr
  27 +
  28 +### NetBeans ###
  29 +nbproject/private/
  30 +build/*
  31 +nbbuild/
  32 +dist/
  33 +nbdist/
  34 +.nb-gradle/
  35 +
  36 +######################################################################
  37 +# Others
  38 +*.log
  39 +*.xml.versionsBackup
  40 +
  41 +!*/build/*.java
  42 +!*/build/*.html
  43 +!*/build/*.xml
  1 +MIT License
  2 +
  3 +Copyright (c) 2020 若依
  4 +
  5 +Permission is hereby granted, free of charge, to any person obtaining a copy
  6 +of this software and associated documentation files (the "Software"), to deal
  7 +in the Software without restriction, including without limitation the rights
  8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9 +copies of the Software, and to permit persons to whom the Software is
  10 +furnished to do so, subject to the following conditions:
  11 +
  12 +The above copyright notice and this permission notice shall be included in all
  13 +copies or substantial portions of the Software.
  14 +
  15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21 +SOFTWARE.
  1 +## 平台简介
  2 +
  3 +若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
  4 +
  5 +* 采用前后端分离的模式,微服务版本前端(基于 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue))。
  6 +* 后端采用Spring Boot、Spring Cloud & Alibaba。
  7 +* 注册中心、配置中心选型Nacos,权限认证使用Redis。
  8 +* 流量控制框架选型Sentinel,分布式事务选型Seata。
  9 +* 如需不分离应用,请移步 [RuoYi](https://gitee.com/y_project/RuoYi),如需分离应用,请移步 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)
  10 +* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)  
  11 +* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  
  12 +
  13 +#### 友情链接 [若依/RuoYi-Cloud](https://gitee.com/zhangmrit/ruoyi-cloud) Ant Design版本。
  14 +
  15 +## 系统模块
  16 +
  17 +~~~
  18 +cn.brotop
  19 +├── ruoyi-ui // 前端框架 [80]
  20 +├── ruoyi-gateway // 网关模块 [8080]
  21 +├── ruoyi-auth // 认证中心 [9200]
  22 +├── ruoyi-api // 接口模块
  23 +│ └── ruoyi-api-system // 系统接口
  24 +├── ruoyi-common // 通用模块
  25 +│ └── ruoyi-common-core // 核心模块
  26 +│ └── ruoyi-common-datascope // 权限范围
  27 +│ └── ruoyi-common-datasource // 多数据源
  28 +│ └── ruoyi-common-log // 日志记录
  29 +│ └── ruoyi-common-redis // 缓存服务
  30 +│ └── ruoyi-common-security // 安全模块
  31 +│ └── ruoyi-common-swagger // 系统接口
  32 +├── ruoyi-modules // 业务模块
  33 +│ └── ruoyi-system // 系统模块 [9201]
  34 +│ └── ruoyi-gen // 代码生成 [9202]
  35 +│ └── ruoyi-job // 定时任务 [9203]
  36 +│ └── ruoyi-file // 文件服务 [9300]
  37 +├── ruoyi-visual // 图形化管理模块
  38 +│ └── ruoyi-visual-monitor // 监控中心 [9100]
  39 +├──pom.xml // 公共依赖
  40 +~~~
  41 +
  42 +## 架构图
  43 +
  44 +<img src="https://oscimg.oschina.net/oscnet/up-82e9722ecb846786405a904bafcf19f73f3.png"/>
  45 +
  46 +## 内置功能
  47 +
  48 +1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
  49 +2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
  50 +3. 岗位管理:配置系统用户所属担任职务。
  51 +4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
  52 +5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
  53 +6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
  54 +7. 参数管理:对系统动态配置常用参数。
  55 +8. 通知公告:系统通知公告信息发布维护。
  56 +9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
  57 +10. 登录日志:系统登录日志记录查询包含登录异常。
  58 +11. 在线用户:当前系统中活跃用户状态监控。
  59 +12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
  60 +13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。
  61 +14. 系统接口:根据业务代码自动生成相关的api接口文档。
  62 +15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。
  63 +16. 在线构建器:拖动表单元素生成相应的HTML代码。
  64 +17. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
  65 +
  66 +## 在线体验
  67 +
  68 +- admin/admin123
  69 +- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
  70 +
  71 +演示地址:http://ruoyi.vip
  72 +文档地址:http://doc.ruoyi.vip
  73 +
  74 +## 演示图
  75 +
  76 +<table>
  77 + <tr>
  78 + <td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
  79 + <td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
  80 + </tr>
  81 + <tr>
  82 + <td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
  83 + <td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
  84 + </tr>
  85 + <tr>
  86 + <td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
  87 + <td><img src="https://oscimg.oschina.net/oscnet/up-4148b24f58660a9dc347761e4cf6162f28f.png"/></td>
  88 + </tr>
  89 + <tr>
  90 + <td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
  91 + <td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
  92 + </tr>
  93 + <tr>
  94 + <td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
  95 + <td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
  96 + </tr>
  97 + <tr>
  98 + <td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
  99 + <td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
  100 + </tr>
  101 + <tr>
  102 + <td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
  103 + <td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
  104 + </tr>
  105 + <tr>
  106 + <td><img src="https://oscimg.oschina.net/oscnet/up-ece3fd37a3d4bb75a3926e905a3c5629055.png"/></td>
  107 + <td><img src="https://oscimg.oschina.net/oscnet/up-92ffb7f3835855cff100fa0f754a6be0d99.png"/></td>
  108 + </tr>
  109 + <tr>
  110 + <td><img src="https://oscimg.oschina.net/oscnet/up-ff9e3066561574aca73005c5730c6a41f15.png"/></td>
  111 + <td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
  112 + </tr>
  113 +</table>
  114 +
  115 +
  116 +## 若依微服务交流群
  117 +
  118 +QQ群: [![加入QQ群](https://img.shields.io/badge/已满-42799195-blue.svg)](https://jq.qq.com/?_wv=1027&k=yqInfq0S) [![加入QQ群](https://img.shields.io/badge/已满-170157040-blue.svg)](https://jq.qq.com/?_wv=1027&k=Oy1mb3p8) [![加入QQ群](https://img.shields.io/badge/已满-130643120-blue.svg)](https://jq.qq.com/?_wv=1027&k=rvxkJtXK) [![加入QQ群](https://img.shields.io/badge/225920371-blue.svg)](https://jq.qq.com/?_wv=1027&k=0Ck3PvTe) 点击按钮入群。
  1 +@echo off
  2 +echo.
  3 +echo [Ϣ] ·
  4 +echo.
  5 +
  6 +%~d0
  7 +cd %~dp0
  8 +
  9 +cd ..
  10 +call mvn clean
  11 +
  12 +pause
  1 +@echo off
  2 +echo.
  3 +echo [信息] 打包Web工程,生成war/jar包文件。
  4 +echo.
  5 +
  6 +%~d0
  7 +cd %~dp0
  8 +
  9 +cd ..
  10 +call mvn clean package -Dmaven.test.skip=true
  11 +
  12 +pause
  1 +@echo off
  2 +echo.
  3 +echo [Ϣ] auth̡
  4 +echo.
  5 +
  6 +cd %~dp0
  7 +cd ../ruoyi-auth/target
  8 +
  9 +set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
  10 +
  11 +java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-auth.jar
  12 +
  13 +cd bin
  14 +pause
  1 +@echo off
  2 +echo.
  3 +echo [Ϣ] gateway̡
  4 +echo.
  5 +
  6 +cd %~dp0
  7 +cd ../ruoyi-gateway/target
  8 +
  9 +set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
  10 +
  11 +java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-gateway.jar
  12 +
  13 +cd bin
  14 +pause
  1 +@echo off
  2 +echo.
  3 +echo [Ϣ] modules-file̡
  4 +echo.
  5 +
  6 +cd %~dp0
  7 +cd ../ruoyi-modules/ruoyi-file/target
  8 +
  9 +set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
  10 +
  11 +java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-modules-file.jar
  12 +
  13 +cd bin
  14 +pause
  1 +@echo off
  2 +echo.
  3 +echo [Ϣ] modules-gen̡
  4 +echo.
  5 +
  6 +cd %~dp0
  7 +cd ../ruoyi-modules/ruoyi-gen/target
  8 +
  9 +set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
  10 +
  11 +java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-modules-gen.jar
  12 +
  13 +cd bin
  14 +pause
  1 +@echo off
  2 +echo.
  3 +echo [Ϣ] modules-job̡
  4 +echo.
  5 +
  6 +cd %~dp0
  7 +cd ../ruoyi-modules/ruoyi-job/target
  8 +
  9 +set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
  10 +
  11 +java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-modules-job.jar
  12 +
  13 +cd bin
  14 +pause
  1 +@echo off
  2 +echo.
  3 +echo [Ϣ] modules-system̡
  4 +echo.
  5 +
  6 +cd %~dp0
  7 +cd ../ruoyi-modules/ruoyi-system/target
  8 +
  9 +set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
  10 +
  11 +java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-modules-system.jar
  12 +
  13 +cd bin
  14 +pause
  1 +@echo off
  2 +echo.
  3 +echo [Ϣ] monitor̡
  4 +echo.
  5 +
  6 +cd %~dp0
  7 +cd ../ruoyi-visual/ruoyi-monitor/target
  8 +
  9 +set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
  10 +
  11 +java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-visual-monitor.jar
  12 +
  13 +cd bin
  14 +pause
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.brotop</groupId>
  7 + <artifactId>bro-admin-api</artifactId>
  8 + <version>1.0.0</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 +
  12 + <artifactId>bro-admin-api-auth</artifactId>
  13 +
  14 + <dependencies>
  15 + <!-- RuoYi Common Core-->
  16 + <dependency>
  17 + <groupId>cn.brotop</groupId>
  18 + <artifactId>bro-admin-common-core</artifactId>
  19 + </dependency>
  20 + </dependencies>
  21 +
  22 + <properties>
  23 + <maven.compiler.source>8</maven.compiler.source>
  24 + <maven.compiler.target>8</maven.compiler.target>
  25 + </properties>
  26 +
  27 +</project>
  1 +package cn.brotop.api.auth.service;
  2 +
  3 +import cn.brotop.common.core.domain.R;
  4 +
  5 +/**
  6 + * @author 啊雷
  7 + * @version 1.0
  8 + * @date 2021/2/18 15:12
  9 + */
  10 +public interface WxServiceRpc {
  11 +
  12 + /**
  13 + *
  14 + * 获取access_token
  15 + * @return R<String>
  16 + */
  17 + R<String> getAccessToken();
  18 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.brotop</groupId>
  7 + <artifactId>bro-admin-api</artifactId>
  8 + <version>1.0.0</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 +
  12 + <artifactId>bro-admin-api-doctor</artifactId>
  13 +
  14 + <properties>
  15 + <maven.compiler.source>8</maven.compiler.source>
  16 + <maven.compiler.target>8</maven.compiler.target>
  17 + </properties>
  18 +
  19 + <dependencies>
  20 + <!-- RuoYi Common Core-->
  21 + <dependency>
  22 + <groupId>cn.brotop</groupId>
  23 + <artifactId>bro-admin-common-core</artifactId>
  24 + </dependency>
  25 + </dependencies>
  26 +
  27 +</project>
  1 +package cn.brotop.api.doctor.DTO;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.io.Serializable;
  6 +import java.math.BigDecimal;
  7 +import java.time.LocalDateTime;
  8 +
  9 +/**
  10 + * @author 啊雷
  11 + * @version 1.0
  12 + * @date 2021/2/22 16:17
  13 + */
  14 +@Data
  15 +public class DoctorDTO implements Serializable {
  16 +
  17 +
  18 + /**
  19 + * id
  20 + */
  21 + private Long id;
  22 +
  23 + /**
  24 + * 医生名称
  25 + */
  26 + private String doctorName;
  27 +
  28 + /**
  29 + * 医生头想
  30 + */
  31 + private String doctorAvatar;
  32 +
  33 + /**
  34 + * 医生职称id
  35 + */
  36 + private Long doctorJobTitleId;
  37 +
  38 + /**
  39 + * 医生职称名称
  40 + */
  41 + private String doctorJobTitleName;
  42 +
  43 + /**
  44 + * 医生泪飙明细
  45 + */
  46 + private String doctorListDetail;
  47 +
  48 + /**
  49 + * 医院id
  50 + */
  51 + private Long doctorHospitalId;
  52 +
  53 + /**
  54 + * 医生名称
  55 + */
  56 + private String doctorHospitalName;
  57 +
  58 + /**
  59 + * 医院去id
  60 + */
  61 + private Long doctorHospitalCountyId;
  62 +
  63 + /**
  64 + * 0 不在线 1在线
  65 + */
  66 + private Integer doctorOnline;
  67 +
  68 + /**
  69 + * 医生创建时间
  70 + */
  71 + private LocalDateTime doctorCreated;
  72 +
  73 + /**
  74 + * 0 隐藏 1显示
  75 + */
  76 + private Integer doctorStatus;
  77 +
  78 + /**
  79 + * 医生好评率
  80 + */
  81 + private BigDecimal doctorPraise;
  82 +
  83 + /**
  84 + * 医生咨询量
  85 + */
  86 + private Integer doctorAdvisoryNum;
  87 +
  88 + /**
  89 + *
  90 + 相应时间(分)
  91 + */
  92 + private Integer doctorCorrespondingTime;
  93 +
  94 + /**
  95 + * 二级科室id
  96 + */
  97 + private Long doctorDepartmentTwoId;
  98 +
  99 + /**
  100 + * 图文问诊价格
  101 + */
  102 + private BigDecimal doctorGraphicConsultationPrice;
  103 +
  104 + /**
  105 + * 医生电话价格
  106 + */
  107 + private BigDecimal doctorPhonePrice;
  108 +
  109 + /**
  110 + * 医生推荐理由
  111 + */
  112 + private String doctorRecommend;
  113 +
  114 + /**
  115 + * 特邀标签
  116 + */
  117 + private String doctorSpecialInvitation;
  118 +
  119 + /**
  120 + * 专家标签
  121 + */
  122 + private String doctorLabel;
  123 +
  124 + /**
  125 + * 擅长领域
  126 + */
  127 + private String doctorAreasOfExpertise;
  128 +
  129 + /**
  130 + * 医生简介
  131 + */
  132 + private String doctorProfile;
  133 +
  134 + /**
  135 + * 执业经历
  136 + */
  137 + private String doctorPracticeExperience;
  138 +}
  1 +package cn.brotop.api.doctor.DTO;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.io.Serializable;
  6 +
  7 +@Data
  8 +public class DoctorPhoneDTO implements Serializable {
  9 + private Long id;
  10 +
  11 + private String dcotorAvatar;
  12 +
  13 + private String doctorPhone;
  14 +
  15 + private String doctorPassword;
  16 +}
  1 +package cn.brotop.api.doctor.DTO;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.io.Serializable;
  6 +import java.math.BigDecimal;
  7 +
  8 +/**
  9 + * @author 啊雷
  10 + * @version 1.0
  11 + * @date 2021/2/23 9:36
  12 + */
  13 +@Data
  14 +public class DoctorRushDTO implements Serializable {
  15 +
  16 + private Long id;
  17 +
  18 + private BigDecimal graphicPrice;
  19 +
  20 + private BigDecimal phonePrice;
  21 +}
  1 +package cn.brotop.api.doctor.DTO;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.io.Serializable;
  6 +import java.time.LocalDateTime;
  7 +
  8 +/**
  9 + * @author 啊雷
  10 + * @version 1.0
  11 + * @date 2021/2/19 16:08
  12 + */
  13 +@Data
  14 +public class UserDoctorAttentionDTO implements Serializable {
  15 +
  16 + private Long id;
  17 +
  18 + /**
  19 + * 医生id
  20 + */
  21 + private Long doctorId;
  22 +
  23 + /**
  24 + * 用户id
  25 + */
  26 + private Long userId;
  27 +
  28 + /**
  29 + * 关注时间
  30 + */
  31 + private LocalDateTime created;
  32 +}
  1 +package cn.brotop.api.doctor.DoctorVO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +/**
  9 + * @author 啊雷
  10 + * @version 1.0
  11 + * @date 2021/2/2 14:41
  12 + */
  13 +@Data
  14 +public class DepartmentVO {
  15 +
  16 + @JsonSerialize(using = ToStringSerializer.class)
  17 + @ApiModelProperty(value = "id")
  18 + private Long id;
  19 +
  20 + @ApiModelProperty(value = "名称")
  21 + private String name;
  22 +}
  1 +package cn.brotop.api.doctor.DoctorVO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +import java.io.Serializable;
  9 +import java.time.LocalDateTime;
  10 +
  11 +@Data
  12 +public class DoctorVOS implements Serializable {
  13 + @ApiModelProperty(value = "医生id")
  14 + @JsonSerialize(using = ToStringSerializer.class)
  15 + private Long doctorId;
  16 +
  17 + @ApiModelProperty(value = "患者id")
  18 + private Long patient;
  19 +
  20 + @ApiModelProperty(value = "患者名称")
  21 + private String patientName;
  22 +
  23 + @ApiModelProperty(value = "患者头像")
  24 + private String patientAvater;
  25 +
  26 + @ApiModelProperty(value = "患者性别")
  27 + private Integer patientGender;
  28 +
  29 + @ApiModelProperty(value = "患者年龄")
  30 + private Integer patientAge;
  31 +
  32 + @ApiModelProperty(value = "患者病例详情")
  33 + private String illnessDescription;
  34 +
  35 + @ApiModelProperty(value = "创建时间")
  36 + private LocalDateTime createdTime;
  37 +
  38 + @ApiModelProperty(value = "问诊方式")
  39 + private Integer inquiryWay;
  40 +
  41 + @ApiModelProperty(value = "问诊状态")
  42 + private Integer status;
  43 +
  44 +}
  1 +package cn.brotop.api.doctor;
  2 +
  3 +import cn.brotop.api.doctor.DTO.DoctorRushDTO;
  4 +import cn.brotop.api.doctor.DoctorVO.DepartmentVO;
  5 +import cn.brotop.api.doctor.DTO.DoctorDTO;
  6 +import cn.brotop.api.doctor.DTO.DoctorPhoneDTO;
  7 +import cn.brotop.api.doctor.factory.RemoteDoctorFallbackFactory;
  8 +import cn.brotop.common.core.constant.ServiceNameConstants;
  9 +import cn.brotop.common.core.domain.R;
  10 +import org.springframework.cloud.openfeign.FeignClient;
  11 +import org.springframework.web.bind.annotation.*;
  12 +
  13 +import java.util.List;
  14 +import java.util.Map;
  15 +
  16 +/**
  17 + * 医生模块服务
  18 + * @author 啊雷
  19 + * @version 1.0
  20 + * @date 2021/2/19 16:04
  21 + */
  22 +@FeignClient(contextId = "remoteDoctorService", value = ServiceNameConstants.DOCTOR_SERVICE, fallbackFactory = RemoteDoctorFallbackFactory.class)
  23 +public interface RemoteDoctorService {
  24 + /**
  25 + * 根据手机 查询用户信息
  26 + * @param mobile 手机号
  27 + * @return R<UserDTO>
  28 + */
  29 + @GetMapping(value = "/remote_doctor/findDoctorByMobile/{mobile}")
  30 + R<DoctorPhoneDTO> findDoctorByMobile(@PathVariable("mobile") String mobile);
  31 +
  32 + /**
  33 + * 新增
  34 + * @param doctorPhoneDTO doctorPhoneDTO
  35 + * @return R<?>
  36 + */
  37 + @PostMapping(value = "/remote_doctor/saveDoctor")
  38 + R<?> saveDoctor(@RequestBody DoctorPhoneDTO doctorPhoneDTO);
  39 + /**
  40 + * 查询关注的医生
  41 + * @param list list
  42 + * @param userId 用户id
  43 + * @return R<Map<Long,Integer>>
  44 + */
  45 + @PostMapping(value = "/remote_doctor/findByUserAttention")
  46 + R<Map<Long,Integer>> findByUserAttention(List<Long> list, Long userId);
  47 +
  48 + /**
  49 + * 查询用户id
  50 + * @param doctorId 医生id
  51 + * @return R<DoctorDTO>
  52 + */
  53 + @GetMapping(value = "/remote_doctor/findById/{doctorId}")
  54 + R<DoctorDTO> findById(@PathVariable("doctorId")Long doctorId);
  55 +
  56 + /**
  57 + * 查询抢单医生价格
  58 + * @return R<DoctorRushDTO>
  59 + */
  60 + @GetMapping(value = "/remote_doctor/find")
  61 + R<DoctorRushDTO> find();
  62 +
  63 + /**
  64 + * 根据用户查询医生id
  65 + */
  66 + @GetMapping(value = "/remote_doctor/findUserDcotor/{userId}")
  67 + R<DoctorDTO> findUserDcotor(@PathVariable("userId") Long userId);
  68 +
  69 + /**
  70 + * 查询一级所有的科室
  71 + * @return List<DepartmentVO>
  72 + */
  73 + @GetMapping(value = "/remote_doctor/list")
  74 + R<List<DepartmentVO>> list();
  75 +
  76 + /**
  77 + * 根据一级查询二级
  78 + * @param departmentId 一级分类
  79 + * @return List<DepartmentVO>
  80 + */
  81 + @GetMapping(value = "/remote_doctor/listByParent")
  82 + R<List<DepartmentVO>> listByParent(@RequestParam("departmentId") Long departmentId);
  83 +
  84 +}
  1 +package cn.brotop.api.doctor.factory;
  2 +
  3 +import cn.brotop.api.doctor.DTO.DoctorDTO;
  4 +import cn.brotop.api.doctor.DTO.DoctorPhoneDTO;
  5 +import cn.brotop.api.doctor.DTO.DoctorRushDTO;
  6 +import cn.brotop.api.doctor.DoctorVO.DepartmentVO;
  7 +import cn.brotop.api.doctor.RemoteDoctorService;
  8 +import cn.brotop.common.core.domain.R;
  9 +import cn.brotop.common.core.utils.StringUtils;
  10 +import feign.hystrix.FallbackFactory;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +
  14 +import java.util.List;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * @program: Rejoie-Admin-Cloud
  19 + * @className: RemoteDoctorFallbackFactory
  20 + * @description: 医生模块服务异常返回
  21 + * @author: alei
  22 + * @create: 2021-05-18 16:35
  23 + **/
  24 +public class RemoteDoctorFallbackFactory implements FallbackFactory<RemoteDoctorService> {
  25 + private static final Logger log = LoggerFactory.getLogger(RemoteDoctorFallbackFactory.class);
  26 + @Override
  27 + public RemoteDoctorService create(Throwable throwable)
  28 + {
  29 + log.error("用户服务调用失败:{}", throwable.getMessage());
  30 + return new RemoteDoctorService()
  31 + {
  32 +
  33 + @Override
  34 + public R<DoctorPhoneDTO> findDoctorByMobile(String mobile) {
  35 + if (StringUtils.isBlank(mobile)){
  36 + return R.fail("手机号为空!");
  37 + }
  38 + return R.fail("数据请求失败!");
  39 + }
  40 +
  41 + @Override
  42 + public R<?> saveDoctor(DoctorPhoneDTO doctorPhoneDTO) {
  43 + return R.fail("数据请求失败!");
  44 + }
  45 +
  46 + @Override
  47 + public R<Map<Long, Integer>> findByUserAttention(List<Long> list, Long userId) {
  48 + return R.fail("数据请求失败!");
  49 + }
  50 +
  51 + @Override
  52 + public R<DoctorDTO> findById(Long doctorId) {
  53 + return R.fail("数据请求失败!");
  54 + }
  55 +
  56 + @Override
  57 + public R<DoctorRushDTO> find() {
  58 + return R.fail("数据请求失败!");
  59 + }
  60 +
  61 + @Override
  62 + public R<DoctorDTO> findUserDcotor(Long userId) {
  63 + return R.fail("数据请求失败!");
  64 + }
  65 +
  66 + @Override
  67 + public R<List<DepartmentVO>> list() {
  68 + return R.fail("数据请求失败!");
  69 + }
  70 +
  71 + @Override
  72 + public R<List<DepartmentVO>> listByParent(Long departmentId) {
  73 + return R.fail("数据请求失败!");
  74 + }
  75 + };
  76 + }
  77 +
  78 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.brotop</groupId>
  7 + <artifactId>bro-admin-api</artifactId>
  8 + <version>1.0.0</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 +
  12 + <artifactId>bro-admin-api-hospital</artifactId>
  13 +
  14 + <properties>
  15 + <maven.compiler.source>8</maven.compiler.source>
  16 + <maven.compiler.target>8</maven.compiler.target>
  17 + </properties>
  18 +
  19 + <dependencies>
  20 + <!-- RuoYi Common Core-->
  21 + <dependency>
  22 + <groupId>cn.brotop</groupId>
  23 + <artifactId>bro-admin-common-core</artifactId>
  24 + </dependency>
  25 + </dependencies>
  26 +
  27 +</project>
  1 +package cn.brotop.api.hospital.DTO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +/**
  9 + * @author xxj
  10 + * @version 1.0
  11 + * @date 2021/2/3 14:09
  12 + */
  13 +@Data
  14 +public class HospitalDTO {
  15 + @ApiModelProperty(value = "医院id")
  16 + @JsonSerialize(using = ToStringSerializer.class)
  17 + private Long id;
  18 + @ApiModelProperty(value = "医院名称")
  19 + private String hospitalName;
  20 + @ApiModelProperty(value = "区id")
  21 + private Long hospitalCountyId;
  22 +}
  1 +package cn.brotop.api.hospital.DTO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +import java.io.Serializable;
  9 +
  10 +/**
  11 + * @author 啊雷
  12 + * @version 1.0
  13 + * @date 2021/2/3 14:09
  14 + */
  15 +@Data
  16 +public class HospitalRpcDTO implements Serializable {
  17 +
  18 + @ApiModelProperty(value = "医院id")
  19 + @JsonSerialize(using = ToStringSerializer.class)
  20 + private Long hospitalId;
  21 +
  22 + @ApiModelProperty(value = "医院名称")
  23 + private String hospitalName;
  24 +
  25 + @ApiModelProperty(value = "医院等级")
  26 + private String hospitalLevel;
  27 +
  28 +}
  1 +package cn.brotop.api.hospital;
  2 +
  3 +import cn.brotop.api.hospital.DTO.HospitalDTO;
  4 +import cn.brotop.api.hospital.DTO.HospitalRpcDTO;
  5 +import cn.brotop.api.hospital.VO.CityVO;
  6 +import cn.brotop.api.hospital.VO.CountyVO;
  7 +import cn.brotop.api.hospital.VO.ProvinceVO;
  8 +import cn.brotop.api.hospital.factory.RemoteHospitalFallbackFactory;
  9 +import cn.brotop.common.core.constant.ServiceNameConstants;
  10 +import cn.brotop.common.core.domain.R;
  11 +import org.springframework.cloud.openfeign.FeignClient;
  12 +import org.springframework.web.bind.annotation.GetMapping;
  13 +import org.springframework.web.bind.annotation.PostMapping;
  14 +import org.springframework.web.bind.annotation.RequestBody;
  15 +import org.springframework.web.bind.annotation.RequestParam;
  16 +
  17 +import java.util.List;
  18 +
  19 +/**
  20 + * 医院模块API服务
  21 + * @author 啊雷
  22 + * @version 1.0
  23 + * @date 2021/2/3 16:19
  24 + */
  25 +@FeignClient(contextId = "remoteHospitalService", value = ServiceNameConstants.HOSPITAL_SERVICE, fallbackFactory = RemoteHospitalFallbackFactory.class)
  26 +public interface RemoteHospitalService {
  27 +
  28 + /**
  29 + * 查询医院信息
  30 + * @param hospitalIds ids
  31 + * @return R<List<HospitalRpcDTO>>
  32 + */
  33 + @PostMapping(value = "/remote_hospital/findByHospitalIds")
  34 + R<List<HospitalRpcDTO>> findByHospitalIds(@RequestBody List<Long> hospitalIds);
  35 +
  36 + /**
  37 + * 查询医院信息
  38 + * @param hospitalId 医院id
  39 + * @return R<HospitalRpcDTO>
  40 + */
  41 + @GetMapping(value = "/remote_hospital/findByHospitalId")
  42 + R<HospitalRpcDTO> findByHospitalId(@RequestParam("hospitalId") Long hospitalId);
  43 + /**
  44 + * 获取省
  45 + * @return 省列表
  46 + */
  47 + @GetMapping(value = "/remote_hospital/getProvince")
  48 + R<List<ProvinceVO>> getProvince();
  49 +
  50 + /**
  51 + * 获取市
  52 + * @param provinceId 省id
  53 + * @return 市列表
  54 + */
  55 + @GetMapping(value = "/remote_hospital/getCity")
  56 + R<List<CityVO>> getCity(@RequestParam("provinceId") Long provinceId);
  57 +
  58 + /**
  59 + * 获取区
  60 + * @param cityId 城市id
  61 + * @return 区列表
  62 + */
  63 + @GetMapping(value = "/remote_hospital/getCounty")
  64 + R<List<CountyVO>> getCounty(@RequestParam("cityId") Long cityId);
  65 +
  66 + /**
  67 + * 获取区下所有医院
  68 + * @param countyId 区id
  69 + * @return 区下医院列表
  70 + */
  71 + @GetMapping(value = "/remote_hospital/getHospital")
  72 + R<List<HospitalDTO>> getHospital(@RequestParam("countyId") Long countyId);
  73 +
  74 +// /**
  75 +// * 根据输入的名称查询医院
  76 +// * @param hospitalName 医院名称
  77 +// */
  78 +// R<HospitalRpcDTO> getOneHospital(String hospitalName);
  79 +
  80 +}
  1 +package cn.brotop.api.hospital.VO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +/**
  9 + * @author 啊雷
  10 + * @version 1.0
  11 + * @date 2021/2/1 10:54
  12 + */
  13 +@Data
  14 +public class CityVO {
  15 +
  16 + @ApiModelProperty(value = "城市名称")
  17 + private String name;
  18 +
  19 + @JsonSerialize(using = ToStringSerializer.class)
  20 + @ApiModelProperty(value = "城市id")
  21 + private Long cityId;
  22 +
  23 + @JsonSerialize(using = ToStringSerializer.class)
  24 + @ApiModelProperty(value = "省id")
  25 + private Long provinceId;
  26 +}
  1 +package cn.brotop.api.hospital.VO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +/**
  9 + * @author 啊雷
  10 + * @version 1.0
  11 + * @date 2021/2/1 10:56
  12 + */
  13 +@Data
  14 +public class CountyVO {
  15 +
  16 +
  17 + @ApiModelProperty(value = "区名称")
  18 + private String name;
  19 +
  20 + @JsonSerialize(using = ToStringSerializer.class)
  21 + @ApiModelProperty(value = "区id")
  22 + private Long countyId;
  23 +
  24 + @JsonSerialize(using = ToStringSerializer.class)
  25 + @ApiModelProperty(value = "城市id")
  26 + private Long cityId;
  27 +}
  1 +package cn.brotop.api.hospital.VO;
  2 +
  3 +
  4 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  5 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.Data;
  8 +
  9 +import java.io.Serializable;
  10 +
  11 +/**
  12 + * @author 啊雷
  13 + * @version 1.0
  14 + * @date 2021/2/1 10:52
  15 + */
  16 +@Data
  17 +public class ProvinceVO implements Serializable{
  18 +
  19 + @JsonSerialize(using = ToStringSerializer.class)
  20 + @ApiModelProperty(value = "省id")
  21 + private Long provinceId;
  22 +
  23 + @ApiModelProperty(value = "省名称")
  24 + private String name;
  25 +
  26 +
  27 +}
  1 +package cn.brotop.api.hospital.factory;
  2 +
  3 +import cn.brotop.api.hospital.DTO.HospitalDTO;
  4 +import cn.brotop.api.hospital.DTO.HospitalRpcDTO;
  5 +import cn.brotop.api.hospital.RemoteHospitalService;
  6 +import cn.brotop.api.hospital.VO.CityVO;
  7 +import cn.brotop.api.hospital.VO.CountyVO;
  8 +import cn.brotop.api.hospital.VO.ProvinceVO;
  9 +import cn.brotop.common.core.domain.R;
  10 +import cn.brotop.common.core.utils.StringUtils;
  11 +import feign.hystrix.FallbackFactory;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
  14 +
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +
  18 +/**
  19 + * @program: Rejoie-Admin-Cloud
  20 + * @className: RemoteDoctorFallbackFactory
  21 + * @description: 医生模块服务异常返回
  22 + * @author: alei
  23 + * @create: 2021-05-18 16:35
  24 + **/
  25 +public class RemoteHospitalFallbackFactory implements FallbackFactory<RemoteHospitalService> {
  26 + private static final Logger log = LoggerFactory.getLogger(RemoteHospitalFallbackFactory.class);
  27 + @Override
  28 + public RemoteHospitalService create(Throwable throwable)
  29 + {
  30 + log.error("医院模块服务API调用失败:{}", throwable.getMessage());
  31 + return new RemoteHospitalService()
  32 + {
  33 +
  34 + @Override
  35 + public R<List<HospitalRpcDTO>> findByHospitalIds(List<Long> hospitalIds) {
  36 + return R.fail("医院模块服务API调用失败");
  37 + }
  38 +
  39 + @Override
  40 + public R<HospitalRpcDTO> findByHospitalId(Long hospitalId) {
  41 + return R.fail("医院模块服务API调用失败");
  42 + }
  43 +
  44 + @Override
  45 + public R<List<ProvinceVO>> getProvince() {
  46 + return R.fail("医院模块服务API调用失败");
  47 + }
  48 +
  49 + @Override
  50 + public R<List<CityVO>> getCity(Long provinceId) {
  51 +
  52 + return R.fail("医院模块服务API调用失败");
  53 + }
  54 +
  55 + @Override
  56 + public R<List<CountyVO>> getCounty(Long cityId) {
  57 +
  58 + return R.fail("医院模块服务API调用失败");
  59 + }
  60 +
  61 + @Override
  62 + public R<List<HospitalDTO>> getHospital(Long countyId) {
  63 +
  64 + return R.fail("医院模块服务API调用失败");
  65 + }
  66 + };
  67 + }
  68 +
  69 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.brotop</groupId>
  7 + <artifactId>bro-admin-api</artifactId>
  8 + <version>1.0.0</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 +
  12 + <artifactId>bro-admin-api-payment</artifactId>
  13 +
  14 + <properties>
  15 + <maven.compiler.source>8</maven.compiler.source>
  16 + <maven.compiler.target>8</maven.compiler.target>
  17 + </properties>
  18 + <dependencies>
  19 + <!-- RuoYi Common Core-->
  20 + <dependency>
  21 + <groupId>cn.brotop</groupId>
  22 + <artifactId>bro-admin-common-core</artifactId>
  23 + </dependency>
  24 + </dependencies>
  25 +
  26 +</project>
  1 +package cn.brotop.api.payment.DTO;
  2 +
  3 +import lombok.Data;
  4 +
  5 +/**
  6 + * @author 啊雷
  7 + * @version 1.0
  8 + * @date 2021/2/2 9:00
  9 + */
  10 +@Data
  11 +public class AliRefundDTO {
  12 +
  13 + /**
  14 + * 金额 单位为元
  15 + */
  16 + private String refundAmount;
  17 +
  18 + /**
  19 + * 支付宝流水号
  20 + */
  21 + private String tradeNo;
  22 +
  23 + /**
  24 + * 退款单号
  25 + */
  26 + private String outRequestNo;
  27 +
  28 +}
  1 +package cn.brotop.api.payment.DTO;
  2 +
  3 +import lombok.Data;
  4 +
  5 +/**
  6 + * @author 啊雷
  7 + * @version 1.0
  8 + * @date 2021/2/2 9:53
  9 + */
  10 +@Data
  11 +public class AliRefundQueryDTO {
  12 +
  13 + /**
  14 + * 请求退款接口时,传入的退款请求号,如果在退款请求时未传入,则该值为创建交易时的外部交易号
  15 + */
  16 + private String outRequestNo;
  17 +
  18 + /**
  19 + * 订单支付时传入的商户订单号,和支付宝交易号不能同时为空。 trade_no,out_trade_no如果同时存在优先取trade_no
  20 + */
  21 + private String outTradeNo;
  22 +
  23 + /**
  24 + * 支付宝交易号,和商户订单号不能同时为空
  25 + */
  26 + private String tradeNo;
  27 +}
  1 +package cn.brotop.api.payment.DTO;
  2 +
  3 +import lombok.Data;
  4 +
  5 +/**
  6 + * @author 啊雷
  7 + * @version 1.0
  8 + * @date 2021/2/1 16:00
  9 + */
  10 +@Data
  11 +public class AlipayDTO {
  12 +
  13 + /**
  14 + * 商品描述
  15 + */
  16 + private String body;
  17 +
  18 + /**
  19 + * 商品的标题
  20 + */
  21 + private String subject;
  22 +
  23 + /**
  24 + * 唯一订单号
  25 + */
  26 + private String outTradeNo;
  27 +
  28 + /**
  29 + * 订单总金额,单位为元,精确到小数点后两位
  30 + */
  31 + private String totalAmount;
  32 +
  33 + /**
  34 + * 支付成功回调
  35 + */
  36 + private String successUrl;
  37 +
  38 + /**
  39 + * 用户中途退款返回的url
  40 + */
  41 + private String quitUrl;
  42 +}
  1 +package cn.brotop.api.payment.DTO;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.math.BigDecimal;
  6 +
  7 +/**
  8 + * @author 啊雷
  9 + * @version 1.0
  10 + * @date 2021/2/2 10:05
  11 + */
  12 +@Data
  13 +public class WxPaymentDTO {
  14 +
  15 + /**
  16 + * 商品描述
  17 + */
  18 + private String body;
  19 +
  20 + /**
  21 + * 微信商户订单号
  22 + */
  23 + private String outTradeNo;
  24 +
  25 + /**
  26 + *实付金额(元)
  27 + */
  28 + private BigDecimal totalFee;
  29 +
  30 + /**
  31 + * ip
  32 + */
  33 + private String spbillCreateIp;
  34 +
  35 + /**
  36 + *回调地址
  37 + */
  38 + private String notifyUrl;
  39 +
  40 +
  41 +
  42 + /**
  43 + * 商品描述
  44 + */
  45 + private String desc;
  46 +}
  1 +package cn.brotop.api.payment.DTO;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.math.BigDecimal;
  6 +
  7 +/**
  8 + * @author 啊雷
  9 + * @version 1.0
  10 + * @date 2021/2/2 10:57
  11 + */
  12 +@Data
  13 +public class WxRefundDTO {
  14 +
  15 + /**
  16 + * 退款成功回调地址
  17 + */
  18 + private String notifyUrl;
  19 +
  20 + /**
  21 + * 商户订单号 商户系统内部订单号,
  22 + */
  23 + private String outTradeNo;
  24 +
  25 + /**
  26 + * 退款单号
  27 + */
  28 + private String outRefundNo;
  29 +
  30 + /**
  31 + * 订单金额
  32 + */
  33 + private BigDecimal price;
  34 +
  35 + /**
  36 + * 退款金额
  37 + */
  38 + private BigDecimal refundPrice;
  39 +}
  1 +package cn.brotop.api.payment.VO;
  2 +
  3 +import io.swagger.annotations.ApiModelProperty;
  4 +import lombok.Data;
  5 +
  6 +/**
  7 + * @author 啊雷
  8 + * @version 1.0
  9 + * @date 2021/2/2 10:06
  10 + */
  11 +@Data
  12 +public class WxPaymentVO {
  13 +
  14 + @ApiModelProperty("应用ID")
  15 + private String appId;
  16 +
  17 + @ApiModelProperty("时间戳")
  18 + private String timeStamp;
  19 +
  20 + @ApiModelProperty("随机串")
  21 + private String nonceStr;
  22 + /**
  23 + * 由于package为java保留关键字,因此改为packageValue. 前端使用时记得要更改为package
  24 + */
  25 + @ApiModelProperty("数据包")
  26 + private String packageValue;
  27 +
  28 + @ApiModelProperty("签名类型,")
  29 + private String signType;
  30 +
  31 + @ApiModelProperty("签名")
  32 + private String paySign;
  33 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 + xmlns="http://maven.apache.org/POM/4.0.0"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.brotop</groupId>
  7 + <artifactId>bro-admin-api</artifactId>
  8 + <version>1.0.0</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 +
  12 + <artifactId>bro-admin-api-system</artifactId>
  13 +
  14 + <description>
  15 + bro-admin-api-system系统接口模块
  16 + </description>
  17 +
  18 + <dependencies>
  19 +
  20 + <!-- RuoYi Common Core-->
  21 + <dependency>
  22 + <groupId>cn.brotop</groupId>
  23 + <artifactId>bro-admin-common-core</artifactId>
  24 + </dependency>
  25 +
  26 + </dependencies>
  27 +
  28 +</project>
  1 +package cn.brotop.system.api;
  2 +
  3 +import cn.brotop.system.api.domain.SysFile;
  4 +import cn.brotop.system.api.factory.RemoteFileFallbackFactory;
  5 +import org.springframework.cloud.openfeign.FeignClient;
  6 +import org.springframework.http.MediaType;
  7 +import org.springframework.web.bind.annotation.PostMapping;
  8 +import org.springframework.web.bind.annotation.RequestPart;
  9 +import org.springframework.web.multipart.MultipartFile;
  10 +import cn.brotop.common.core.constant.ServiceNameConstants;
  11 +import cn.brotop.common.core.domain.R;
  12 +
  13 +/**
  14 + * 文件服务
  15 + *
  16 + * @author 啊雷
  17 + */
  18 +@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
  19 +public interface RemoteFileService
  20 +{
  21 + /**
  22 + * 上传文件
  23 + *
  24 + * @param file 文件信息
  25 + * @return 结果
  26 + */
  27 + @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
  28 + public R<SysFile> upload(@RequestPart(value = "file") MultipartFile file);
  29 +}
  1 +package cn.brotop.system.api;
  2 +
  3 +import cn.brotop.system.api.domain.SysOperLog;
  4 +import cn.brotop.system.api.factory.RemoteLogFallbackFactory;
  5 +import org.springframework.cloud.openfeign.FeignClient;
  6 +import org.springframework.web.bind.annotation.PostMapping;
  7 +import org.springframework.web.bind.annotation.RequestBody;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import cn.brotop.common.core.constant.ServiceNameConstants;
  10 +import cn.brotop.common.core.domain.R;
  11 +
  12 +/**
  13 + * 日志服务
  14 + *
  15 + * @author 啊雷
  16 + */
  17 +@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class)
  18 +public interface RemoteLogService
  19 +{
  20 + /**
  21 + * 保存系统日志
  22 + *
  23 + * @param sysOperLog 日志实体
  24 + * @return 结果
  25 + */
  26 + @PostMapping("/operlog")
  27 + R<Boolean> saveLog(@RequestBody SysOperLog sysOperLog);
  28 +
  29 + /**
  30 + * 保存访问记录
  31 + *
  32 + * @param username 用户名称
  33 + * @param status 状态
  34 + * @param message 消息
  35 + * @return 结果
  36 + */
  37 + @PostMapping("/logininfor")
  38 + R<Boolean> saveLogininfor(@RequestParam("username") String username, @RequestParam("status") String status,
  39 + @RequestParam("message") String message);
  40 +}
  1 +package cn.brotop.system.api;
  2 +
  3 +import cn.brotop.system.api.factory.RemoteUserFallbackFactory;
  4 +import org.springframework.cloud.openfeign.FeignClient;
  5 +import org.springframework.web.bind.annotation.GetMapping;
  6 +import org.springframework.web.bind.annotation.PathVariable;
  7 +import cn.brotop.common.core.constant.ServiceNameConstants;
  8 +import cn.brotop.common.core.domain.R;
  9 +import cn.brotop.system.api.model.LoginUser;
  10 +
  11 +/**
  12 + * 用户服务
  13 + *
  14 + * @author 啊雷
  15 + */
  16 +@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
  17 +public interface RemoteUserService
  18 +{
  19 + /**
  20 + * 通过用户名查询用户信息
  21 + *
  22 + * @param username 用户名
  23 + * @return 结果
  24 + */
  25 + @GetMapping(value = "/user/info/{username}")
  26 + public R<LoginUser> getUserInfo(@PathVariable("username") String username);
  27 +}
  1 +package cn.brotop.system.api.domain;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +import javax.validation.constraints.Email;
  6 +import javax.validation.constraints.NotBlank;
  7 +import javax.validation.constraints.Size;
  8 +import org.apache.commons.lang3.builder.ToStringBuilder;
  9 +import org.apache.commons.lang3.builder.ToStringStyle;
  10 +import cn.brotop.common.core.web.domain.BaseEntity;
  11 +
  12 +/**
  13 + * 部门表 sys_dept
  14 + *
  15 + * @author 啊雷
  16 + */
  17 +public class SysDept extends BaseEntity
  18 +{
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /** 部门ID */
  22 + private Long deptId;
  23 +
  24 + /** 父部门ID */
  25 + private Long parentId;
  26 +
  27 + /** 祖级列表 */
  28 + private String ancestors;
  29 +
  30 + /** 部门名称 */
  31 + private String deptName;
  32 +
  33 + /** 显示顺序 */
  34 + private String orderNum;
  35 +
  36 + /** 负责人 */
  37 + private String leader;
  38 +
  39 + /** 联系电话 */
  40 + private String phone;
  41 +
  42 + /** 邮箱 */
  43 + private String email;
  44 +
  45 + /** 部门状态:0正常,1停用 */
  46 + private String status;
  47 +
  48 + /** 删除标志(0代表存在 2代表删除) */
  49 + private String delFlag;
  50 +
  51 + /** 父部门名称 */
  52 + private String parentName;
  53 +
  54 + /** 子部门 */
  55 + private List<SysDept> children = new ArrayList<SysDept>();
  56 +
  57 + public Long getDeptId()
  58 + {
  59 + return deptId;
  60 + }
  61 +
  62 + public void setDeptId(Long deptId)
  63 + {
  64 + this.deptId = deptId;
  65 + }
  66 +
  67 + public Long getParentId()
  68 + {
  69 + return parentId;
  70 + }
  71 +
  72 + public void setParentId(Long parentId)
  73 + {
  74 + this.parentId = parentId;
  75 + }
  76 +
  77 + public String getAncestors()
  78 + {
  79 + return ancestors;
  80 + }
  81 +
  82 + public void setAncestors(String ancestors)
  83 + {
  84 + this.ancestors = ancestors;
  85 + }
  86 +
  87 + @NotBlank(message = "部门名称不能为空")
  88 + @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
  89 + public String getDeptName()
  90 + {
  91 + return deptName;
  92 + }
  93 +
  94 + public void setDeptName(String deptName)
  95 + {
  96 + this.deptName = deptName;
  97 + }
  98 +
  99 + @NotBlank(message = "显示顺序不能为空")
  100 + public String getOrderNum()
  101 + {
  102 + return orderNum;
  103 + }
  104 +
  105 + public void setOrderNum(String orderNum)
  106 + {
  107 + this.orderNum = orderNum;
  108 + }
  109 +
  110 + public String getLeader()
  111 + {
  112 + return leader;
  113 + }
  114 +
  115 + public void setLeader(String leader)
  116 + {
  117 + this.leader = leader;
  118 + }
  119 +
  120 + @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
  121 + public String getPhone()
  122 + {
  123 + return phone;
  124 + }
  125 +
  126 + public void setPhone(String phone)
  127 + {
  128 + this.phone = phone;
  129 + }
  130 +
  131 + @Email(message = "邮箱格式不正确")
  132 + @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
  133 + public String getEmail()
  134 + {
  135 + return email;
  136 + }
  137 +
  138 + public void setEmail(String email)
  139 + {
  140 + this.email = email;
  141 + }
  142 +
  143 + public String getStatus()
  144 + {
  145 + return status;
  146 + }
  147 +
  148 + public void setStatus(String status)
  149 + {
  150 + this.status = status;
  151 + }
  152 +
  153 + public String getDelFlag()
  154 + {
  155 + return delFlag;
  156 + }
  157 +
  158 + public void setDelFlag(String delFlag)
  159 + {
  160 + this.delFlag = delFlag;
  161 + }
  162 +
  163 + public String getParentName()
  164 + {
  165 + return parentName;
  166 + }
  167 +
  168 + public void setParentName(String parentName)
  169 + {
  170 + this.parentName = parentName;
  171 + }
  172 +
  173 + public List<SysDept> getChildren()
  174 + {
  175 + return children;
  176 + }
  177 +
  178 + public void setChildren(List<SysDept> children)
  179 + {
  180 + this.children = children;
  181 + }
  182 +
  183 + @Override
  184 + public String toString() {
  185 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  186 + .append("deptId", getDeptId())
  187 + .append("parentId", getParentId())
  188 + .append("ancestors", getAncestors())
  189 + .append("deptName", getDeptName())
  190 + .append("orderNum", getOrderNum())
  191 + .append("leader", getLeader())
  192 + .append("phone", getPhone())
  193 + .append("email", getEmail())
  194 + .append("status", getStatus())
  195 + .append("delFlag", getDelFlag())
  196 + .append("createBy", getCreateBy())
  197 + .append("createTime", getCreateTime())
  198 + .append("updateBy", getUpdateBy())
  199 + .append("updateTime", getUpdateTime())
  200 + .toString();
  201 + }
  202 +}
  1 +package cn.brotop.system.api.domain;
  2 +
  3 +import org.apache.commons.lang3.builder.ToStringBuilder;
  4 +import org.apache.commons.lang3.builder.ToStringStyle;
  5 +
  6 +/**
  7 + * 文件信息
  8 + *
  9 + * @author 啊雷
  10 + */
  11 +public class SysFile
  12 +{
  13 + /**
  14 + * 文件名称
  15 + */
  16 + private String name;
  17 +
  18 + /**
  19 + * 文件地址
  20 + */
  21 + private String url;
  22 +
  23 + public String getName()
  24 + {
  25 + return name;
  26 + }
  27 +
  28 + public void setName(String name)
  29 + {
  30 + this.name = name;
  31 + }
  32 +
  33 + public String getUrl()
  34 + {
  35 + return url;
  36 + }
  37 +
  38 + public void setUrl(String url)
  39 + {
  40 + this.url = url;
  41 + }
  42 +
  43 + @Override
  44 + public String toString() {
  45 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  46 + .append("name", getName())
  47 + .append("url", getUrl())
  48 + .toString();
  49 + }
  50 +}
  1 +package cn.brotop.system.api.domain;
  2 +
  3 +import java.util.Date;
  4 +import com.fasterxml.jackson.annotation.JsonFormat;
  5 +import cn.brotop.common.core.annotation.Excel;
  6 +import cn.brotop.common.core.annotation.Excel.ColumnType;
  7 +import cn.brotop.common.core.web.domain.BaseEntity;
  8 +
  9 +/**
  10 + * 操作日志记录表 oper_log
  11 + *
  12 + * @author 啊雷
  13 + */
  14 +public class SysOperLog extends BaseEntity
  15 +{
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /** 日志主键 */
  19 + @Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
  20 + private Long operId;
  21 +
  22 + /** 操作模块 */
  23 + @Excel(name = "操作模块")
  24 + private String title;
  25 +
  26 + /** 业务类型(0其它 1新增 2修改 3删除) */
  27 + @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据")
  28 + private Integer businessType;
  29 +
  30 + /** 业务类型数组 */
  31 + private Integer[] businessTypes;
  32 +
  33 + /** 请求方法 */
  34 + @Excel(name = "请求方法")
  35 + private String method;
  36 +
  37 + /** 请求方式 */
  38 + @Excel(name = "请求方式")
  39 + private String requestMethod;
  40 +
  41 + /** 操作类别(0其它 1后台用户 2手机端用户) */
  42 + @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
  43 + private Integer operatorType;
  44 +
  45 + /** 操作人员 */
  46 + @Excel(name = "操作人员")
  47 + private String operName;
  48 +
  49 + /** 部门名称 */
  50 + @Excel(name = "部门名称")
  51 + private String deptName;
  52 +
  53 + /** 请求url */
  54 + @Excel(name = "请求地址")
  55 + private String operUrl;
  56 +
  57 + /** 操作地址 */
  58 + @Excel(name = "操作地址")
  59 + private String operIp;
  60 +
  61 + /** 请求参数 */
  62 + @Excel(name = "请求参数")
  63 + private String operParam;
  64 +
  65 + /** 返回参数 */
  66 + @Excel(name = "返回参数")
  67 + private String jsonResult;
  68 +
  69 + /** 操作状态(0正常 1异常) */
  70 + @Excel(name = "状态", readConverterExp = "0=正常,1=异常")
  71 + private Integer status;
  72 +
  73 + /** 错误消息 */
  74 + @Excel(name = "错误消息")
  75 + private String errorMsg;
  76 +
  77 + /** 操作时间 */
  78 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  79 + @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
  80 + private Date operTime;
  81 +
  82 + public Long getOperId()
  83 + {
  84 + return operId;
  85 + }
  86 +
  87 + public void setOperId(Long operId)
  88 + {
  89 + this.operId = operId;
  90 + }
  91 +
  92 + public String getTitle()
  93 + {
  94 + return title;
  95 + }
  96 +
  97 + public void setTitle(String title)
  98 + {
  99 + this.title = title;
  100 + }
  101 +
  102 + public Integer getBusinessType()
  103 + {
  104 + return businessType;
  105 + }
  106 +
  107 + public void setBusinessType(Integer businessType)
  108 + {
  109 + this.businessType = businessType;
  110 + }
  111 +
  112 + public Integer[] getBusinessTypes()
  113 + {
  114 + return businessTypes;
  115 + }
  116 +
  117 + public void setBusinessTypes(Integer[] businessTypes)
  118 + {
  119 + this.businessTypes = businessTypes;
  120 + }
  121 +
  122 + public String getMethod()
  123 + {
  124 + return method;
  125 + }
  126 +
  127 + public void setMethod(String method)
  128 + {
  129 + this.method = method;
  130 + }
  131 +
  132 + public String getRequestMethod()
  133 + {
  134 + return requestMethod;
  135 + }
  136 +
  137 + public void setRequestMethod(String requestMethod)
  138 + {
  139 + this.requestMethod = requestMethod;
  140 + }
  141 +
  142 + public Integer getOperatorType()
  143 + {
  144 + return operatorType;
  145 + }
  146 +
  147 + public void setOperatorType(Integer operatorType)
  148 + {
  149 + this.operatorType = operatorType;
  150 + }
  151 +
  152 + public String getOperName()
  153 + {
  154 + return operName;
  155 + }
  156 +
  157 + public void setOperName(String operName)
  158 + {
  159 + this.operName = operName;
  160 + }
  161 +
  162 + public String getDeptName()
  163 + {
  164 + return deptName;
  165 + }
  166 +
  167 + public void setDeptName(String deptName)
  168 + {
  169 + this.deptName = deptName;
  170 + }
  171 +
  172 + public String getOperUrl()
  173 + {
  174 + return operUrl;
  175 + }
  176 +
  177 + public void setOperUrl(String operUrl)
  178 + {
  179 + this.operUrl = operUrl;
  180 + }
  181 +
  182 + public String getOperIp()
  183 + {
  184 + return operIp;
  185 + }
  186 +
  187 + public void setOperIp(String operIp)
  188 + {
  189 + this.operIp = operIp;
  190 + }
  191 +
  192 + public String getOperParam()
  193 + {
  194 + return operParam;
  195 + }
  196 +
  197 + public void setOperParam(String operParam)
  198 + {
  199 + this.operParam = operParam;
  200 + }
  201 +
  202 + public String getJsonResult()
  203 + {
  204 + return jsonResult;
  205 + }
  206 +
  207 + public void setJsonResult(String jsonResult)
  208 + {
  209 + this.jsonResult = jsonResult;
  210 + }
  211 +
  212 + public Integer getStatus()
  213 + {
  214 + return status;
  215 + }
  216 +
  217 + public void setStatus(Integer status)
  218 + {
  219 + this.status = status;
  220 + }
  221 +
  222 + public String getErrorMsg()
  223 + {
  224 + return errorMsg;
  225 + }
  226 +
  227 + public void setErrorMsg(String errorMsg)
  228 + {
  229 + this.errorMsg = errorMsg;
  230 + }
  231 +
  232 + public Date getOperTime()
  233 + {
  234 + return operTime;
  235 + }
  236 +
  237 + public void setOperTime(Date operTime)
  238 + {
  239 + this.operTime = operTime;
  240 + }
  241 +}
  1 +package cn.brotop.system.api.domain;
  2 +
  3 +import javax.validation.constraints.NotBlank;
  4 +import javax.validation.constraints.Size;
  5 +import org.apache.commons.lang3.builder.ToStringBuilder;
  6 +import org.apache.commons.lang3.builder.ToStringStyle;
  7 +import cn.brotop.common.core.annotation.Excel;
  8 +import cn.brotop.common.core.annotation.Excel.ColumnType;
  9 +import cn.brotop.common.core.web.domain.BaseEntity;
  10 +
  11 +/**
  12 + * 角色表 sys_role
  13 + *
  14 + * @author 啊雷
  15 + */
  16 +public class SysRole extends BaseEntity
  17 +{
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /** 角色ID */
  21 + @Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
  22 + private Long roleId;
  23 +
  24 + /** 角色名称 */
  25 + @Excel(name = "角色名称")
  26 + private String roleName;
  27 +
  28 + /** 角色权限 */
  29 + @Excel(name = "角色权限")
  30 + private String roleKey;
  31 +
  32 + /** 角色排序 */
  33 + @Excel(name = "角色排序")
  34 + private String roleSort;
  35 +
  36 + /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限) */
  37 + @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
  38 + private String dataScope;
  39 +
  40 + /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
  41 + private boolean menuCheckStrictly;
  42 +
  43 + /** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
  44 + private boolean deptCheckStrictly;
  45 +
  46 + /** 角色状态(0正常 1停用) */
  47 + @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
  48 + private String status;
  49 +
  50 + /** 删除标志(0代表存在 2代表删除) */
  51 + private String delFlag;
  52 +
  53 + /** 用户是否存在此角色标识 默认不存在 */
  54 + private boolean flag = false;
  55 +
  56 + /** 菜单组 */
  57 + private Long[] menuIds;
  58 +
  59 + /** 部门组(数据权限) */
  60 + private Long[] deptIds;
  61 +
  62 + public SysRole()
  63 + {
  64 +
  65 + }
  66 +
  67 + public SysRole(Long roleId)
  68 + {
  69 + this.roleId = roleId;
  70 + }
  71 +
  72 + public Long getRoleId()
  73 + {
  74 + return roleId;
  75 + }
  76 +
  77 + public void setRoleId(Long roleId)
  78 + {
  79 + this.roleId = roleId;
  80 + }
  81 +
  82 + public boolean isAdmin()
  83 + {
  84 + return isAdmin(this.roleId);
  85 + }
  86 +
  87 + public static boolean isAdmin(Long roleId)
  88 + {
  89 + return roleId != null && 1L == roleId;
  90 + }
  91 +
  92 + @NotBlank(message = "角色名称不能为空")
  93 + @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
  94 + public String getRoleName()
  95 + {
  96 + return roleName;
  97 + }
  98 +
  99 + public void setRoleName(String roleName)
  100 + {
  101 + this.roleName = roleName;
  102 + }
  103 +
  104 + @NotBlank(message = "权限字符不能为空")
  105 + @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
  106 + public String getRoleKey()
  107 + {
  108 + return roleKey;
  109 + }
  110 +
  111 + public void setRoleKey(String roleKey)
  112 + {
  113 + this.roleKey = roleKey;
  114 + }
  115 +
  116 + @NotBlank(message = "显示顺序不能为空")
  117 + public String getRoleSort()
  118 + {
  119 + return roleSort;
  120 + }
  121 +
  122 + public void setRoleSort(String roleSort)
  123 + {
  124 + this.roleSort = roleSort;
  125 + }
  126 +
  127 + public String getDataScope()
  128 + {
  129 + return dataScope;
  130 + }
  131 +
  132 + public void setDataScope(String dataScope)
  133 + {
  134 + this.dataScope = dataScope;
  135 + }
  136 +
  137 + public boolean isMenuCheckStrictly()
  138 + {
  139 + return menuCheckStrictly;
  140 + }
  141 +
  142 + public void setMenuCheckStrictly(boolean menuCheckStrictly)
  143 + {
  144 + this.menuCheckStrictly = menuCheckStrictly;
  145 + }
  146 +
  147 + public boolean isDeptCheckStrictly()
  148 + {
  149 + return deptCheckStrictly;
  150 + }
  151 +
  152 + public void setDeptCheckStrictly(boolean deptCheckStrictly)
  153 + {
  154 + this.deptCheckStrictly = deptCheckStrictly;
  155 + }
  156 +
  157 + public String getStatus()
  158 + {
  159 + return status;
  160 + }
  161 +
  162 + public void setStatus(String status)
  163 + {
  164 + this.status = status;
  165 + }
  166 +
  167 + public String getDelFlag()
  168 + {
  169 + return delFlag;
  170 + }
  171 +
  172 + public void setDelFlag(String delFlag)
  173 + {
  174 + this.delFlag = delFlag;
  175 + }
  176 +
  177 + public boolean isFlag()
  178 + {
  179 + return flag;
  180 + }
  181 +
  182 + public void setFlag(boolean flag)
  183 + {
  184 + this.flag = flag;
  185 + }
  186 +
  187 + public Long[] getMenuIds()
  188 + {
  189 + return menuIds;
  190 + }
  191 +
  192 + public void setMenuIds(Long[] menuIds)
  193 + {
  194 + this.menuIds = menuIds;
  195 + }
  196 +
  197 + public Long[] getDeptIds()
  198 + {
  199 + return deptIds;
  200 + }
  201 +
  202 + public void setDeptIds(Long[] deptIds)
  203 + {
  204 + this.deptIds = deptIds;
  205 + }
  206 +
  207 + public String toString() {
  208 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  209 + .append("roleId", getRoleId())
  210 + .append("roleName", getRoleName())
  211 + .append("roleKey", getRoleKey())
  212 + .append("roleSort", getRoleSort())
  213 + .append("dataScope", getDataScope())
  214 + .append("menuCheckStrictly", isMenuCheckStrictly())
  215 + .append("deptCheckStrictly", isDeptCheckStrictly())
  216 + .append("status", getStatus())
  217 + .append("delFlag", getDelFlag())
  218 + .append("createBy", getCreateBy())
  219 + .append("createTime", getCreateTime())
  220 + .append("updateBy", getUpdateBy())
  221 + .append("updateTime", getUpdateTime())
  222 + .append("remark", getRemark())
  223 + .toString();
  224 + }
  225 +}
  1 +package cn.brotop.system.api.domain;
  2 +
  3 +import java.util.Date;
  4 +import java.util.List;
  5 +import javax.validation.constraints.Email;
  6 +import javax.validation.constraints.NotBlank;
  7 +import javax.validation.constraints.Size;
  8 +import org.apache.commons.lang3.builder.ToStringBuilder;
  9 +import org.apache.commons.lang3.builder.ToStringStyle;
  10 +import com.fasterxml.jackson.annotation.JsonProperty;
  11 +import cn.brotop.common.core.annotation.Excel;
  12 +import cn.brotop.common.core.annotation.Excel.ColumnType;
  13 +import cn.brotop.common.core.annotation.Excel.Type;
  14 +import cn.brotop.common.core.annotation.Excels;
  15 +import cn.brotop.common.core.web.domain.BaseEntity;
  16 +
  17 +/**
  18 + * 用户对象 sys_user
  19 + *
  20 + * @author 啊雷
  21 + */
  22 +public class SysUser extends BaseEntity
  23 +{
  24 + private static final long serialVersionUID = 1L;
  25 +
  26 + /** 用户ID */
  27 + @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
  28 + private Long userId;
  29 +
  30 + /** 部门ID */
  31 + @Excel(name = "部门编号", type = Type.IMPORT)
  32 + private Long deptId;
  33 +
  34 + /** 用户账号 */
  35 + @Excel(name = "登录名称")
  36 + private String userName;
  37 +
  38 + /** 用户昵称 */
  39 + @Excel(name = "用户名称")
  40 + private String nickName;
  41 +
  42 + /** 用户邮箱 */
  43 + @Excel(name = "用户邮箱")
  44 + private String email;
  45 +
  46 + /** 手机号码 */
  47 + @Excel(name = "手机号码")
  48 + private String phonenumber;
  49 +
  50 + /** 用户性别 */
  51 + @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
  52 + private String sex;
  53 +
  54 + /** 用户头像 */
  55 + private String avatar;
  56 +
  57 + /** 密码 */
  58 + private String password;
  59 +
  60 + /** 盐加密 */
  61 + private String salt;
  62 +
  63 + /** 帐号状态(0正常 1停用) */
  64 + @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
  65 + private String status;
  66 +
  67 + /** 删除标志(0代表存在 2代表删除) */
  68 + private String delFlag;
  69 +
  70 + /** 最后登录IP */
  71 + @Excel(name = "最后登录IP", type = Type.EXPORT)
  72 + private String loginIp;
  73 +
  74 + /** 最后登录时间 */
  75 + @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
  76 + private Date loginDate;
  77 +
  78 + /** 部门对象 */
  79 + @Excels({
  80 + @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
  81 + @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
  82 + })
  83 + private SysDept dept;
  84 +
  85 + /** 角色对象 */
  86 + private List<SysRole> roles;
  87 +
  88 + /** 角色组 */
  89 + private Long[] roleIds;
  90 +
  91 + /** 岗位组 */
  92 + private Long[] postIds;
  93 +
  94 + public SysUser()
  95 + {
  96 +
  97 + }
  98 +
  99 + public SysUser(Long userId)
  100 + {
  101 + this.userId = userId;
  102 + }
  103 +
  104 + public Long getUserId()
  105 + {
  106 + return userId;
  107 + }
  108 +
  109 + public void setUserId(Long userId)
  110 + {
  111 + this.userId = userId;
  112 + }
  113 +
  114 + public boolean isAdmin()
  115 + {
  116 + return isAdmin(this.userId);
  117 + }
  118 +
  119 + public static boolean isAdmin(Long userId)
  120 + {
  121 + return userId != null && 1L == userId;
  122 + }
  123 +
  124 + public Long getDeptId()
  125 + {
  126 + return deptId;
  127 + }
  128 +
  129 + public void setDeptId(Long deptId)
  130 + {
  131 + this.deptId = deptId;
  132 + }
  133 +
  134 + @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
  135 + public String getNickName()
  136 + {
  137 + return nickName;
  138 + }
  139 +
  140 + public void setNickName(String nickName)
  141 + {
  142 + this.nickName = nickName;
  143 + }
  144 +
  145 + @NotBlank(message = "用户账号不能为空")
  146 + @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
  147 + public String getUserName()
  148 + {
  149 + return userName;
  150 + }
  151 +
  152 + public void setUserName(String userName)
  153 + {
  154 + this.userName = userName;
  155 + }
  156 +
  157 + @Email(message = "邮箱格式不正确")
  158 + @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
  159 + public String getEmail()
  160 + {
  161 + return email;
  162 + }
  163 +
  164 + public void setEmail(String email)
  165 + {
  166 + this.email = email;
  167 + }
  168 +
  169 + @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
  170 + public String getPhonenumber()
  171 + {
  172 + return phonenumber;
  173 + }
  174 +
  175 + public void setPhonenumber(String phonenumber)
  176 + {
  177 + this.phonenumber = phonenumber;
  178 + }
  179 +
  180 + public String getSex()
  181 + {
  182 + return sex;
  183 + }
  184 +
  185 + public void setSex(String sex)
  186 + {
  187 + this.sex = sex;
  188 + }
  189 +
  190 + public String getAvatar()
  191 + {
  192 + return avatar;
  193 + }
  194 +
  195 + public void setAvatar(String avatar)
  196 + {
  197 + this.avatar = avatar;
  198 + }
  199 +
  200 + @JsonProperty
  201 + public String getPassword()
  202 + {
  203 + return password;
  204 + }
  205 +
  206 + public void setPassword(String password)
  207 + {
  208 + this.password = password;
  209 + }
  210 +
  211 + public String getSalt()
  212 + {
  213 + return salt;
  214 + }
  215 +
  216 + public void setSalt(String salt)
  217 + {
  218 + this.salt = salt;
  219 + }
  220 +
  221 + public String getStatus()
  222 + {
  223 + return status;
  224 + }
  225 +
  226 + public void setStatus(String status)
  227 + {
  228 + this.status = status;
  229 + }
  230 +
  231 + public String getDelFlag()
  232 + {
  233 + return delFlag;
  234 + }
  235 +
  236 + public void setDelFlag(String delFlag)
  237 + {
  238 + this.delFlag = delFlag;
  239 + }
  240 +
  241 + public String getLoginIp()
  242 + {
  243 + return loginIp;
  244 + }
  245 +
  246 + public void setLoginIp(String loginIp)
  247 + {
  248 + this.loginIp = loginIp;
  249 + }
  250 +
  251 + public Date getLoginDate()
  252 + {
  253 + return loginDate;
  254 + }
  255 +
  256 + public void setLoginDate(Date loginDate)
  257 + {
  258 + this.loginDate = loginDate;
  259 + }
  260 +
  261 + public SysDept getDept()
  262 + {
  263 + return dept;
  264 + }
  265 +
  266 + public void setDept(SysDept dept)
  267 + {
  268 + this.dept = dept;
  269 + }
  270 +
  271 + public List<SysRole> getRoles()
  272 + {
  273 + return roles;
  274 + }
  275 +
  276 + public void setRoles(List<SysRole> roles)
  277 + {
  278 + this.roles = roles;
  279 + }
  280 +
  281 + public Long[] getRoleIds()
  282 + {
  283 + return roleIds;
  284 + }
  285 +
  286 + public void setRoleIds(Long[] roleIds)
  287 + {
  288 + this.roleIds = roleIds;
  289 + }
  290 +
  291 + public Long[] getPostIds()
  292 + {
  293 + return postIds;
  294 + }
  295 +
  296 + public void setPostIds(Long[] postIds)
  297 + {
  298 + this.postIds = postIds;
  299 + }
  300 +
  301 + @Override
  302 + public String toString() {
  303 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  304 + .append("userId", getUserId())
  305 + .append("deptId", getDeptId())
  306 + .append("userName", getUserName())
  307 + .append("nickName", getNickName())
  308 + .append("email", getEmail())
  309 + .append("phonenumber", getPhonenumber())
  310 + .append("sex", getSex())
  311 + .append("avatar", getAvatar())
  312 + .append("password", getPassword())
  313 + .append("salt", getSalt())
  314 + .append("status", getStatus())
  315 + .append("delFlag", getDelFlag())
  316 + .append("loginIp", getLoginIp())
  317 + .append("loginDate", getLoginDate())
  318 + .append("createBy", getCreateBy())
  319 + .append("createTime", getCreateTime())
  320 + .append("updateBy", getUpdateBy())
  321 + .append("updateTime", getUpdateTime())
  322 + .append("remark", getRemark())
  323 + .append("dept", getDept())
  324 + .toString();
  325 + }
  326 +}
  1 +package cn.brotop.system.api.factory;
  2 +
  3 +import cn.brotop.system.api.domain.SysFile;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.stereotype.Component;
  7 +import org.springframework.web.multipart.MultipartFile;
  8 +import cn.brotop.common.core.domain.R;
  9 +import cn.brotop.system.api.RemoteFileService;
  10 +import feign.hystrix.FallbackFactory;
  11 +
  12 +/**
  13 + * 文件服务降级处理
  14 + *
  15 + * @author 啊雷
  16 + */
  17 +@Component
  18 +public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileService>
  19 +{
  20 + private static final Logger log = LoggerFactory.getLogger(RemoteFileFallbackFactory.class);
  21 +
  22 + @Override
  23 + public RemoteFileService create(Throwable throwable)
  24 + {
  25 + log.error("文件服务调用失败:{}", throwable.getMessage());
  26 + return new RemoteFileService()
  27 + {
  28 + @Override
  29 + public R<SysFile> upload(MultipartFile file)
  30 + {
  31 + return R.fail("上传文件失败:" + throwable.getMessage());
  32 + }
  33 + };
  34 + }
  35 +}
  1 +package cn.brotop.system.api.factory;
  2 +
  3 +import cn.brotop.system.api.domain.SysOperLog;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.stereotype.Component;
  7 +import cn.brotop.common.core.domain.R;
  8 +import cn.brotop.system.api.RemoteLogService;
  9 +import feign.hystrix.FallbackFactory;
  10 +
  11 +/**
  12 + * 日志服务降级处理
  13 + *
  14 + * @author 啊雷
  15 + */
  16 +@Component
  17 +public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogService>
  18 +{
  19 + private static final Logger log = LoggerFactory.getLogger(RemoteLogFallbackFactory.class);
  20 +
  21 + @Override
  22 + public RemoteLogService create(Throwable throwable)
  23 + {
  24 + log.error("日志服务调用失败:{}", throwable.getMessage());
  25 + return new RemoteLogService()
  26 + {
  27 + @Override
  28 + public R<Boolean> saveLog(SysOperLog sysOperLog)
  29 + {
  30 + return null;
  31 + }
  32 +
  33 + @Override
  34 + public R<Boolean> saveLogininfor(String username, String status, String message)
  35 + {
  36 + return null;
  37 + }
  38 + };
  39 +
  40 + }
  41 +}
  1 +package cn.brotop.system.api.factory;
  2 +
  3 +import org.slf4j.Logger;
  4 +import org.slf4j.LoggerFactory;
  5 +import org.springframework.stereotype.Component;
  6 +import cn.brotop.common.core.domain.R;
  7 +import cn.brotop.system.api.RemoteUserService;
  8 +import cn.brotop.system.api.model.LoginUser;
  9 +import feign.hystrix.FallbackFactory;
  10 +
  11 +/**
  12 + * 用户服务降级处理
  13 + *
  14 + * @author 啊雷
  15 + */
  16 +@Component
  17 +public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserService>
  18 +{
  19 + private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);
  20 +
  21 + @Override
  22 + public RemoteUserService create(Throwable throwable)
  23 + {
  24 + log.error("用户服务调用失败:{}", throwable.getMessage());
  25 + return new RemoteUserService()
  26 + {
  27 + @Override
  28 + public R<LoginUser> getUserInfo(String username)
  29 + {
  30 + return R.fail("获取用户失败:" + throwable.getMessage());
  31 + }
  32 + };
  33 + }
  34 +}
  1 +package cn.brotop.system.api.model;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Set;
  5 +
  6 +import cn.brotop.system.api.domain.SysUser;
  7 +
  8 +/**
  9 + * 用户信息
  10 + *
  11 + * @author 啊雷
  12 + */
  13 +public class LoginUser implements Serializable
  14 +{
  15 + private static final long serialVersionUID = 1L;
  16 +
  17 + /**
  18 + * 用户唯一标识
  19 + */
  20 + private String token;
  21 +
  22 + /**
  23 + * 用户名id
  24 + */
  25 + private Long userid;
  26 +
  27 + /**
  28 + * 用户名
  29 + */
  30 + private String username;
  31 +
  32 + /**
  33 + * 登录时间
  34 + */
  35 + private Long loginTime;
  36 +
  37 + /**
  38 + * 过期时间
  39 + */
  40 + private Long expireTime;
  41 +
  42 + /**
  43 + * 登录IP地址
  44 + */
  45 + private String ipaddr;
  46 +
  47 + /**
  48 + * 权限列表
  49 + */
  50 + private Set<String> permissions;
  51 +
  52 + /**
  53 + * 角色列表
  54 + */
  55 + private Set<String> roles;
  56 +
  57 + /**
  58 + * 用户信息
  59 + */
  60 + private SysUser sysUser;
  61 +
  62 + public String getToken()
  63 + {
  64 + return token;
  65 + }
  66 +
  67 + public void setToken(String token)
  68 + {
  69 + this.token = token;
  70 + }
  71 +
  72 + public Long getUserid()
  73 + {
  74 + return userid;
  75 + }
  76 +
  77 + public void setUserid(Long userid)
  78 + {
  79 + this.userid = userid;
  80 + }
  81 +
  82 + public String getUsername()
  83 + {
  84 + return username;
  85 + }
  86 +
  87 + public void setUsername(String username)
  88 + {
  89 + this.username = username;
  90 + }
  91 +
  92 + public Long getLoginTime()
  93 + {
  94 + return loginTime;
  95 + }
  96 +
  97 + public void setLoginTime(Long loginTime)
  98 + {
  99 + this.loginTime = loginTime;
  100 + }
  101 +
  102 + public Long getExpireTime()
  103 + {
  104 + return expireTime;
  105 + }
  106 +
  107 + public void setExpireTime(Long expireTime)
  108 + {
  109 + this.expireTime = expireTime;
  110 + }
  111 +
  112 + public String getIpaddr()
  113 + {
  114 + return ipaddr;
  115 + }
  116 +
  117 + public void setIpaddr(String ipaddr)
  118 + {
  119 + this.ipaddr = ipaddr;
  120 + }
  121 +
  122 + public Set<String> getPermissions()
  123 + {
  124 + return permissions;
  125 + }
  126 +
  127 + public void setPermissions(Set<String> permissions)
  128 + {
  129 + this.permissions = permissions;
  130 + }
  131 +
  132 + public Set<String> getRoles()
  133 + {
  134 + return roles;
  135 + }
  136 +
  137 + public void setRoles(Set<String> roles)
  138 + {
  139 + this.roles = roles;
  140 + }
  141 +
  142 + public SysUser getSysUser()
  143 + {
  144 + return sysUser;
  145 + }
  146 +
  147 + public void setSysUser(SysUser sysUser)
  148 + {
  149 + this.sysUser = sysUser;
  150 + }
  151 +}
  1 +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
  2 + cn.brotop.system.api.factory.RemoteUserFallbackFactory,\
  3 + cn.brotop.system.api.factory.RemoteLogFallbackFactory, \
  4 + cn.brotop.system.api.factory.RemoteFileFallbackFactory
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.brotop</groupId>
  7 + <artifactId>bro-admin-api</artifactId>
  8 + <version>1.0.0</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 +
  12 + <artifactId>bro-admin-api-user</artifactId>
  13 + <dependencies>
  14 + <!-- RuoYi Common Core-->
  15 + <dependency>
  16 + <groupId>cn.brotop</groupId>
  17 + <artifactId>bro-admin-common-core</artifactId>
  18 + </dependency>
  19 + </dependencies>
  20 +
  21 + <properties>
  22 + <maven.compiler.source>8</maven.compiler.source>
  23 + <maven.compiler.target>8</maven.compiler.target>
  24 + </properties>
  25 +
  26 +</project>
  1 +package cn.brotop.api.user.DTO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Builder;
  8 +import lombok.Data;
  9 +import lombok.NoArgsConstructor;
  10 +
  11 +@AllArgsConstructor
  12 +@NoArgsConstructor
  13 +@Builder
  14 +@Data
  15 +public class CommonlyPatientDTO {
  16 + @ApiModelProperty(value = "患者id")
  17 + @JsonSerialize(using = ToStringSerializer.class)
  18 + private Long patientId;
  19 +
  20 + @ApiModelProperty(value = "患者名字")
  21 + private String name;
  22 +
  23 + @ApiModelProperty(value = "患者年龄")
  24 + private Integer age;
  25 +
  26 + @ApiModelProperty(value = "患者性别")
  27 + private Integer patientGender;
  28 +
  29 + @ApiModelProperty(value = "处方id")
  30 + private Long commonlyId;
  31 +}
  1 +package cn.brotop.api.user.DTO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +import java.io.Serializable;
  9 +import java.util.List;
  10 +
  11 +@Data
  12 +public class PatientCategoryDTO implements Serializable {
  13 + @JsonSerialize(using = ToStringSerializer.class)
  14 + @ApiModelProperty(value = "id")
  15 + private Long id;
  16 +
  17 + @JsonSerialize(using = ToStringSerializer.class)
  18 + @ApiModelProperty(value = "patientId")
  19 + private Long patientId;
  20 +
  21 + @JsonSerialize(using = ToStringSerializer.class)
  22 + @ApiModelProperty(value = "categoryId")
  23 + private List<Long> categoryIds;//分组id
  24 +}
  1 +package cn.brotop.api.user.DTO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Builder;
  8 +import lombok.Data;
  9 +import lombok.NoArgsConstructor;
  10 +
  11 +import java.time.LocalDate;
  12 +import java.time.LocalDateTime;
  13 +
  14 +@AllArgsConstructor
  15 +@NoArgsConstructor
  16 +@Builder
  17 +@Data
  18 +public class PatientConmonlyDTO {
  19 + @ApiModelProperty(value = "id")
  20 + @JsonSerialize(using = ToStringSerializer.class)
  21 + private Long id;
  22 +
  23 + @ApiModelProperty(value = "患者名称")
  24 + private String patientName;
  25 +
  26 + @ApiModelProperty(value = "患者身份证号")
  27 + private String patientCard;
  28 +
  29 + @ApiModelProperty(value = "年龄")
  30 + private Integer age;
  31 +
  32 + @ApiModelProperty(value = "患者生日")
  33 + private LocalDate patientBirthday;
  34 +
  35 + @ApiModelProperty(value = "患者性别")
  36 + private Integer patientGender;
  37 +
  38 + @ApiModelProperty(value = "患者手机号")
  39 + private String phoneNumber;
  40 + /**
  41 + * 患者患病类型
  42 + */
  43 + @ApiModelProperty(value = "患者患病类型")
  44 + private String IllType;
  45 + /*
  46 + * 病例详情
  47 + * */
  48 + @ApiModelProperty(value = "病例详情")
  49 + private String casesOfDetails;
  50 + /*
  51 + * 问诊方式
  52 + * */
  53 + @ApiModelProperty(value = "问诊方式")
  54 + private Long InterrogationWay;
  55 + /*
  56 + *问诊时间
  57 + * */
  58 + @ApiModelProperty(value = "问诊时间")
  59 + private LocalDateTime InterrogationTime;
  60 +
  61 + @ApiModelProperty(value = "问诊状态")
  62 + private String InterrogationStatus;
  63 +}
  1 +package cn.brotop.api.user.DTO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Builder;
  8 +import lombok.Data;
  9 +import lombok.NoArgsConstructor;
  10 +
  11 +import java.io.Serializable;
  12 +
  13 +@AllArgsConstructor
  14 +@NoArgsConstructor
  15 +@Builder
  16 +@Data
  17 +public class PatientDTO implements Serializable {
  18 +
  19 + @ApiModelProperty(value = "id")
  20 + @JsonSerialize(using = ToStringSerializer.class)
  21 + private Long id;
  22 + @ApiModelProperty(value = "患者id")
  23 + private Long patientId;
  24 +
  25 + @ApiModelProperty(value = "医生id")
  26 + private Long doctorId;
  27 +
  28 + @ApiModelProperty(value = "评价")
  29 + private String doctorEvaluate;
  30 +
  31 + @ApiModelProperty(value = "评价时间")
  32 + private String doctorEvaluateTime;
  33 +}
  1 +package cn.brotop.api.user.DTO;
  2 +
  3 +import lombok.AllArgsConstructor;
  4 +import lombok.Builder;
  5 +import lombok.Data;
  6 +import lombok.NoArgsConstructor;
  7 +
  8 +import java.io.Serializable;
  9 +import java.math.BigDecimal;
  10 +import java.time.LocalDateTime;
  11 +
  12 +/**
  13 + * @author 啊雷
  14 + * @version 1.0
  15 + * @date 2021/1/20 10:00
  16 + */
  17 +@AllArgsConstructor
  18 +@NoArgsConstructor
  19 +@Builder
  20 +@Data
  21 +public class UserDTO implements Serializable {
  22 + /**
  23 + * 用户id
  24 + */
  25 + private Long id;
  26 +
  27 + /**
  28 + * 用户手机号
  29 + */
  30 + private String phoneNumber;
  31 +
  32 + /**
  33 + * 密码
  34 + */
  35 + private String password;
  36 +
  37 + /**
  38 + * 头像
  39 + */
  40 + private String avatar;
  41 +
  42 + /**
  43 + * 昵称
  44 + */
  45 + private String nickName;
  46 +
  47 + /**
  48 + * 余额
  49 + */
  50 + private BigDecimal balance;
  51 +
  52 + /**
  53 + * 积分
  54 + */
  55 + private Integer integral;
  56 +
  57 + /**
  58 + * openIdOne
  59 + */
  60 + private String openIdOne;
  61 +
  62 + /**
  63 + * openIdTwo
  64 + */
  65 + private String openIdTwo;
  66 +
  67 + /**
  68 + * unionId
  69 + */
  70 + private String unionId;
  71 +
  72 + /**
  73 + * 创建时间
  74 + */
  75 + private LocalDateTime created;
  76 +
  77 + /**
  78 + * 上级id
  79 + */
  80 + private Long superId;
  81 +
  82 + /**
  83 + * 状态 1正常
  84 + */
  85 + private Integer status;
  86 +
  87 + private Integer age;
  88 +
  89 + private Integer userGender;
  90 +}
  91 +
  1 +package cn.brotop.api.user;
  2 +
  3 +import cn.brotop.api.user.DTO.PatientCategoryDTO;
  4 +import cn.brotop.api.user.VO.PatientCateVO;
  5 +import cn.brotop.api.user.VO.PatientOrderVO;
  6 +import cn.brotop.api.user.VO.PatientRecordedsVO;
  7 +import cn.brotop.api.user.VO.RecordedVO;
  8 +import cn.brotop.api.user.DTO.PatientDTO;
  9 +import cn.brotop.api.user.VO.*;
  10 +import cn.brotop.api.user.factory.RemoteUserModFallbackFactory;
  11 +import cn.brotop.common.core.constant.ServiceNameConstants;
  12 +import cn.brotop.common.core.domain.R;
  13 +import org.springframework.cloud.openfeign.FeignClient;
  14 +import org.springframework.web.bind.annotation.*;
  15 +
  16 +import java.util.List;
  17 +@FeignClient(contextId = "remotePatientModService", value = ServiceNameConstants.USER_SERVICE, fallbackFactory = RemoteUserModFallbackFactory.class)
  18 +public interface RemotePatientModService {
  19 + /**
  20 + * 查询患者所有信息评价
  21 + */
  22 + @GetMapping(value = "/remote_user_patient/findPatient")
  23 + R<List<PatientDTO>> findPatient(@RequestParam("doctorId") Long doctorId);
  24 +
  25 + /**
  26 + * 查询患者所有信息好评
  27 + */
  28 + @GetMapping(value = "/remote_user_patient/findPatientGood")
  29 + R<List<PatientDTO>> findPatientGood(@RequestParam("doctorEvaluate") String doctorEvaluate);
  30 +
  31 + /**
  32 + * 查询分组内所有患者
  33 + * @return
  34 + */
  35 + @GetMapping(value = "/remote_user_patient/selectList")
  36 + R<List<PatientCateVO>> selectList(@RequestParam("categoryId") Long categoryId);
  37 +
  38 + /**
  39 + *患者资料
  40 + */
  41 + @GetMapping(value = "/remote_user_patient/selectOne")
  42 + R<PatientRecordedsVO> selectOne(@RequestParam("patientId") Long patientId);
  43 +
  44 + /**
  45 + * 修改当前分组
  46 + */
  47 + @PostMapping(value = "/remote_user_patient/updateCategory")
  48 + R<Integer> updateCategory(@RequestBody PatientCategoryDTO patientCategoryDTOS);
  49 +
  50 +
  51 + /**
  52 + *修改备注
  53 + */
  54 + @PostMapping(value = "/remote_user_patient/updateText")
  55 + R<Integer> updateText(@RequestBody PatientRecordedsVO patientRecordedsVO);
  56 +
  57 + /**
  58 + * 查询订单患者信息
  59 + * @param id
  60 + * @return
  61 + */
  62 + @GetMapping(value = "/remote_user_patient/selectPatient")
  63 + PatientOrderVO selectPatient(@RequestParam("id") Long id);
  64 + /**
  65 + * 根据患者id查询患者问诊详情 点击接诊 退诊改变状态
  66 + * @param patientId
  67 + * @param status
  68 + * @return
  69 + */
  70 + @GetMapping(value = "/remote_user_patient/updateStatus")
  71 + public R<RecordedVO> updateStatus(@RequestParam("patientId") Long patientId, @RequestParam("status") Integer status);
  72 +}
  1 +package cn.brotop.api.user;
  2 +
  3 +import cn.brotop.api.user.DTO.UserDTO;
  4 +import cn.brotop.api.user.factory.RemoteUserModFallbackFactory;
  5 +import cn.brotop.common.core.constant.ServiceNameConstants;
  6 +import cn.brotop.common.core.domain.R;
  7 +import org.springframework.cloud.openfeign.FeignClient;
  8 +import org.springframework.web.bind.annotation.GetMapping;
  9 +import org.springframework.web.bind.annotation.PostMapping;
  10 +import org.springframework.web.bind.annotation.RequestBody;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +
  13 +/**
  14 + * 用户模块API服务
  15 + * @author 啊雷
  16 + * @version 1.0
  17 + * @date 2021/1/20 9:47
  18 + */
  19 +@FeignClient(contextId = "remoteUserModService", value = ServiceNameConstants.USER_SERVICE, fallbackFactory = RemoteUserModFallbackFactory.class)
  20 +public interface RemoteUserModService {
  21 +
  22 + /**
  23 + * 根据用户id 查询用户信息
  24 + * @param userId 用户id
  25 + * @return R<UserDTO>
  26 + */
  27 + @GetMapping(value = "/remote_user/getUser")
  28 + R<UserDTO> getUser(@RequestParam("userId") Long userId);
  29 +
  30 + /**
  31 + * 根据手机 查询用户信息
  32 + * @param mobile 手机号
  33 + * @return R<UserDTO>
  34 + */
  35 + @GetMapping(value = "/remote_user/findByMobile")
  36 + R<UserDTO> findByMobile(@RequestParam("mobile") String mobile);
  37 +
  38 + /**
  39 + * 新增
  40 + * @param userDTO userDTO
  41 + * @return R<?>
  42 + */
  43 + @PostMapping(value = "/remote_hospital/save")
  44 + R<?> save(@RequestBody UserDTO userDTO);
  45 +
  46 + /**
  47 + * 根据openId查询用户信息
  48 + * @param openid openid
  49 + * @return R<UserDTO>
  50 + */
  51 + @GetMapping(value = "/remote_user/findByOpenId")
  52 + R<UserDTO> findByOpenId(@RequestParam("openid") String openid);
  53 +
  54 + /**
  55 + * 根据unionid查询用户信息
  56 + * @param unionid unionid
  57 + * @return R<UserDTO>
  58 + */
  59 + @GetMapping(value = "/remote_user/findByUnionid")
  60 + R<UserDTO> findByUnionid(@RequestParam("unionid") String unionid);
  61 +
  62 + /**
  63 + * 根据id 查询用户di
  64 + * @param userId userID
  65 + * @return R<UserDTO>>
  66 + */
  67 + @GetMapping(value = "/remote_user/findById")
  68 + R<UserDTO> findById(@RequestParam("userId") Long userId);
  69 +
  70 + /**
  71 + * 更新用户信息
  72 + * @param data data
  73 + */
  74 + @PostMapping(value = "/remote_hospital/updateById")
  75 + R<?> updateById(@RequestBody UserDTO data);
  76 + /**
  77 + * 删除用户信息
  78 + * @param
  79 + */
  80 + @GetMapping(value = "/remote_user/deleteUser")
  81 + R<Integer> deleteUser(@RequestParam("id") Long id);
  82 +
  83 +
  84 +}
  1 +package cn.brotop.api.user.VO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +import java.time.LocalDateTime;
  9 +
  10 +@Data
  11 +public class PatientCateVO {
  12 + @JsonSerialize(using = ToStringSerializer.class)
  13 + @ApiModelProperty(value = "患者id")
  14 + private Long patientId;
  15 +
  16 + @ApiModelProperty(value = "患者名称")
  17 + private String patientName;
  18 +
  19 + @ApiModelProperty(value = "患者性别")
  20 + private Integer patientGender;
  21 +
  22 + @ApiModelProperty(value = "患者头像")
  23 + private String patientAvater;
  24 +
  25 + @ApiModelProperty(value = "患者年龄")
  26 + private Integer age;
  27 +
  28 + @ApiModelProperty(value = "添加时间")
  29 + private LocalDateTime createTime;
  30 +
  31 + @ApiModelProperty(value = "问诊方式")
  32 + private Integer iquiryWay;
  33 +
  34 + @ApiModelProperty(value = "类别id")
  35 + private Long categoryId;
  36 +}
  1 +package cn.brotop.api.user.VO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import cn.brotop.common.core.annotation.Desensitization;
  6 +import cn.brotop.common.core.enums.DesensitionType;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import lombok.Data;
  9 +
  10 +import java.io.Serializable;
  11 +import java.util.List;
  12 +
  13 +@Data
  14 +public class PatientCategoryVOS implements Serializable {
  15 + @JsonSerialize(using = ToStringSerializer.class)
  16 + @ApiModelProperty(value = "id")
  17 + private Long id;
  18 +
  19 + @JsonSerialize(using = ToStringSerializer.class)
  20 + @ApiModelProperty(value = "doctorpatientId")
  21 + private Long patientId;
  22 +
  23 + @JsonSerialize(using = ToStringSerializer.class)
  24 + @ApiModelProperty(value = "categoryId")
  25 + private Long categoryId;//分组id
  26 +}
  1 +package cn.brotop.api.user.VO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import cn.brotop.common.core.annotation.Desensitization;
  6 +import cn.brotop.common.core.enums.DesensitionType;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import lombok.Builder;
  9 +import lombok.Data;
  10 +
  11 +import java.io.Serializable;
  12 +import java.math.BigDecimal;
  13 +import java.time.LocalDateTime;
  14 +
  15 +@Data
  16 +@Builder
  17 +public class PatientOrderVO implements Serializable {
  18 + @JsonSerialize(using = ToStringSerializer.class)
  19 + @ApiModelProperty(value = "患者id")
  20 + private Long patientId;
  21 +
  22 + @ApiModelProperty(value = "患者名字")
  23 + private String patientName;
  24 +
  25 + @ApiModelProperty(value = "患者性别")
  26 + private Integer patientGender;
  27 +
  28 + @ApiModelProperty(value = "患者年龄")
  29 + private Integer age;
  30 +
  31 + @ApiModelProperty(value = "患者手机号")
  32 + @Desensitization(value = DesensitionType.patientCard)
  33 + private String phoneNumber;
  34 +
  35 + @ApiModelProperty(value = "问诊方式")
  36 + private Integer iquiryWay;
  37 +
  38 + @ApiModelProperty(value = "患者问诊科室")
  39 + private String iquiryOffice;
  40 +
  41 + @ApiModelProperty(value = "问诊单价")
  42 + private BigDecimal price;
  43 +
  44 + @ApiModelProperty(value = "优惠")
  45 + private BigDecimal favorable;
  46 +
  47 + @ApiModelProperty(value = "实付款")
  48 + private BigDecimal actualPayment;
  49 +
  50 + @ApiModelProperty(value = "订单编号")
  51 + private String orderSn;
  52 +
  53 + @ApiModelProperty(value = "创建时间")
  54 + private LocalDateTime createTime;
  55 +
  56 + @ApiModelProperty(value = "支付时间")
  57 + private LocalDateTime payTime;
  58 +
  59 + @ApiModelProperty(value = "支付方式")
  60 + private Integer payWay;
  61 +
  62 + @ApiModelProperty(value = "退款时间")
  63 + private LocalDateTime resultTime;
  64 +
  65 + @ApiModelProperty(value = "退款方式")
  66 + private Integer resultType;
  67 +
  68 + @ApiModelProperty(value = "实退款")
  69 + private BigDecimal resultPayment;
  70 +
  71 + @ApiModelProperty(value = "订单备注 1-待付款 2-已完成 3-已关闭")
  72 + private Integer orderRemark;
  73 +
  74 +
  75 + public PatientOrderVO() {
  76 + }
  77 +
  78 + public PatientOrderVO(Long patientId, String patientName, Integer patientGender, Integer age, String phoneNumber, Integer iquiryWay, String iquiryOffice, BigDecimal price, BigDecimal favorable, BigDecimal actualPayment, String orderSn, LocalDateTime createTime, LocalDateTime payTime, Integer payWay, LocalDateTime resultTime, Integer resultType, BigDecimal resultPayment, Integer orderRemark) {
  79 + this.patientId = patientId;
  80 + this.patientName = patientName;
  81 + this.patientGender = patientGender;
  82 + this.age = age;
  83 + this.phoneNumber = phoneNumber;
  84 + this.iquiryWay = iquiryWay;
  85 + this.iquiryOffice = iquiryOffice;
  86 + this.price = price;
  87 + this.favorable = favorable;
  88 + this.actualPayment = actualPayment;
  89 + this.orderSn = orderSn;
  90 + this.createTime = createTime;
  91 + this.payTime = payTime;
  92 + this.payWay = payWay;
  93 + this.resultTime = resultTime;
  94 + this.resultType = resultType;
  95 + this.resultPayment = resultPayment;
  96 + this.orderRemark = orderRemark;
  97 + }
  98 +}
  1 +package cn.brotop.api.user.VO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import cn.brotop.common.core.annotation.Desensitization;
  6 +import cn.brotop.common.core.enums.DesensitionType;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import lombok.Data;
  9 +
  10 +import java.io.Serializable;
  11 +import java.util.List;
  12 +
  13 +@Data
  14 +public class PatientRecordedsVO implements Serializable {
  15 + @JsonSerialize(using = ToStringSerializer.class)
  16 + @ApiModelProperty(value = "id")
  17 + private Long id;
  18 +
  19 + @JsonSerialize(using = ToStringSerializer.class)
  20 + @ApiModelProperty(value = "patientId")
  21 + private Long patientId;
  22 +
  23 + @ApiModelProperty(value = "患者头像")
  24 + private String patientAvater;
  25 +
  26 + @ApiModelProperty(value = "患者名称")
  27 + private String patientName;
  28 +
  29 + @ApiModelProperty(value = "患者性别")
  30 + private Integer patientGender;
  31 +
  32 + @ApiModelProperty(value = "患者年龄")
  33 + private Integer age;
  34 +
  35 + @Desensitization(value = DesensitionType.phoneNumber)
  36 + @ApiModelProperty(value = "患者手机号")
  37 + private String phoneNumber;
  38 +
  39 + @Desensitization(value = DesensitionType.patientCard)
  40 + @ApiModelProperty(value = "患者身份证")
  41 + private String IDCard;
  42 +
  43 + @ApiModelProperty(value = "患者所在省份")
  44 + private String patientProvinceName;
  45 +
  46 + @ApiModelProperty(value = "患者所在城")
  47 + private String patientCityName;
  48 +
  49 + @ApiModelProperty(value = "患者所在区")
  50 + private String patientCountyName;
  51 +
  52 + @ApiModelProperty(value = "患者备注")
  53 + private String text;
  54 +
  55 +
  56 + private String name;
  57 +
  58 + private List<RecordedVO> patientRecordedList;
  59 +
  60 +}
  1 +package cn.brotop.api.user.VO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import cn.brotop.common.core.annotation.Desensitization;
  6 +import cn.brotop.common.core.enums.DesensitionType;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import lombok.AllArgsConstructor;
  9 +import lombok.Builder;
  10 +import lombok.Data;
  11 +import lombok.NoArgsConstructor;
  12 +
  13 +@Data
  14 +public class PatientVO {
  15 +
  16 + @ApiModelProperty(value = "患者id")
  17 + @JsonSerialize(using = ToStringSerializer.class)
  18 + private Long patientId;
  19 +
  20 + @ApiModelProperty(value = "医生id")
  21 + @JsonSerialize(using = ToStringSerializer.class)
  22 + private Long doctorId;
  23 +
  24 + @ApiModelProperty(value = "患者头像")
  25 + private String patientAvater;
  26 +
  27 + @ApiModelProperty(value = "患者性别")
  28 + private Integer patientGender;
  29 +
  30 + @ApiModelProperty(value = "患者名称")
  31 + private String patientName;
  32 +
  33 + @ApiModelProperty(value = "患者年龄")
  34 + private Integer age;
  35 +
  36 + @ApiModelProperty(value = "患者手机号")
  37 + @Desensitization(value = DesensitionType.phoneNumber)
  38 + private String phoneNumber;
  39 +
  40 +}
  1 +package cn.brotop.api.user.VO;
  2 +
  3 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +import java.io.Serializable;
  9 +import java.time.LocalDateTime;
  10 +
  11 +@Data
  12 +public class RecordedVO implements Serializable {
  13 + @JsonSerialize(using = ToStringSerializer.class)
  14 + @ApiModelProperty(value = "id")
  15 + private Long id;
  16 + @JsonSerialize(using = ToStringSerializer.class)
  17 + @ApiModelProperty(value = "patientId")
  18 + private Long patientId;
  19 +
  20 +
  21 + @ApiModelProperty(value = "病情描述")
  22 + private String IllnessDescription;
  23 +
  24 +
  25 + @ApiModelProperty(value = "患病时间")
  26 + private LocalDateTime sickTime;
  27 +
  28 +
  29 + @ApiModelProperty(value = "问诊方式")
  30 + private Integer inquiryWay;
  31 +
  32 +
  33 + @ApiModelProperty(value = "问诊状态")
  34 + private Integer status;
  35 +}
  1 +package cn.brotop.api.user.factory;
  2 +
  3 +import cn.brotop.api.user.DTO.PatientCategoryDTO;
  4 +import cn.brotop.api.user.DTO.PatientDTO;
  5 +import cn.brotop.api.user.DTO.UserDTO;
  6 +import cn.brotop.api.user.RemotePatientModService;
  7 +import cn.brotop.api.user.RemoteUserModService;
  8 +import cn.brotop.api.user.VO.PatientCateVO;
  9 +import cn.brotop.api.user.VO.PatientOrderVO;
  10 +import cn.brotop.api.user.VO.PatientRecordedsVO;
  11 +import cn.brotop.api.user.VO.RecordedVO;
  12 +import cn.brotop.common.core.domain.R;
  13 +import feign.hystrix.FallbackFactory;
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +
  17 +import java.util.List;
  18 +
  19 +/**
  20 + * @program: Rejoie-Admin-Cloud
  21 + * @className: RemoteDoctorFallbackFactory
  22 + * @description: 用户模块服务异常返回
  23 + * @author: alei
  24 + * @create: 2021-05-18 16:35
  25 + **/
  26 +public class RemotePatientModFallbackFactory implements FallbackFactory<RemotePatientModService> {
  27 + private static final Logger log = LoggerFactory.getLogger(RemotePatientModFallbackFactory.class);
  28 + @Override
  29 + public RemotePatientModService create(Throwable throwable)
  30 + {
  31 + log.error("用户模块服务调用失败:{}", throwable.getMessage());
  32 + return new RemotePatientModService()
  33 + {
  34 +
  35 + @Override
  36 + public R<List<PatientDTO>> findPatient(Long doctorId) {
  37 + return R.fail("用户模块服务调用失败");
  38 + }
  39 +
  40 + @Override
  41 + public R<List<PatientDTO>> findPatientGood(String doctorEvaluate) {
  42 + return R.fail("用户模块服务调用失败");
  43 + }
  44 +
  45 + @Override
  46 + public R<List<PatientCateVO>> selectList(Long categoryId) {
  47 + return R.fail("用户模块服务调用失败");
  48 + }
  49 +
  50 + @Override
  51 + public R<PatientRecordedsVO> selectOne(Long patientId) {
  52 + return R.fail("用户模块服务调用失败");
  53 + }
  54 +
  55 + @Override
  56 + public R<Integer> updateCategory(PatientCategoryDTO patientCategoryDTOS) {
  57 + return R.fail("用户模块服务调用失败");
  58 + }
  59 +
  60 + @Override
  61 + public R<Integer> updateText(PatientRecordedsVO patientRecordedsVO) {
  62 + return R.fail("用户模块服务调用失败");
  63 + }
  64 +
  65 + @Override
  66 + public PatientOrderVO selectPatient(Long id) {
  67 + return null;
  68 + }
  69 +
  70 + @Override
  71 + public R<RecordedVO> updateStatus(Long patientId, Integer status) {
  72 + return R.fail("用户模块服务调用失败");
  73 + }
  74 + };
  75 + }
  76 +
  77 +}
  1 +package cn.brotop.api.user.factory;
  2 +
  3 +import cn.brotop.api.user.DTO.UserDTO;
  4 +import cn.brotop.api.user.RemoteUserModService;
  5 +import cn.brotop.common.core.domain.R;
  6 +import cn.brotop.common.core.utils.StringUtils;
  7 +import feign.hystrix.FallbackFactory;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * @program: Rejoie-Admin-Cloud
  16 + * @className: RemoteDoctorFallbackFactory
  17 + * @description: 用户模块服务异常返回
  18 + * @author: alei
  19 + * @create: 2021-05-18 16:35
  20 + **/
  21 +public class RemoteUserModFallbackFactory implements FallbackFactory<RemoteUserModService> {
  22 + private static final Logger log = LoggerFactory.getLogger(RemoteUserModFallbackFactory.class);
  23 + @Override
  24 + public RemoteUserModService create(Throwable throwable)
  25 + {
  26 + log.error("用户模块服务调用失败:{}", throwable.getMessage());
  27 + return new RemoteUserModService()
  28 + {
  29 +
  30 + @Override
  31 + public R<UserDTO> getUser(Long userId) {
  32 + return R.fail("用户模块服务调用失败");
  33 + }
  34 +
  35 + @Override
  36 + public R<UserDTO> findByMobile(String mobile) {
  37 + return R.fail("用户模块服务调用失败");
  38 + }
  39 +
  40 + @Override
  41 + public R<?> save(UserDTO userDTO) {
  42 + return R.fail("用户模块服务调用失败");
  43 + }
  44 +
  45 + @Override
  46 + public R<UserDTO> findByOpenId(String openid) {
  47 + return R.fail("用户模块服务调用失败");
  48 + }
  49 +
  50 + @Override
  51 + public R<UserDTO> findByUnionid(String unionid) {
  52 + return R.fail("用户模块服务调用失败");
  53 + }
  54 +
  55 + @Override
  56 + public R<UserDTO> findById(Long userId) {
  57 + return R.fail("用户模块服务调用失败");
  58 + }
  59 +
  60 + @Override
  61 + public R<?> updateById(UserDTO data) {
  62 + return R.fail("用户模块服务调用失败");
  63 + }
  64 +
  65 + @Override
  66 + public R<Integer> deleteUser(Long id) {
  67 + return R.fail("用户模块服务调用失败");
  68 + }
  69 + };
  70 + }
  71 +
  72 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4 + <parent>
  5 + <groupId>cn.brotop</groupId>
  6 + <artifactId>Bro-Admin-Cloud</artifactId>
  7 + <version>1.0.0</version>
  8 + </parent>
  9 + <modelVersion>4.0.0</modelVersion>
  10 +
  11 + <modules>
  12 + <module>bro-admin-api-auth</module>
  13 + <module>bro-admin-api-doctor</module>
  14 + <module>bro-admin-api-hospital</module>
  15 + <module>bro-admin-api-payment</module>
  16 + <module>bro-admin-api-user</module>
  17 + <module>bro-admin-api-system</module>
  18 + </modules>
  19 +
  20 + <artifactId>bro-admin-api</artifactId>
  21 + <packaging>pom</packaging>
  22 +
  23 + <description>
  24 + bro-admin-api系统接口
  25 + </description>
  26 +
  27 +</project>
  1 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  2 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4 + <parent>
  5 + <groupId>cn.brotop</groupId>
  6 + <artifactId>Bro-Admin-Cloud</artifactId>
  7 + <version>1.0.0</version>
  8 + </parent>
  9 + <modelVersion>4.0.0</modelVersion>
  10 +
  11 + <artifactId>bro-admin-auth</artifactId>
  12 +
  13 + <description>
  14 + bro-admin-auth认证授权中心
  15 + </description>
  16 +
  17 + <dependencies>
  18 +
  19 + <!-- SpringCloud Alibaba Nacos -->
  20 + <dependency>
  21 + <groupId>com.alibaba.cloud</groupId>
  22 + <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
  23 + </dependency>
  24 +
  25 + <!-- SpringCloud Alibaba Nacos Config -->
  26 + <dependency>
  27 + <groupId>com.alibaba.cloud</groupId>
  28 + <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
  29 + </dependency>
  30 +
  31 + <!-- SpringCloud Alibaba Sentinel -->
  32 + <dependency>
  33 + <groupId>com.alibaba.cloud</groupId>
  34 + <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
  35 + </dependency>
  36 +
  37 + <!-- SpringBoot Web -->
  38 + <dependency>
  39 + <groupId>org.springframework.boot</groupId>
  40 + <artifactId>spring-boot-starter-web</artifactId>
  41 + </dependency>
  42 +
  43 + <!-- SpringBoot Actuator -->
  44 + <dependency>
  45 + <groupId>org.springframework.boot</groupId>
  46 + <artifactId>spring-boot-starter-actuator</artifactId>
  47 + </dependency>
  48 +
  49 + <!-- RuoYi Common Security-->
  50 + <dependency>
  51 + <groupId>cn.brotop</groupId>
  52 + <artifactId>bro-admin-common-security</artifactId>
  53 + </dependency>
  54 +
  55 + </dependencies>
  56 +
  57 + <build>
  58 + <finalName>${project.artifactId}</finalName>
  59 + <plugins>
  60 + <plugin>
  61 + <groupId>org.springframework.boot</groupId>
  62 + <artifactId>spring-boot-maven-plugin</artifactId>
  63 + <executions>
  64 + <execution>
  65 + <goals>
  66 + <goal>repackage</goal>
  67 + </goals>
  68 + </execution>
  69 + </executions>
  70 + </plugin>
  71 + </plugins>
  72 + </build>
  73 +
  74 +</project>
  1 +package cn.brotop.auth;
  2 +
  3 +import org.springframework.boot.SpringApplication;
  4 +import org.springframework.boot.autoconfigure.SpringBootApplication;
  5 +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
  6 +import cn.brotop.common.security.annotation.EnableRyFeignClients;
  7 +import org.springframework.core.io.ClassPathResource;
  8 +
  9 +import java.io.BufferedReader;
  10 +import java.io.InputStream;
  11 +import java.io.InputStreamReader;
  12 +
  13 +/**
  14 + * 认证授权中心
  15 + *
  16 + * @author 啊雷
  17 + */
  18 +@EnableRyFeignClients
  19 +@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
  20 +public class BroAdminAuthApplication
  21 +{
  22 + public static void main(String[] args)
  23 + {
  24 + SpringApplication.run(BroAdminAuthApplication.class, args);
  25 +
  26 + // 启动成功后打印启动 Banner
  27 + printlnStartBanner();
  28 + }
  29 +
  30 + public static void printlnStartBanner(){
  31 +
  32 + ClassPathResource classPathResource = new ClassPathResource("banner_start.txt");
  33 + InputStream inputStream = null;
  34 + BufferedReader in = null;
  35 + try {
  36 + if (classPathResource.exists()){
  37 + in = new BufferedReader(new InputStreamReader(classPathResource.getInputStream(), "UTF-8"));
  38 + String line = null;
  39 + while ((line = in.readLine()) != null){
  40 + System.out.println("\t" + line);
  41 + }
  42 + }
  43 + }catch (Exception e){
  44 + e.printStackTrace();
  45 + }finally {
  46 + try {
  47 + if (inputStream != null){
  48 + inputStream.close();
  49 + }
  50 + }catch (Exception e){
  51 + e.printStackTrace();
  52 + }
  53 + try {
  54 + if (in != null){
  55 + in.close();
  56 + }
  57 + }catch (Exception e){
  58 + e.printStackTrace();
  59 + }
  60 + }
  61 + }
  62 +}
  1 +package cn.brotop.auth.controller;
  2 +
  3 +import javax.servlet.http.HttpServletRequest;
  4 +import org.springframework.beans.factory.annotation.Autowired;
  5 +import org.springframework.web.bind.annotation.DeleteMapping;
  6 +import org.springframework.web.bind.annotation.PostMapping;
  7 +import org.springframework.web.bind.annotation.RequestBody;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +import cn.brotop.auth.form.LoginBody;
  10 +import cn.brotop.auth.service.SysLoginService;
  11 +import cn.brotop.common.core.domain.R;
  12 +import cn.brotop.common.core.utils.StringUtils;
  13 +import cn.brotop.common.security.service.TokenService;
  14 +import cn.brotop.system.api.model.LoginUser;
  15 +
  16 +/**
  17 + * token 控制
  18 + *
  19 + * @author 啊雷
  20 + */
  21 +@RestController
  22 +public class TokenController
  23 +{
  24 + @Autowired
  25 + private TokenService tokenService;
  26 +
  27 + @Autowired
  28 + private SysLoginService sysLoginService;
  29 +
  30 + @PostMapping("login")
  31 + public R<?> login(@RequestBody LoginBody form)
  32 + {
  33 + // 用户登录
  34 + LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
  35 + // 获取登录token
  36 + return R.ok(tokenService.createToken(userInfo));
  37 + }
  38 +
  39 + @DeleteMapping("logout")
  40 + public R<?> logout(HttpServletRequest request)
  41 + {
  42 + LoginUser loginUser = tokenService.getLoginUser(request);
  43 + if (StringUtils.isNotNull(loginUser))
  44 + {
  45 + String username = loginUser.getUsername();
  46 + // 删除用户缓存记录
  47 + tokenService.delLoginUser(loginUser.getToken());
  48 + // 记录用户退出日志
  49 + sysLoginService.logout(username);
  50 + }
  51 + return R.ok();
  52 + }
  53 +
  54 + @PostMapping("refresh")
  55 + public R<?> refresh(HttpServletRequest request)
  56 + {
  57 + LoginUser loginUser = tokenService.getLoginUser(request);
  58 + if (StringUtils.isNotNull(loginUser))
  59 + {
  60 + // 刷新令牌有效期
  61 + tokenService.refreshToken(loginUser);
  62 + return R.ok();
  63 + }
  64 + return R.ok();
  65 + }
  66 +}
  1 +package cn.brotop.auth.form;
  2 +
  3 +/**
  4 + * 用户登录对象
  5 + *
  6 + * @author 啊雷
  7 + */
  8 +public class LoginBody
  9 +{
  10 + /**
  11 + * 用户名
  12 + */
  13 + private String username;
  14 +
  15 + /**
  16 + * 用户密码
  17 + */
  18 + private String password;
  19 +
  20 + public String getUsername()
  21 + {
  22 + return username;
  23 + }
  24 +
  25 + public void setUsername(String username)
  26 + {
  27 + this.username = username;
  28 + }
  29 +
  30 + public String getPassword()
  31 + {
  32 + return password;
  33 + }
  34 +
  35 + public void setPassword(String password)
  36 + {
  37 + this.password = password;
  38 + }
  39 +}
  1 +package cn.brotop.auth.service;
  2 +
  3 +import org.springframework.beans.factory.annotation.Autowired;
  4 +import org.springframework.stereotype.Component;
  5 +import cn.brotop.common.core.constant.Constants;
  6 +import cn.brotop.common.core.constant.UserConstants;
  7 +import cn.brotop.common.core.domain.R;
  8 +import cn.brotop.common.core.enums.UserStatus;
  9 +import cn.brotop.common.core.exception.BaseException;
  10 +import cn.brotop.common.core.utils.SecurityUtils;
  11 +import cn.brotop.common.core.utils.StringUtils;
  12 +import cn.brotop.system.api.RemoteLogService;
  13 +import cn.brotop.system.api.RemoteUserService;
  14 +import cn.brotop.system.api.domain.SysUser;
  15 +import cn.brotop.system.api.model.LoginUser;
  16 +
  17 +/**
  18 + * 登录校验方法
  19 + *
  20 + * @author 啊雷
  21 + */
  22 +@Component
  23 +public class SysLoginService
  24 +{
  25 + @Autowired
  26 + private RemoteLogService remoteLogService;
  27 +
  28 + @Autowired
  29 + private RemoteUserService remoteUserService;
  30 +
  31 + /**
  32 + * 登录
  33 + */
  34 + public LoginUser login(String username, String password)
  35 + {
  36 + // 用户名或密码为空 错误
  37 + if (StringUtils.isAnyBlank(username, password))
  38 + {
  39 + remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写");
  40 + throw new BaseException("用户/密码必须填写");
  41 + }
  42 + // 密码如果不在指定范围内 错误
  43 + if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
  44 + || password.length() > UserConstants.PASSWORD_MAX_LENGTH)
  45 + {
  46 + remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "用户密码不在指定范围");
  47 + throw new BaseException("用户密码不在指定范围");
  48 + }
  49 + // 用户名不在指定范围内 错误
  50 + if (username.length() < UserConstants.USERNAME_MIN_LENGTH
  51 + || username.length() > UserConstants.USERNAME_MAX_LENGTH)
  52 + {
  53 + remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "用户名不在指定范围");
  54 + throw new BaseException("用户名不在指定范围");
  55 + }
  56 + // 查询用户信息
  57 + R<LoginUser> userResult = remoteUserService.getUserInfo(username);
  58 +
  59 + if (R.FAIL == userResult.getCode())
  60 + {
  61 + throw new BaseException(userResult.getMsg());
  62 + }
  63 +
  64 + if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData()))
  65 + {
  66 + remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在");
  67 + throw new BaseException("登录用户:" + username + " 不存在");
  68 + }
  69 + LoginUser userInfo = userResult.getData();
  70 + SysUser user = userResult.getData().getSysUser();
  71 + if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
  72 + {
  73 + remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除");
  74 +
  75 + throw new BaseException("对不起,您的账号:" + username + " 已被删除");
  76 + }
  77 + if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
  78 + {
  79 + remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员");
  80 + throw new BaseException("对不起,您的账号:" + username + " 已停用");
  81 + }
  82 + if (!SecurityUtils.matchesPassword(password, user.getPassword()))
  83 + {
  84 + remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "用户密码错误");
  85 + throw new BaseException("用户不存在/密码错误");
  86 + }
  87 + remoteLogService.saveLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
  88 + return userInfo;
  89 + }
  90 +
  91 + public void logout(String loginName)
  92 + {
  93 + remoteLogService.saveLogininfor(loginName, Constants.LOGOUT, "退出成功");
  94 + }
  95 +}
  1 +Spring Boot Version: ${spring-boot.version}
  2 +Spring Application Name: ${spring.application.name}
  3 +
  4 +
  5 +
  6 +
  7 + 888 888 888
  8 + 888 888 888
  9 + 888 888 888
  10 + 88888b. 888d888 .d88b. 8888b. 888 888 888888 88888b.
  11 + 888 "88b 888P" d88""88b "88b 888 888 888 888 "88b
  12 + 888 888 888 888 888 888888 .d888888 888 888 888 888 888
  13 + 888 d88P 888 Y88..88P 888 888 Y88b 888 Y88b. 888 888
  14 + 88888P" 888 "Y88P" "Y888888 "Y88888 "Y888 888 888
  15 +
  16 +
  17 +
  18 +
  19 +
  20 + _ooOoo_
  21 + o8888888o
  22 + 88" . "88
  23 + (| -_- |)
  24 + O\ = /O
  25 + ____/`---'\____
  26 + .' \\| |// `.
  27 + / \\||| : |||// \
  28 + / _||||| -:- |||||- \
  29 + | | \\\ - /// | |
  30 + | \_| ''\---/'' | |
  31 + \ .-\__ `-` ___/-. /
  32 + ___`. .' /--.--\ `. . __
  33 + ."" '< `.___\_<|>_/___.' >'"".
  34 + | | : `- \`.;`\ _ /`;.`/ - ` : | |
  35 + \ \ `-. \_ __\ /__ _/ .-` / /
  36 + ======`-.____`-.___\_____/___.-`____.-'======
  37 + `=---='
  38 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  39 + 佛祖保佑 永无BUG
  40 + // 佛曰:
  41 + // 写字楼里写字间,写字间里程序员;
  42 + // 程序人员写程序,又拿程序换酒钱。
  1 +
  2 +
  3 + 888 888 888
  4 + 888 888 888
  5 + 888 888 888
  6 + 88888b. 888d888 .d88b. 8888b. 888 888 888888 88888b.
  7 + 888 "88b 888P" d88""88b "88b 888 888 888 888 "88b
  8 + 888 888 888 888 888 888888 .d888888 888 888 888 888 888
  9 + 888 d88P 888 Y88..88P 888 888 Y88b 888 Y88b. 888 888
  10 + 88888P" 888 "Y88P" "Y888888 "Y88888 "Y888 888 888
  11 + ,
  12 + /\^/`\
  13 + | \/ |
  14 + | | | 启动成功
  15 + \ \ / _ _
  16 + '\\//' _{ ' }_
  17 + || 天津银河百荣科技有限公司 { `.!.` }
  18 + || <bro@brotop.cn> ',_/Y\_,'
  19 + || , {_,_}
  20 + |\ || |\ Bro-Admin-Cloud: |
  21 + | | || | | Version:1.0.0 (\| /)
  22 + | | || / / <http://brotop.cn> \| //
  23 + \ \||/ / |//
  24 + `\\//` \\ \./ \\ / // \\./ \\ // \\ |/ /
  25 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1 +# Tomcat
  2 +server:
  3 + port: 9200
  4 +
  5 +# Spring
  6 +spring:
  7 + application:
  8 + # 应用名称
  9 + name: bro-admin-auth
  10 + profiles:
  11 + # 环境配置
  12 + active: dev
  13 + cloud:
  14 + nacos:
  15 + discovery:
  16 + # 配置中心地址
  17 + server-addr: nacos.w.brotop.cn
  18 + namespace: 1623fcbb-3a0b-4222-8469-16b1bc5e9d77
  19 + config:
  20 + # 配置中心地址
  21 + server-addr: nacos.w.brotop.cn
  22 + namespace: 1623fcbb-3a0b-4222-8469-16b1bc5e9d77
  23 + # 配置文件格式
  24 + file-extension: yml
  25 + # 共享配置
  26 + shared-configs:
  27 + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<configuration scan="true" scanPeriod="60 seconds" debug="false">
  3 + <!-- 日志存放路径 -->
  4 + <property name="log.path" value="logs/ruoyi-auth" />
  5 + <!-- 日志输出格式 -->
  6 + <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
  7 +
  8 + <!-- 控制台输出 -->
  9 + <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
  10 + <encoder>
  11 + <pattern>${log.pattern}</pattern>
  12 + </encoder>
  13 + </appender>
  14 +
  15 + <!-- 系统日志输出 -->
  16 + <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
  17 + <file>${log.path}/info.log</file>
  18 + <!-- 循环政策:基于时间创建日志文件 -->
  19 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  20 + <!-- 日志文件名格式 -->
  21 + <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
  22 + <!-- 日志最大的历史 60天 -->
  23 + <maxHistory>60</maxHistory>
  24 + </rollingPolicy>
  25 + <encoder>
  26 + <pattern>${log.pattern}</pattern>
  27 + </encoder>
  28 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  29 + <!-- 过滤的级别 -->
  30 + <level>INFO</level>
  31 + <!-- 匹配时的操作:接收(记录) -->
  32 + <onMatch>ACCEPT</onMatch>
  33 + <!-- 不匹配时的操作:拒绝(不记录) -->
  34 + <onMismatch>DENY</onMismatch>
  35 + </filter>
  36 + </appender>
  37 +
  38 + <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
  39 + <file>${log.path}/error.log</file>
  40 + <!-- 循环政策:基于时间创建日志文件 -->
  41 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  42 + <!-- 日志文件名格式 -->
  43 + <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
  44 + <!-- 日志最大的历史 60天 -->
  45 + <maxHistory>60</maxHistory>
  46 + </rollingPolicy>
  47 + <encoder>
  48 + <pattern>${log.pattern}</pattern>
  49 + </encoder>
  50 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  51 + <!-- 过滤的级别 -->
  52 + <level>ERROR</level>
  53 + <!-- 匹配时的操作:接收(记录) -->
  54 + <onMatch>ACCEPT</onMatch>
  55 + <!-- 不匹配时的操作:拒绝(不记录) -->
  56 + <onMismatch>DENY</onMismatch>
  57 + </filter>
  58 + </appender>
  59 +
  60 + <!-- 系统模块日志级别控制 -->
  61 + <logger name="cn.brotop" level="info" />
  62 + <!-- Spring日志级别控制 -->
  63 + <logger name="org.springframework" level="warn" />
  64 +
  65 + <root level="info">
  66 + <appender-ref ref="console" />
  67 + </root>
  68 +
  69 + <!--系统操作日志-->
  70 + <root level="info">
  71 + <appender-ref ref="file_info" />
  72 + <appender-ref ref="file_error" />
  73 + </root>
  74 +</configuration>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 + xmlns="http://maven.apache.org/POM/4.0.0"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>cn.brotop</groupId>
  7 + <artifactId>bro-admin-common</artifactId>
  8 + <version>1.0.0</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 +
  12 + <artifactId>bro-admin-common-core</artifactId>
  13 +
  14 + <description>
  15 + bro-admin-common-core核心模块
  16 + </description>
  17 +
  18 + <dependencies>
  19 +
  20 + <!-- SpringCloud Openfeign -->
  21 + <dependency>
  22 + <groupId>org.springframework.cloud</groupId>
  23 + <artifactId>spring-cloud-starter-openfeign</artifactId>
  24 + </dependency>
  25 +
  26 + <!-- Spring Context Support -->
  27 + <dependency>
  28 + <groupId>org.springframework</groupId>
  29 + <artifactId>spring-context-support</artifactId>
  30 + </dependency>
  31 +
  32 + <!-- Spring Web -->
  33 + <dependency>
  34 + <groupId>org.springframework</groupId>
  35 + <artifactId>spring-web</artifactId>
  36 + </dependency>
  37 +
  38 + <!-- Apache Commons Pool2 -->
  39 + <dependency>
  40 + <groupId>org.apache.commons</groupId>
  41 + <artifactId>commons-pool2</artifactId>
  42 + </dependency>
  43 +
  44 + <!-- Pagehelper -->
  45 + <dependency>
  46 + <groupId>com.github.pagehelper</groupId>
  47 + <artifactId>pagehelper-spring-boot-starter</artifactId>
  48 + </dependency>
  49 +
  50 + <!-- Hibernate Validator -->
  51 + <dependency>
  52 + <groupId>org.springframework.boot</groupId>
  53 + <artifactId>spring-boot-starter-validation</artifactId>
  54 + </dependency>
  55 +
  56 + <!-- Jackson -->
  57 + <dependency>
  58 + <groupId>com.fasterxml.jackson.core</groupId>
  59 + <artifactId>jackson-databind</artifactId>
  60 + </dependency>
  61 +
  62 + <dependency>
  63 + <groupId>junit</groupId>
  64 + <artifactId>junit</artifactId>
  65 + </dependency>
  66 + <!-- lombok 依赖 -->
  67 + <dependency>
  68 + <groupId>org.projectlombok</groupId>
  69 + <artifactId>lombok</artifactId>
  70 + </dependency>
  71 + <!-- Alibaba Fastjson -->
  72 + <dependency>
  73 + <groupId>com.alibaba</groupId>
  74 + <artifactId>fastjson</artifactId>
  75 + </dependency>
  76 +
  77 + <!-- Apache Lang3 -->
  78 + <dependency>
  79 + <groupId>org.apache.commons</groupId>
  80 + <artifactId>commons-lang3</artifactId>
  81 + </dependency>
  82 +
  83 + <!-- Commons Io -->
  84 + <dependency>
  85 + <groupId>commons-io</groupId>
  86 + <artifactId>commons-io</artifactId>
  87 + </dependency>
  88 +
  89 + <!-- Commons Fileupload -->
  90 + <dependency>
  91 + <groupId>commons-fileupload</groupId>
  92 + <artifactId>commons-fileupload</artifactId>
  93 + </dependency>
  94 +
  95 + <!-- excel工具 -->
  96 + <dependency>
  97 + <groupId>org.apache.poi</groupId>
  98 + <artifactId>poi-ooxml</artifactId>
  99 + </dependency>
  100 +
  101 + <!-- Java Servlet -->
  102 + <dependency>
  103 + <groupId>javax.servlet</groupId>
  104 + <artifactId>javax.servlet-api</artifactId>
  105 + </dependency>
  106 +
  107 + <!-- Swagger -->
  108 + <dependency>
  109 + <groupId>io.swagger</groupId>
  110 + <artifactId>swagger-annotations</artifactId>
  111 + </dependency>
  112 +
  113 + </dependencies>
  114 +
  115 +</project>
  1 +package cn.brotop.common.core.annotation;
  2 +
  3 +import cn.brotop.common.core.enums.DesensitionType;
  4 +import cn.brotop.common.core.utils.DesensitizationSerialize;
  5 +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
  6 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  7 +
  8 +import java.lang.annotation.ElementType;
  9 +import java.lang.annotation.Retention;
  10 +import java.lang.annotation.RetentionPolicy;
  11 +import java.lang.annotation.Target;
  12 +
  13 +@JacksonAnnotationsInside
  14 +@Target(ElementType.FIELD)
  15 +@Retention(RetentionPolicy.RUNTIME)
  16 +@JsonSerialize(using = DesensitizationSerialize.class)
  17 +
  18 +public @interface Desensitization {
  19 + /**
  20 + * 脱敏类型规则
  21 + * @return
  22 + */
  23 + DesensitionType value();
  24 +}
  1 +package cn.brotop.common.core.annotation;
  2 +
  3 +import java.lang.annotation.ElementType;
  4 +import java.lang.annotation.Retention;
  5 +import java.lang.annotation.RetentionPolicy;
  6 +import java.lang.annotation.Target;
  7 +import java.math.BigDecimal;
  8 +
  9 +/**
  10 + * 自定义导出Excel数据注解
  11 + *
  12 + * @author 啊雷
  13 + */
  14 +@Retention(RetentionPolicy.RUNTIME)
  15 +@Target(ElementType.FIELD)
  16 +public @interface Excel
  17 +{
  18 + /**
  19 + * 导出时在excel中排序
  20 + */
  21 + public int sort() default Integer.MAX_VALUE;
  22 +
  23 + /**
  24 + * 导出到Excel中的名字.
  25 + */
  26 + public String name() default "";
  27 +
  28 + /**
  29 + * 日期格式, 如: yyyy-MM-dd
  30 + */
  31 + public String dateFormat() default "";
  32 +
  33 + /**
  34 + * 读取内容转表达式 (如: 0=男,1=女,2=未知)
  35 + */
  36 + public String readConverterExp() default "";
  37 +
  38 + /**
  39 + * 分隔符,读取字符串组内容
  40 + */
  41 + public String separator() default ",";
  42 +
  43 + /**
  44 + * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
  45 + */
  46 + public int scale() default -1;
  47 +
  48 + /**
  49 + * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
  50 + */
  51 + public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
  52 +
  53 + /**
  54 + * 导出类型(0数字 1字符串)
  55 + */
  56 + public ColumnType cellType() default ColumnType.STRING;
  57 +
  58 + /**
  59 + * 导出时在excel中每个列的高度 单位为字符
  60 + */
  61 + public double height() default 14;
  62 +
  63 + /**
  64 + * 导出时在excel中每个列的宽 单位为字符
  65 + */
  66 + public double width() default 16;
  67 +
  68 + /**
  69 + * 文字后缀,如% 90 变成90%
  70 + */
  71 + public String suffix() default "";
  72 +
  73 + /**
  74 + * 当值为空时,字段的默认值
  75 + */
  76 + public String defaultValue() default "";
  77 +
  78 + /**
  79 + * 提示信息
  80 + */
  81 + public String prompt() default "";
  82 +
  83 + /**
  84 + * 设置只能选择不能输入的列内容.
  85 + */
  86 + public String[] combo() default {};
  87 +
  88 + /**
  89 + * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
  90 + */
  91 + public boolean isExport() default true;
  92 +
  93 + /**
  94 + * 另一个类中的属性名称,支持多级获取,以小数点隔开
  95 + */
  96 + public String targetAttr() default "";
  97 +
  98 + /**
  99 + * 是否自动统计数据,在最后追加一行统计数据总和
  100 + */
  101 + public boolean isStatistics() default false;
  102 +
  103 + /**
  104 + * 导出字段对齐方式(0:默认;1:靠左;2:居中;3:靠右)
  105 + */
  106 + Align align() default Align.AUTO;
  107 +
  108 + public enum Align
  109 + {
  110 + AUTO(0), LEFT(1), CENTER(2), RIGHT(3);
  111 + private final int value;
  112 +
  113 + Align(int value)
  114 + {
  115 + this.value = value;
  116 + }
  117 +
  118 + public int value()
  119 + {
  120 + return this.value;
  121 + }
  122 + }
  123 +
  124 + /**
  125 + * 字段类型(0:导出导入;1:仅导出;2:仅导入)
  126 + */
  127 + Type type() default Type.ALL;
  128 +
  129 + public enum Type
  130 + {
  131 + ALL(0), EXPORT(1), IMPORT(2);
  132 + private final int value;
  133 +
  134 + Type(int value)
  135 + {
  136 + this.value = value;
  137 + }
  138 +
  139 + public int value()
  140 + {
  141 + return this.value;
  142 + }
  143 + }
  144 +
  145 + public enum ColumnType
  146 + {
  147 + NUMERIC(0), STRING(1), IMAGE(2);
  148 + private final int value;
  149 +
  150 + ColumnType(int value)
  151 + {
  152 + this.value = value;
  153 + }
  154 +
  155 + public int value()
  156 + {
  157 + return this.value;
  158 + }
  159 + }
  160 +}
  1 +package cn.brotop.common.core.annotation;
  2 +
  3 +import java.lang.annotation.ElementType;
  4 +import java.lang.annotation.Retention;
  5 +import java.lang.annotation.RetentionPolicy;
  6 +import java.lang.annotation.Target;
  7 +
  8 +/**
  9 + * Excel注解集
  10 + *
  11 + * @author 啊雷
  12 + */
  13 +@Target(ElementType.FIELD)
  14 +@Retention(RetentionPolicy.RUNTIME)
  15 +public @interface Excels
  16 +{
  17 + Excel[] value();
  18 +}
  1 +package cn.brotop.common.core.constant;
  2 +
  3 +/**
  4 + * 缓存的key 常量
  5 + *
  6 + * @author 啊雷
  7 + */
  8 +public class CacheConstants
  9 +{
  10 + /**
  11 + * 令牌自定义标识
  12 + */
  13 + public static final String HEADER = "Authorization";
  14 +
  15 + /**
  16 + * 令牌前缀
  17 + */
  18 + public static final String TOKEN_PREFIX = "Bearer ";
  19 +
  20 + /**
  21 + * 权限缓存前缀
  22 + */
  23 + public final static String LOGIN_TOKEN_KEY = "login_tokens:";
  24 +
  25 + /**
  26 + * 用户ID字段
  27 + */
  28 + public static final String DETAILS_USER_ID = "user_id";
  29 +
  30 + /**
  31 + * 用户名字段
  32 + */
  33 + public static final String DETAILS_USERNAME = "username";
  34 +
  35 + /**
  36 + * 授权信息字段
  37 + */
  38 + public static final String AUTHORIZATION_HEADER = "authorization";
  39 +}
  1 +package cn.brotop.common.core.constant;
  2 +
  3 +/**
  4 + * 通用常量信息
  5 + *
  6 + * @author 啊雷
  7 + */
  8 +public class Constants
  9 +{
  10 + /**
  11 + * UTF-8 字符集
  12 + */
  13 + public static final String UTF8 = "UTF-8";
  14 +
  15 + /**
  16 + * GBK 字符集
  17 + */
  18 + public static final String GBK = "GBK";
  19 +
  20 + /**
  21 + * http请求
  22 + */
  23 + public static final String HTTP = "http://";
  24 +
  25 + /**
  26 + * https请求
  27 + */
  28 + public static final String HTTPS = "https://";
  29 +
  30 + /**
  31 + * 成功标记
  32 + */
  33 + public static final Integer SUCCESS = 200;
  34 +
  35 + /**
  36 + * 失败标记
  37 + */
  38 + public static final Integer FAIL = 500;
  39 +
  40 + /**
  41 + * 登录成功
  42 + */
  43 + public static final String LOGIN_SUCCESS = "Success";
  44 +
  45 + /**
  46 + * 注销
  47 + */
  48 + public static final String LOGOUT = "Logout";
  49 +
  50 + /**
  51 + * 注册
  52 + */
  53 + public static final String REGISTER = "Register";
  54 +
  55 + /**
  56 + * 登录失败
  57 + */
  58 + public static final String LOGIN_FAIL = "Error";
  59 +
  60 + /**
  61 + * 当前记录起始索引
  62 + */
  63 + public static final String PAGE_NUM = "pageNum";
  64 +
  65 + /**
  66 + * 每页显示记录数
  67 + */
  68 + public static final String PAGE_SIZE = "pageSize";
  69 +
  70 + /**
  71 + * 排序列
  72 + */
  73 + public static final String ORDER_BY_COLUMN = "orderByColumn";
  74 +
  75 + /**
  76 + * 排序的方向 "desc" 或者 "asc".
  77 + */
  78 + public static final String IS_ASC = "isAsc";
  79 +
  80 + /**
  81 + * 验证码 redis key
  82 + */
  83 + public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
  84 +
  85 + /**
  86 + * 验证码有效期(分钟)
  87 + */
  88 + public static final long CAPTCHA_EXPIRATION = 2;
  89 +
  90 + /**
  91 + * 令牌有效期(分钟)
  92 + */
  93 + public final static long TOKEN_EXPIRE = 720;
  94 +
  95 + /**
  96 + * 参数管理 cache key
  97 + */
  98 + public static final String SYS_CONFIG_KEY = "sys_config:";
  99 +
  100 + /**
  101 + * 字典管理 cache key
  102 + */
  103 + public static final String SYS_DICT_KEY = "sys_dict:";
  104 +
  105 + /**
  106 + * 资源映射路径 前缀
  107 + */
  108 + public static final String RESOURCE_PREFIX = "/profile";
  109 +}
  1 +package cn.brotop.common.core.constant;
  2 +
  3 +import java.io.File;
  4 +
  5 +public class ConstantsFilePath {
  6 +
  7 + /**
  8 + * 文件上传根目录
  9 + */
  10 + public static final String FILE_ROOT_PATH = "D:\\apache-tomcat-7.0.108\\webapps";
  11 +
  12 + /**
  13 + * 文件上传访问根路径
  14 + */
  15 + public static final String CONTEXT_ROOT_PATH = "uploadFile" + File.separator;
  16 +
  17 + /**
  18 + * 医生认证资料根目录
  19 + */
  20 + public static final String DOCTOR_AUTH_FILE_PATH="doctor" + File.separator + "auth" + File.separator;
  21 +
  22 + /**
  23 + * 医生认证图片
  24 + */
  25 + public static final String DOCTOR_AUTH_IMG_IMAGE = "image" + File.separator;
  26 +
  27 +}