作者 啊雷

畅悦息重构

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

要显示太多修改。

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

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