提交 449e6a53 authored 作者: 杨凯's avatar 杨凯

feat:家庭医生初始化

上级 812cc55c
<?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>
<artifactId>byh-family-doctor</artifactId>
<groupId>com.ebaiyihui</groupId>
<relativePath>../pom.xml</relativePath>
<version>0.0.3-SNAPSHOT</version>
<!-- <version>1.0.0</version>-->
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.ebaiyihui</groupId>
<artifactId>family-doctor-client</artifactId>
<version>0.0.3-SNAPSHOT</version>
<!-- <version>1.0.0</version>-->
<packaging>jar</packaging>
</project>
\ 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>
<artifactId>byh-family-doctor</artifactId>
<groupId>com.ebaiyihui</groupId>
<relativePath>../pom.xml</relativePath>
<version>0.0.3-SNAPSHOT</version>
<!-- <version>1.0.0</version>-->
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.ebaiyihui</groupId>
<artifactId>family-doctor-common</artifactId>
<version>0.0.3-SNAPSHOT</version>
<!-- <version>1.0.0</version>-->
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.ebaiyihui.imforward</groupId>
<artifactId>byh-im-forward-client</artifactId>
<version>${byh-im-forward.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</exclusion>
<exclusion>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclusion>
<exclusion>
<artifactId>spring-cloud-openfeign-core</artifactId>
<groupId>org.springframework.cloud</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.ebaiyihui.family.doctor.common.bo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: DoctorInfo
* @Author:yanliang
* @Date:2024/3/14 16:42
* @Description
*/
@Data
public class DoctorInfo {
private String doctorId;
private String doctorName;
private String deptId;
private String deptName;
@ApiModelProperty("医生头像")
private String doctorPortrait;
@ApiModelProperty("医生职称")
private String doctorProfession;
}
package com.ebaiyihui.family.doctor.common.bo;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* @ClassName: ImAccountCreateReq
* @Author:yanliang
* @Date:2024/3/13 11:33
* @Description
*/
@Data
@AllArgsConstructor
public class ImAccountCreateReq {
/**
* 就诊记录ID
*/
private String admId;
/**
* 医生ID
*/
private String docId;
/**
* 就诊人ID
*/
private String patientId;
/**
* 医生userId
*/
private String doctorUserId;
/**
* 患者userID
*/
private String patientUserId;
private String appCode;
}
package com.ebaiyihui.family.doctor.common.bo;
/**
* @ClassName: MemberInfo
* @Author:yanliang
* @Date:2024/3/14 15:34
* @Description
*/
public class MemberInfo {
/**
* 医生id
*/
private String doctorId;
/**
* 医生名字
*/
private String name;
/**
* 医生账号
*/
private String account;
public String getDoctorId() {
return doctorId;
}
public void setDoctorId(String doctorId) {
this.doctorId = doctorId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
}
package com.ebaiyihui.family.doctor.common.bo;
import lombok.Data;
import lombok.ToString;
/**
* @ClassName: Message
* @Author:yanliang
* @Date:2024/3/14 15:21
* @Description
*/
@Data
@ToString
public class Message<T> {
/**
* 消息类型 1:不可跳转 2:可以跳转
*/
private Integer messageType;
/**
* 业务编码 arc 医嘱,bookin 入院 ,order 订单详情(病例)
* 如果是不可跳转的消息此处为空
*/
private String businessCode;
/**
* 就诊id
*/
private String admissionId;
private String applicationCode;
/**
* 是否刷新:0 不刷新 1 刷新
*/
private Integer isRefresh;
/**
* 转诊id
*/
private String admId;
/**
* 服务类型
*/
private Integer servType;
/**
* 是否团队:1.个人 2.团队
*/
private String teamFlag;
/**
* 团队消息Id
*/
private String msgId;
/**
* 消息数据
*/
private T data;
private String medicalOpinion;
/**
* user=指定用户发送消息,system=发送系统消息
*/
private String actionType;
public Integer getMessageType() {
return messageType;
}
public void setMessageType(Integer messageType) {
this.messageType = messageType;
}
public String getBusinessCode() {
return businessCode;
}
public void setBusinessCode(String businessCode) {
this.businessCode = businessCode;
}
public String getAdmissionId() {
return admissionId;
}
public void setAdmissionId(String admissionId) {
this.admissionId = admissionId;
}
public String getApplicationCode() {
return applicationCode;
}
public void setApplicationCode(String applicationCode) {
this.applicationCode = applicationCode;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public Integer getIsRefresh() {
return isRefresh;
}
public void setIsRefresh(Integer isRefresh) {
this.isRefresh = isRefresh;
}
public String getAdmId() {
return admId;
}
public void setAdmId(String admId) {
this.admId = admId;
}
public Integer getServType() {
return servType;
}
public void setServType(Integer servType) {
this.servType = servType;
}
public String getMedicalOpinion() {
return medicalOpinion;
}
public void setMedicalOpinion(String medicalOpinion) {
this.medicalOpinion = medicalOpinion;
}
public String getTeamFlag() {
return teamFlag;
}
public void setTeamFlag(String teamFlag) {
this.teamFlag = teamFlag;
}
public String getMsgId() {
return msgId;
}
public void setMsgId(String msgId) {
this.msgId = msgId;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
}
package com.ebaiyihui.family.doctor.common.bo;
import com.ebaiyihui.imforward.client.vo.AccountVO;
import java.util.List;
/**
* @ClassName: MessageInfo
* @Author:yanliang
* @Date:2024/3/14 15:19
* @Description
*/
public class MessageInfo {
/**
* 接收账号(团队)
*/
private List<AccountVO> receiveAccounts;
/**
* 接收账号(个人)
*/
private AccountVO singleAccount;
/**
* 发送账号(个人)
*/
private AccountVO selfAccount;
/**
* 消息内容对象
*/
private Message message;
/**
* 延迟毫秒数
*/
private Long syncFlag;
/**
* user=指定用户发送消息,system=发送系统消息
*/
private String actionType;
public List<AccountVO> getReceiveAccounts() {
return receiveAccounts;
}
public void setReceiveAccounts(List<AccountVO> receiveAccounts) {
this.receiveAccounts = receiveAccounts;
}
public AccountVO getSingleAccount() {
return singleAccount;
}
public void setSingleAccount(AccountVO singleAccount) {
this.singleAccount = singleAccount;
}
public AccountVO getSelfAccount() {
return selfAccount;
}
public void setSelfAccount(AccountVO selfAccount) {
this.selfAccount = selfAccount;
}
public Message getMessage() {
return message;
}
public void setMessage(Message message) {
this.message = message;
}
public Long getSyncFlag() {
return syncFlag;
}
public void setSyncFlag(Long syncFlag) {
this.syncFlag = syncFlag;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
@Override
public String toString() {
return "MessageInfo{" +
"receiveAccounts=" + receiveAccounts +
", singleAccount=" + singleAccount +
", selfAccount=" + selfAccount +
", message=" + message +
", syncFlag=" + syncFlag +
", actionType='" + actionType + '\'' +
'}';
}
}
package com.ebaiyihui.family.doctor.common.bo;
import lombok.Data;
import java.util.List;
/**
* @ClassName: patientSignInfo
* @Author:yanliang
* @Date:2024/3/14 15:34
* @Description
*/
@Data
public class PatientSignInfo {
/**
* 就诊id
*/
private String admId;
/**
* 平台code
*/
private String appCode;
/**
* 机构code
*/
private Long organId;
/**
* 业务类型
*/
private Integer serviceType;
/**
* 患者用户ID
*/
private String patientUserId;
/**
* 患者名字
*/
private String patientName;
/**
* 团队当前处理人doctorId(个人这个值为null)
*/
private String doctorId;
private String doctorName;
/**
* 医生用户ID(团队这个值为null)
*/
private String doctorUserId;
/**
* 团队成员信息(个人这个值为null)
*/
private List<MemberInfo> memberInfos;
}
package com.ebaiyihui.family.doctor.common.bo;
import java.util.List;
/**
* @ClassName: PersonImInformReq
* @Author:yanliang
* @Date:2024/3/14 15:56
* @Description
*/
public class PersonImInformReq {
/**
* 就诊id
*/
private String admissionId;
/**
* 业务编码
*/
private String busiCode;
/**
* 推送消息参数
*/
private List<MessageInfo> messageInfos;
public String getAdmissionId() {
return admissionId;
}
public void setAdmissionId(String admissionId) {
this.admissionId = admissionId;
}
public List<MessageInfo> getMessageInfos() {
return messageInfos;
}
public void setMessageInfos(List<MessageInfo> messageInfos) {
this.messageInfos = messageInfos;
}
public String getBusiCode() {
return busiCode;
}
public void setBusiCode(String busiCode) {
this.busiCode = busiCode;
}
}
package com.ebaiyihui.family.doctor.common.dto;
/**
* @ClassName: DoctorIdDTO
* @Author:yanliang
* @Date:2024/3/13 11:25
* @Description
*/
public class DoctorIdDTO {
/**
* 医生Id
*/
private String doctorId;
/**
* Getter method for property <tt>doctorId</tt>.
*
* @return property value of doctorId
*/
public String getDoctorId() {
return doctorId;
}
/**
* Setter method for property <tt>doctorId</tt>.
*
* @param doctorId value to be assigned to property doctorId
*/
public void setDoctorId(String doctorId) {
this.doctorId = doctorId;
}
/**
* @see Object#toString()
*/
@Override
public String toString() {
return "DoctorIdQueryDTO [doctorId=" + doctorId + "]";
}
}
package com.ebaiyihui.family.doctor.common.dto;
import lombok.Data;
/**
* @ClassName: DoctorInfoForScheduleDTO
* @Author:yanliang
* @Date:2024/3/14 16:24
* @Description
*/
@Data
public class DoctorInfoForScheduleDTO {
private String doctorId;
private String doctorName;
private String deptId;
private String deptName;
}
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @ClassName: ImInfoDetailDocReqDTO
* @Author:yanliang
* @Date:2024/3/13 18:16
* @Description
*/
@Data
public class ImInfoDetailDocReqDTO {
@NotNull(message = "就诊记录Id不能为空")
@ApiModelProperty("就诊id")
private String admissionId;
}
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: ImInfoListDocReqDTO
* @Author:yanliang
* @Date:2024/3/13 17:22
* @Description
*/
@Data
public class ImInfoListDocReqDTO extends PageDTO {
@ApiModelProperty("医生id")
private String doctorId;
@ApiModelProperty("搜索参数")
private String keyWord;
@ApiModelProperty("医院code")
private String appCode;
}
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* @ClassName: InsertScheduleRecordReqDTO
* @Author:yanliang
* @Date:2024/3/14 16:22
* @Description
*/
@Data
public class InsertScheduleRecordReqDTO {
@ApiModelProperty(value = "医院id")
@NotBlank(message = "医院id")
private String hospitalId;
@ApiModelProperty(value = "医院名称")
@NotBlank(message = "医院名称")
private String hospitalName;
@ApiModelProperty(value = "医院名称")
@NotBlank(message = "医院名称")
private String organCode;
@ApiModelProperty("业务类型")
private Integer servType;
@ApiModelProperty(value = "排班开始日期")
@NotBlank(message = "排班开始日期")
private String scheduleDate;
@ApiModelProperty(value = "排班结束日期")
@NotBlank(message = "排班结束日期")
private String scheduleDateEnd;
private List<ScheduleRangeAndTimeDTO> scheduleRangeAndTime;
private List<DoctorInfoForScheduleDTO> doctorInfoForSchedule;
@ApiModelProperty(value = "是否开通循环排班 1开通 -1未开通")
private Integer isCycleSchedule;
}
package com.ebaiyihui.family.doctor.common.dto;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @ClassName: PageDTO
* @Author:yanliang
* @Date:2024/3/13 15:20
* @Description
*/
@Data
public class PageDTO {
@NotNull(message = "当前页不能为空")
@Min(value = 1, message = "当前页不能小于1")
private Integer pageNum = 1;
private Integer pageSize = 20;
}
package com.ebaiyihui.family.doctor.common.dto;
import lombok.Data;
import java.util.List;
/**
* @ClassName: QueryDoctorsDTO
* @Author:yanliang
* @Date:2024/3/11 09:46
* @Description
*/
@Data
public class QueryDoctorsDTO extends QueryFamousDTO {
/**
* 新冠门诊多科室
*/
private List<Long> depts;
}
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: QueryFamousDotDTO
* @Author:yanliang
* @Date:2024/3/11 09:46
* @Description
*/
@Data
public class QueryFamousDTO {
private String userId;
@ApiModelProperty("医疗平台编号")
private String appCode;
@ApiModelProperty("医院id")
private Long organId;
@ApiModelProperty("医院科室id")
private Long organDeptId;
@ApiModelProperty("搜索入参")
private String searchParam;
@ApiModelProperty(
value = "业务code字符串集合",
required = true
)
private String serviceCodes;
@ApiModelProperty("标准二级科室id")
private Long stdDeptId;
@ApiModelProperty("排序标识")
private Integer seq;
@ApiModelProperty(
value = "起始页码",
required = true
)
private Integer pageNum;
@ApiModelProperty(
value = "每页条数",
required = true
)
private Integer pageSize;
@ApiModelProperty(
value = "医生状态",
hidden = true
)
private Integer status;
@ApiModelProperty(value = "服务类型:在线咨询:2,在线复诊:3")
private Integer type;
@ApiModelProperty("预约时间")
private String reserveTime;
}
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: RequestGetDoctorOfficeStatusDTO
* @Author:yanliang
* @Date:2024/3/14 09:56
* @Description
*/
@Data
public class RequestGetDoctorOfficeStatusDTO {
@ApiModelProperty("医生id")
private String doctorId;
@ApiModelProperty("医院id")
private String hospitalId;
@ApiModelProperty("科室id")
private String deptId;
@ApiModelProperty("AppCode")
private String appCode;
@ApiModelProperty("上下线状态:1上线,-1下线")
private Integer officeStatus;
}
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @ClassName: RequestGetScheduleForWeekDTO
* @Author:yanliang
* @Date:2024/3/14 16:25
* @Description
*/
@Data
public class RequestGetScheduleForWeekDTO {
private Long hospitalId;
private Long deptId;
private Integer week;
private String doctorName;
@ApiModelProperty("业务类型")
private Integer servType;
@ApiModelProperty("当前排班日期")
private Date scheduleDate;
}
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: RequestServiceConfigDTO
* @Author:yanliang
* @Date:2024/3/14 13:50
* @Description
*/
@Data
public class RequestServiceConfigDTO {
@ApiModelProperty("医生Id")
private String doctorId;
private String organId;
@ApiModelProperty("状态")
private Integer status;
private String appCode;
private String serviceCode;
private Long deptId;
}
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: ScheduleForWeekReqDTO
* @Author:yanliang
* @Date:2024/3/14 16:29
* @Description
*/
@Data
public class ScheduleForWeekReqDTO {
private Long hospitalId;
private Integer week;
@ApiModelProperty("用于管理端搜索医生排班")
private String doctorName;
@ApiModelProperty("业务类型")
private Integer servType;
private Integer pageNum;
private Integer pageSize;
}
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @ClassName: ScheduleRangeAndTimeDTO
* @Author:yanliang
* @Date:2024/3/14 16:23
* @Description
*/
@Data
public class ScheduleRangeAndTimeDTO {
@ApiModelProperty(value = "排班类型0 全天 1 上午 2下午 3夜间门诊")
private Integer scheduleRange;
@ApiModelProperty(value = "总号源数")
@NotBlank(message = "总号源数")
private Integer totalCount;
@ApiModelProperty("排班开始时间")
private String startTime;
@ApiModelProperty("排班结束时间")
private String endTime;
}
package com.ebaiyihui.family.doctor.common.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @ClassName: patientSignDoctorDTO
* @Author:yanliang
* @Date:2024/3/13 09:48
* @Description
*/
@Data
public class SignedDoctorDTO {
private String name;
private String idCard;
private String phone;
@NotNull(message = "医生ID不能为空")
private Long doctorId;
private String doctorName;
private Long deptId;
private String deptName;
private String patientId;
private String admId;
private Integer signStatus;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: DoctorListVo
* @Author:yanliang
* @Date:2024/3/11 09:39
* @Description
*/
@Data
public class DoctorListVo {
private String doctorId;
private String doctorName;
private String doctorCode;
private Long titleId;
private String title;
private Integer organId;
private String organName;
private Integer deptId;
private String deptName;
private Long stdSecondDeptId;
private String phoneNum;
private String portrait;
private Integer gender;
private String profession;
private String introduction;
private String servConfig;
private Integer organCode;
/**
* 上次选择
*/
@ApiModelProperty(value = "是否是上次签名 1是,0不是")
private Integer lastSign;
/**
* 服务金额ServiceConfigData
*/
// private ServiceConfigVo serviceConfigData;
private String doctorLabelName;
@ApiModelProperty(value = "医生是否在线 1在线 -1下线")
private Integer officeStatus;
}
package com.ebaiyihui.family.doctor.common.vo;
import lombok.Data;
/**
* @ClassName: IMMsgResultVo
* @Author:yanliang
* @Date:2024/3/13 14:27
* @Description
*/
@Data
public class IMMsgResultVo {
private String appointmentId;
private String sender;
private String receiver;
private String sendTime;
private String msgType;
private String msgContent;
private String fileName;
private String fileUrl;
private String thirdSdkAccount;
private String msgId;
private Integer duration;
private String groupId;
private Long timeStamp;
private String fromNick;
private String businessCode;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: ImInfoDetailDocResVo
* @Author:yanliang
* @Date:2024/3/13 18:17
* @Description
*/
@Data
public class ImInfoDetailDocResVo {
@ApiModelProperty("医生id")
private String doctorId;
@ApiModelProperty("医生姓名")
private String doctorName;
@ApiModelProperty("医生头像")
private String doctorPortrait;
@ApiModelProperty("患者头像")
private String patientImageUrl;
@ApiModelProperty("患者信息")
private PatientInfoVo patientInfo;
@ApiModelProperty("就诊id")
private String admId;
@ApiModelProperty("订单状态 2.进行中 3.已完成")
private Integer status;
@ApiModelProperty("科室id")
private String deptId;
@ApiModelProperty("科室名称")
private String deptName;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @ClassName: ImInfoListResVo
* @Author:yanliang
* @Date:2024/3/13 17:20
* @Description
*/
@Data
public class ImInfoListResVo {
@ApiModelProperty("就诊id")
private String admId;
@ApiModelProperty("就诊id集合")
private List<String> admIds;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("订单状态")
private Integer status;
@ApiModelProperty("订单状态描述")
private String statusDesc;
@ApiModelProperty("患者姓名")
private String patientName;
@ApiModelProperty("患者性别")
private Integer gender;
@ApiModelProperty("患者年龄")
private Integer age;
@ApiModelProperty("身份证")
private String idCard;
@ApiModelProperty("身份证")
private String patientId;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import java.util.List;
/**
* @ClassName: ZKfbImInfoResVo
* @Author:yanliang
* @Date:2024/3/13 14:26
* @Description
*/
@Data
@Builder
public class ImInfoResVo {
@ApiModelProperty("医生IM账号")
private String docImAccount;
@ApiModelProperty("患者IM账号")
private String patImAccount;
@ApiModelProperty("房间号")
private Long roomNum;
private String sig;
@ApiModelProperty("医生头像")
private String doctorPortrait;
@ApiModelProperty("医生姓名")
private String doctorName;
@ApiModelProperty("IM历史消息")
private List<IMMsgResultVo> iMMsgVo;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: PatientInfoVo
* @Author:yanliang
* @Date:2024/3/13 18:19
* @Description
*/
@Data
public class PatientInfoVo {
@ApiModelProperty("患者姓名")
private String patientName;
@ApiModelProperty("患者id")
private String patientId;
@ApiModelProperty("患者性别 1.男 2.女")
private Integer gender;
@ApiModelProperty("患者年龄")
private Integer age;
@ApiModelProperty("患者身份证")
private String idCard;
@ApiModelProperty("患者头像")
private String portrait;
@ApiModelProperty("患者用户id")
private String patientUserId;
@ApiModelProperty("身份证号码")
private String credNo;
@ApiModelProperty("证件类型")
private String credTypeCode;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: RequestOnlineOrOfflineVo
* @Author:yanliang
* @Date:2024/3/11 18:31
* @Description
*/
@Data
public class RequestOnlineOrOfflineVo {
@ApiModelProperty("医生id")
private String doctorId;
@ApiModelProperty("医院id")
private String hospitalId;
@ApiModelProperty("科室id")
private String deptId;
@ApiModelProperty("AppCode")
private String appCode;
@ApiModelProperty("上下线状态:1上线,-1下线")
private Integer officeStatus;
}
package com.ebaiyihui.family.doctor.common.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @ClassName: ResponseGetScheduleForWeekVo
* @Author:yanliang
* @Date:2024/3/14 16:26
* @Description
*/
@Data
public class ResponseGetScheduleForWeekVo {
@JsonFormat(pattern = "yyyy-MM-dd" ,timezone = "GMT+8")
private Date scheduleDate;
private List<ScheduleOfDayVo> scheduleOfDayVoList;
}
package com.ebaiyihui.family.doctor.common.vo;
import lombok.Data;
import java.util.List;
/**
* @ClassName: ScheduleForWeekResVo
* @Author:yanliang
* @Date:2024/3/14 16:30
* @Description
*/
@Data
public class ScheduleForWeekResVo {
private String scheduleTime;
private List<ScheduleInfoVo> scheduleInfos;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @ClassName: ScheduleInfoVo
* @Author:yanliang
* @Date:2024/3/14 16:31
* @Description
*/
@Data
public class ScheduleInfoVo {
private String doctorId;
private String doctorName;
private String deptId;
private String deptName;
@ApiModelProperty("医生头像")
private String doctorPortrait;
@ApiModelProperty("医生职称")
private String doctorProfession;
private List<ScheduleRangeAndCountVo> scheduleRangeAndCountList;
@ApiModelProperty("某医生某科室某时段创建的最早时间")
private Date createEarliestTime;
}
package com.ebaiyihui.family.doctor.common.vo;
import lombok.Data;
import java.util.List;
/**
* @ClassName: ScheduleOfDayVo
* @Author:yanliang
* @Date:2024/3/14 16:27
* @Description
*/
@Data
public class ScheduleOfDayVo {
private ScheduleTimeSaveListVo scheduleTimeSaveListVo;
private List<ScheduleRecordVo> recordVoList;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: ScheduleRangeAndCountVo
* @Author:yanliang
* @Date:2024/3/14 16:31
* @Description
*/
@Data
public class ScheduleRangeAndCountVo {
@ApiModelProperty(value = "排班id")
private Long id;
@ApiModelProperty(value = "可用号源数")
private Integer availableCount;
@ApiModelProperty(value = "总号源数")
private Integer totalCount;
@ApiModelProperty(value = "排班类型 1 上午 2下午 3夜间门诊")
private Integer scheduleRange;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "前十分钟不可预约 结束时间 1 可预约 -1 不可预约")
private Integer tenMinute;
@ApiModelProperty(value = "是否开通循环排班 1 开通 -1不开通")
private Integer isCycleSchedule;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @ClassName: ScheduleRecordVo
* @Author:yanliang
* @Date:2024/3/14 16:28
* @Description
*/
@Data
public class ScheduleRecordVo {
private Long id;
@ApiModelProperty(value = "医生ID")
private String doctorId;
@ApiModelProperty(value = "医生名称")
private String doctorName;
@ApiModelProperty(value = "总号源数")
private Integer totalCount;
@ApiModelProperty(value = "可用号源数")
private Integer availableCount;
@ApiModelProperty(value = "状态:停诊/复诊")
private Integer status;
@ApiModelProperty(value = "价格")
private BigDecimal price;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ClassName: ScheduleTimeSaveListVo
* @Author:yanliang
* @Date:2024/3/14 16:27
* @Description
*/
@Data
public class ScheduleTimeSaveListVo {
private Long id;
@ApiModelProperty("排班时段类型:1上午 2下午 3夜间")
private Integer scheduleRange;
@ApiModelProperty("排班时段开始时间")
private String startTime;
@ApiModelProperty("排班时段结束时间")
private String endTime;
}
package com.ebaiyihui.family.doctor.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @ClassName: ServiceConfigVo
* @Author:yanliang
* @Date:2024/3/11 09:41
* @Description
*/
@Data
public class ServiceConfigVo {
/**
* 价格
*/
private BigDecimal price;
/**
* 服务有效时间
*/
private Integer servTime;
/**
* 每日限制人数
*/
private Integer dailyLimit;
/**
* 医生回复条数限制
*/
private Integer numLimit;
/**
* 公告
*/
private String notice;
private String serviceId;
/**
* 0 全天 1 上午 2下午 3夜间门诊
*/
@ApiModelProperty(value="排班类型")
private Date scheduleDate;
/**
* 排班时间
*/
@ApiModelProperty(value="排班时间")
private Integer scheduleRange;
@ApiModelProperty("服务有效时间单位:1分钟,2小时")
private Integer timeUnit;
}
差异被折叠。
FROM byh-registry-pro:5000/byh-base:s1.3.2
VOLUME /tmp
ADD family-doctor-server-*.jar app.jar
ADD startup.sh startup.sh
RUN sh -c 'touch /app.jar'
RUN echo "Asia/Shanghai" > /etc/localtime > /etc/timezone \
&& chmod +x /startup.sh
ENTRYPOINT ["/startup.sh" ]
\ No newline at end of file
#!/bin/sh
java -Duser.timezone=GMT+08 -Dfile.encoding=UTF-8 \
-javaagent:/agent/skywalking-agent.jar \
-Dskywalking.agent.service_name=${sw_service_name} \
-Dskywalking.collector.backend_service=${sw_service_url} \
-Dskywalking.trace.ignore_path=/eureka/** \
-Djava.security.egd=file:/dev/./urandom \
-jar \
/app.jar
\ No newline at end of file
FROM byh-registry:5000/oraclejdk8:v1
VOLUME /tmp
ADD family-doctor-server-*.jar app.jar
RUN sh -c 'touch /app.jar'
RUN echo "Asia/Shanghai" > /etc/timezone
ENV JAVA_OPTS="-Duser.timezone=GMT+08 -Dfile.encoding=UTF-8"
ENTRYPOINT ["sh","-c","java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
\ No newline at end of file
package com.ebaiyihui;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* @ClassName: ByhFamilyDoctorApplcation
* @Author:yanliang
* @Date:2024/3/8 14:46
* @Description
*/
@EnableDiscoveryClient
@SpringBootApplication
@EnableTransactionManagement
@EnableEurekaClient
@EnableFeignClients
@EnableCircuitBreaker
@EnableAsync
@MapperScan("com.ebaiyihui.family.doctor.server.mapper")
public class ByhFamilyDoctorApplication {
public static void main(String[] args) {
SpringApplication.run(ByhFamilyDoctorApplication.class, args);
}
}
package com.ebaiyihui.family.doctor.server.aspect;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
/**
* @program chenmt-rides
* @description:
* @author: chenmet
* @create: 2019/08/09 10:58
*/
@Slf4j
@Aspect //表明是一个切面类
@Component //将当前类注入到Spring容器内
public class LogAspect {
//xyz.chenmt.www.chenmtrides.controller包下的所有类中的所有方法,".."表示所有方法中的参数不限个数;
//切入点,其中execution用于使用切面的连接点。使用方法:execution(方法修饰符(可选)
// 返回类型 方法名 参数 异常模式(可选)) ,可以使用通配符匹配字符,*可以匹配任意字符。
@Pointcut("execution(public * com.ebaiyihui.family.doctor.server.controller.*.*(..))")
public void LogAspect(){}
//环绕通知,就是可以在执行前后都使用,这个方法参数必须为ProceedingJoinPoint,proceed()方法就是被切面的方法,
// 上面四个方法可以使用JoinPoint,JoinPoint包含了类名,被切面的方法名,参数等信息。
@Around("LogAspect()")
public Object deAround(ProceedingJoinPoint pjp) throws Throwable{
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
HttpServletRequest request = sra.getRequest();
//ip地址
String ipaddress;
if (request.getHeader("x-forwarded-for") == null) {
ipaddress = request.getRemoteAddr();
} else {
ipaddress = request.getHeader("x-forwarded-for");
}
String url = request.getRequestURL().toString();
String method = request.getMethod();
String queryString = request.getQueryString();
Object[] args = pjp.getArgs();
String params = "";
//获取请求参数集合并进行遍历拼接
if(args.length>0){
if("POST".equals(method)){
Object object = args[0];
Map map = getKeyAndValue(object);
params = JSON.toJSONString(map);
;
}else if("GET".equals(method)){
params = queryString;
}
}
Signature signature = pjp.getSignature();
MethodSignature methodSignature = (MethodSignature)signature;
Method targetMethod = methodSignature.getMethod();
Method realMethod = pjp.getTarget().getClass().getDeclaredMethod(signature.getName(), targetMethod.getParameterTypes());
ApiOperation operation=realMethod.getAnnotation(ApiOperation.class);
if(null!=operation){
log.info("请求开始===方法描述:{},请求方法:{},请求地址:{},请求ip:{},请求类型:{},请求参数:{}",operation.value(),realMethod.getName(),url,ipaddress,method,params);
}else{
log.info("请求开始===请求方法:{},请求地址:{},请求ip:{},请求类型:{},请求参数:{}",realMethod.getName(),url,ipaddress,method,params);
}
// result的值就是被拦截方法的返回值
// Object result = pjp.proceed();
// log.info("请求结束===返回值{}",JSONObject.toJSON(result));
return pjp.proceed();
}
public static Map<String, Object> getKeyAndValue(Object obj) {
Map<String, Object> map = new HashMap<String, Object>();
// 得到类对象
Class userCla = (Class) obj.getClass();
/* 得到类中的所有属性集合 */
Field[] fs = userCla.getDeclaredFields();
for (int i = 0; i < fs.length; i++) {
Field f = fs[i];
f.setAccessible(true); // 设置些属性是可以访问的
Object val;
try {
val = f.get(obj);
// 得到此属性的值
map.put(f.getName(), val);// 设置键值
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
return map;
}
}
package com.ebaiyihui.family.doctor.server.common.constants;
/**
* @ClassName: CommonConstants
* @Author:yanliang
* @Date:2024/3/13 10:19
* @Description
*/
public class CommonConstants {
/**
* 性别男 - 数据库值
*/
public static final Integer GENDER_MALE_KEY = 1;
/**
* 性别男 - 页面显示值
*/
public static final String GENDER_MALE_DESC = "男";
/**
* 性别女 - 数据库值
*/
public static final Integer GENDER_FAMALE_KEY = 2;
/**
* 性别女 - 页面显示值
*/
public static final String GENDER_FAMALE_DESC = "女";
/**
* 性别未知 - 页面显示值
*/
public static final String GENDER_UNKNOWN_DESC = "未知";
/**
* 0 - 数据无效
*/
public static final Integer STATUS_INVALID = 0;
/**
* 1 - 数据有效
*/
public static final Integer STATUS_VALID = 1;
/**
* 分页显示,单页最大显示条数
*/
public static final Integer PAGE_SIZE = 10;
/**
* 支付系统业务调用成功f返回码
*/
public static final Integer PAY_SYSTEM_SUCCESS_CODE = 200;
/**
* 医生类型 - 个人
*/
public static final String DOCTOR_TYPE_PERSONAL= "个人";
public static final Integer DOCTOR_TYPE= 1;
public static final Integer PATIENT_TYPE= 1;
/**
* 默认评分
*/
public static final double SATISFACTION = 5;
public static final int INQUIRY_END_PRE = 3;
/**
* 3分钟秒数
*/
public static final int INQUIRY_END_TIME = 180;
public static final int TENMINT_TIME = 600;
/**
* im聊天条数
*/
public static final int IM_CURRENT_NUM = 3 ;
/**
* 医生超时未接待,推送给患者端APP title
*/
public static final String PATIENT_DOCTOR_OVERTIME_TITLE = "医生超时未接待";
/**
* 候诊提醒,推送给患者端APP title
*/
public static final String PATIENT_WAITE_REMIND_TITLE = "候诊提醒";
/**
* 医生向患者发起视频,推送给患者端APP title
*/
public static final String PATIENT_VIDEO_INQUIRY_TITLE = "医生邀请您视频问诊";
/**
* 医生拒绝问诊,推送给患者端APP title
*/
public static final String PATIENT_DOCTOR_REFUSE_TITLE = "医生拒绝问诊";
public static final String HOS_NAME = "hos_name";
public static final String DATA = "data";
public static final String ASC = "1";
public static final String DESC = "2";
public static final String DAY_TYPE = "1";
public static final String WEEK_TYPE = "2";
public static final String MONTH_TYPE = "3";
/**
* -1 - 数据非法
*/
public static final Integer STATUS_NOTVALID = -1;
public static final String APP_CODE = "NCZK";
public static final String ORGAN_NAME = "南昌众康医院";
public static final Long ORGAN_CODE = 130188L;
}
package com.ebaiyihui.family.doctor.server.common.constants;
/**
* @ClassName: IMInformConstants
* @Author:yanliang
* @Date:2024/3/14 15:23
* @Description
*/
public class IMInformConstants {
/**
* 推送im消息类型-系统消息
*/
public static final String INFORM_SYSTEM_MESSAGE_TYPE = "system";
/**
* 推送im消息类型-用户消息
*/
public static final String INFORM_USER_MESSAGE_TYPE = "user";
/**
* im系统调用成功
*/
public static final Integer IM_SYSTEM_SUCCESS_STATUS = 1;
/**
* 不可以跳转消息类型
*/
public static final Integer SERVICE_SYSTEM_FIXATION_TYPE = 1;
/**
* 可跳转消息类型
*/
public static final Integer SERVICE_SYSTEM_FREE_TYPE = 2;
/**
* im推送群聊消息地址
*/
public static final String PUSH_GROUP_MESSAGE_PATH = "sendMsg/pushGroupMsg";
/**
* im推送单聊消息地址
*/
public static final String PUSH_SINGLE_MESSAGE_PATH = "sendMsg/pushSingleMsg";
/**
* 医生appCode
*/
public static final String DOCTOR_APPLICATION_CODE = "EHOS_DOCTOR";
/**
* 大众appCode
*/
public static final String PATIENT_APPLICATION_CODE = "EHOS_PATIENT";
/**
* 自定义消息-病历类型
*/
public static final String CASE_HISTORY_CUSTOM_TYPE = "order";
public static final String CASE_HISTORY_CARD_TYPE = "card";
public static final String CASE_HISTORY_DOCTOR_CARD_TYPE = "doctorCard";
/**
* 自定义消息-诊疗意见
*/
public static final String MEDICAL_ADVICE_TYPE = "advice";
/**
* 自定义消息-评论类型
*/
public static final String REVIEW_TYPE = "review";
/**
* 自定义消息-检查检验医嘱类型
*/
public static final String CASE_ARC_TYPE = "arc";
/**
* 自定义消息-药品医嘱类型
*/
public static final String CASE_DRUG_TYPE = "drug";
/**
* 自定义消息-入院证类型
*/
public static final String CASE_BOOKIN_TYPE = "bookin";
/**
* im系统在线门诊(咨询)业务区分code
*/
public static final String IM_SYSTEM_BUSINESS_CODE = "zxzx";
public static final String REFERRAL_CARD = "referralCard";
/**
* 统一延迟毫秒数
*/
public static final Long COMMON_DELAY_TIME = 1000L;
public static final String TIME = "time";
public static final String REFERRAL_TIME = "referralTime";
public static final Integer REFRESH = 1;
public static final Integer NOT_REFRESH = 0;
public static final String CASE_DOCTOR_TYPE = "treatmentCard";
public static final String REFERRAL_COPY = "referralCopy";
public static final String RECOMM_SERVICE = "recommService";
public static final String BG_RECORD_DRUG = "bgRecordAndDrug";
}
package com.ebaiyihui.family.doctor.server.common.constants;
/**
* @ClassName: ImConstants
* @Author:yanliang
* @Date:2024/3/13 11:45
* @Description
*/
public class ImConstants {
/**
* im服务中查询在线咨询内容需要的code
*/
public static final String IM_QUERY_ACCOUNT_CODE = "zxzx";
/**
* 区分imaccount-医生
*/
public static final String IM_DOC_ACCOUNT_NUM = "EHOS_DOCTOR";
/**
* 区分imaccount-病人(大众)
*/
public static final String IM_PAT_ACCOUNT_NUM = "EHOS_PATIENT";
/**
* 1容联云类型
*/
public static final short IM_QUERY_TYPE_CLOOPEN = (short) 1;
/**
* 2腾讯云类型
*/
public static final short IM_QUERY_TYPE_TENCENT = (short) 2;
/**
* 推送中心成功code
*/
public static final String PUSH_CENTER_SUCCESS_CODE = "1";
/**
* 推送中大众端type
*/
public static final Short PUSH_CENTER_DZ_CODE = 0;
/**
* 推送中医生端type
*/
public static final Short PUSH_CENTER_YS_CODE = 1;
/**
* 服务提供者为个人-不是团队
*/
public static final boolean INFORM_SERVER_OF_PERSON = false;
}
package com.ebaiyihui.family.doctor.server.common.enums;
import org.apache.commons.lang.StringUtils;
/**
* @ClassName: GenderEnum
* @Author:yanliang
* @Date:2024/3/13 16:41
* @Description
*/
public enum GenderEnum {
/**
* 性别 - 男
*/
MALE("男", 1),
/**
* 性别 - 女
*/
FEMALE("女", 2);
private String desc;
private Integer value;
private GenderEnum(String desc, Integer value) {
this.desc = desc;
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public static String getDesc(Integer value) {
if (value == null || value < 0) {
return null;
}
for (GenderEnum genderEnum : GenderEnum.values()) {
if (genderEnum.getValue().equals(value)) {
return genderEnum.getDesc();
}
}
return null;
}
public static GenderEnum getEnum(Integer value) {
if (value == null || value < 0) {
return null;
}
for (GenderEnum genderEnum : GenderEnum.values()) {
if (genderEnum.getValue().equals(value)) {
return genderEnum;
}
}
return null;
}
public static Integer getValue(String desc) {
if (StringUtils.isBlank(desc)) {
return null;
}
for (GenderEnum genderEnum : GenderEnum.values()) {
if (genderEnum.getDesc().equals(desc)) {
return genderEnum.getValue();
}
}
return null;
}
}
package com.ebaiyihui.family.doctor.server.common.enums;
/**
* @ClassName: ScheduleRecordEnum
* @Author:yanliang
* @Date:2024/3/11 17:19
* @Description
*/
public enum ScheduleRecordEnum {
/**
*全天
*/
DAY("全天", 0),
/**
* 上午
*/
MORNING("上午", 1),
/**
* 下午
*/
AFTERNOON("下午", 2),
/**
* 晚上
*/
EVENING("晚上", 3),
//==============排班状态
/**
* 正常
*/
NORMAL("正常", 1),
/**
* 停诊
*/
TINGZHEN("停诊", 2),
/**
* 复诊
*/
VISIT("复诊", 3);
private String desc;
private Integer value;
private ScheduleRecordEnum(String desc, Integer value) {
this.desc = desc;
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public static String getDesc(Integer value) {
if (value == null || value < 0) {
return null;
}
for (ScheduleRecordEnum scheduleRecordEnum : ScheduleRecordEnum.values()) {
if (value.equals(scheduleRecordEnum.getValue())) {
return scheduleRecordEnum.getDesc();
}
}
return null;
}
public static ScheduleRecordEnum getEnum(Integer value) {
if (value == null || value < 0) {
return null;
}
for (ScheduleRecordEnum scheduleRecordEnum : ScheduleRecordEnum.values()) {
if (value.equals(scheduleRecordEnum.getValue())) {
return scheduleRecordEnum;
}
}
return null;
}
}
package com.ebaiyihui.family.doctor.server.common.enums;
/**
* @ClassName: StatusEnum
* @Author:yanliang
* @Date:2024/3/13 15:40
* @Description
*/
public enum StatusEnum {
IN_CONSULTATION("进行中", 2),
FINISH_APPLY("已完成", 3),
EXPIRED("已过期", 4);
private String desc;
private Integer value;
/**
* @param desc
*/
private StatusEnum(String desc, Integer value) {
this.desc = desc;
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public static String getDesc(Integer value) {
if (value == null || value < 0) {
return null;
}
for (StatusEnum statusEnum : StatusEnum.values()) {
if (value.equals(statusEnum.getValue())) {
return statusEnum.getDesc();
}
}
return null;
}
public static StatusEnum getEnum(Integer value) {
if (value == null || value < 0) {
return null;
}
for (StatusEnum statusEnum : StatusEnum.values()) {
if (value.equals(statusEnum.getValue())) {
return statusEnum;
}
}
return null;
}
}
package com.ebaiyihui.family.doctor.server.common.enums;
import org.apache.commons.lang.StringUtils;
/**
* @ClassName: WhetherEnum
* @Author:yanliang
* @Date:2024/3/11 17:17
* @Description
*/
public enum WhetherEnum {
/**
* 允许
*/
ALLOW("允许", 1),
/**
* 患者
*/
FORBID("禁止", -1),
EQU("相等", 0);
private String desc;
private Integer value;
private WhetherEnum(String desc, Integer value) {
this.desc = desc;
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public static String getDesc(Integer value) {
if (value == null || value < 0) {
return null;
}
for (WhetherEnum whetherEnum : WhetherEnum.values()) {
if (whetherEnum.getValue().equals(value)) {
return whetherEnum.getDesc();
}
}
return null;
}
public static WhetherEnum whetherEnum(Integer value) {
if (value == null || value < 0) {
return null;
}
for (WhetherEnum whetherEnum : WhetherEnum.values()) {
if (whetherEnum.getValue().equals(value)) {
return whetherEnum;
}
}
return null;
}
public static Integer getValue(String desc) {
if (StringUtils.isBlank(desc)) {
return null;
}
for (WhetherEnum whetherEnum : WhetherEnum.values()) {
if (whetherEnum.getDesc().equals(desc)) {
return whetherEnum.getValue();
}
}
return null;
}
}
package com.ebaiyihui.family.doctor.server.config;
/**
* @ClassName: Swagger2
* @Author:yanliang
* @Date:2024/3/11 09:31
* @Description
*/
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @Author:yanliang
* @Date:2019/6/12 16:00
* @Description swagger配置类
*/
@EnableSwagger2
@Configuration
public class Swagger2 {
/**
* 是否开启swagger,正式环境一般是需要关闭的,可根据springboot的多环境配置进行设置
*/
@Value(value = "${swagger.enabled}")
Boolean swaggerEnabled;
/**
* swagger2的配置文件,这里可以配置swagger2的一些基本的内容,比如扫描的包等等
*/
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
// 是否开启
.enable(swaggerEnabled).select()
//为当前包路径
.apis(RequestHandlerSelectors.basePackage("com.ebaiyihui.family.doctor.server.controller"))
.paths(PathSelectors.any())
.build().pathMapping("/");
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
//页面标题
.title("家庭医生APIs")
//描述
.description("家庭医生api")
//创建人
.contact(new Contact("", "", ""))
//版本号
.version("1.0")
//描述
.build();
}
}
package com.ebaiyihui.family.doctor.server.controller;
import com.ebaiyihui.family.doctor.common.dto.QueryDoctorsDTO;
import com.ebaiyihui.family.doctor.common.vo.DoctorListVo;
import com.ebaiyihui.family.doctor.server.service.DoctorService;
import com.ebaiyihui.framework.page.PageResult;
import com.ebaiyihui.framework.response.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName: DoctorController
* @Author:yanliang
* @Date:2024/3/11 09:38
* @Description
*/
@RestController
@RequestMapping("/doctor")
@Api(tags = "医生API")
@Slf4j
public class DoctorController {
@Autowired
private DoctorService doctorService;
@ApiOperation(value = "获取医生列表和服务次数信息", notes = "医生服务feign调用")
@RequestMapping(value = "/getDoctorList", method = RequestMethod.POST)
public BaseResponse<PageResult<DoctorListVo>> getDoctorList(@RequestBody QueryDoctorsDTO reqVo,
BindingResult bindingResult) {
BaseResponse<PageResult<DoctorListVo>> doctorListVo = null;
try {
doctorListVo = doctorService.getDoctorList(reqVo);
} catch (Exception e) {
return BaseResponse.error(e.getMessage());
}
return doctorListVo;
}
}
package com.ebaiyihui.family.doctor.server.controller;
import com.ebaiyihui.family.doctor.common.dto.SignedDoctorDTO;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import com.ebaiyihui.family.doctor.server.service.PatientService;
import com.ebaiyihui.framework.response.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName: PatientController
* @Author:yanliang
* @Date:2024/3/13 09:49
* @Description
*/
@RestController
@RequestMapping("/patient")
@Api(tags = "患者API")
@Slf4j
public class PatientController {
@Autowired
private PatientService patientService;
@ApiOperation(value = "签约医生", notes = "医生服务feign调用")
@RequestMapping(value = "/signedDoctor", method = RequestMethod.POST)
public BaseResponse<String> signedDoctor(@RequestBody SignedDoctorDTO reqVo,
BindingResult bindingResult) {
BaseResponse<String> response = null;
try {
response = patientService.signedDoctor(reqVo);
} catch (Exception e) {
return BaseResponse.error(e.getMessage());
}
return response;
}
@ApiOperation(value = "签约医生", notes = "医生服务feign调用")
@RequestMapping(value = "/getSignedDoctor", method = RequestMethod.POST)
public BaseResponse<PatientSignEntity> getSignedDoctor(@RequestBody SignedDoctorDTO reqVo,
BindingResult bindingResult) {
BaseResponse<PatientSignEntity> response = null;
try {
response = patientService.getSignedDoctor(reqVo);
} catch (Exception e) {
return BaseResponse.error(e.getMessage());
}
return response;
}
}
package com.ebaiyihui.family.doctor.server.controller;
import com.ebaiyihui.family.doctor.common.dto.ImInfoDetailDocReqDTO;
import com.ebaiyihui.family.doctor.common.dto.ImInfoListDocReqDTO;
import com.ebaiyihui.family.doctor.common.dto.RequestGetDoctorOfficeStatusDTO;
import com.ebaiyihui.family.doctor.common.dto.RequestServiceConfigDTO;
import com.ebaiyihui.family.doctor.common.vo.ImInfoDetailDocResVo;
import com.ebaiyihui.family.doctor.common.vo.ImInfoListResVo;
import com.ebaiyihui.family.doctor.common.vo.RequestOnlineOrOfflineVo;
import com.ebaiyihui.family.doctor.common.vo.ImInfoResVo;
import com.ebaiyihui.family.doctor.server.service.PatientSignService;
import com.ebaiyihui.family.doctor.server.service.ServiceConfigService;
import com.ebaiyihui.family.doctor.server.util.PageUtil;
import com.ebaiyihui.framework.response.BaseResponse;
import com.ebaiyihui.imforward.client.vo.IMQueryMsgReqVO;
import com.ebaiyihui.imforward.client.vo.IMSingleMsgResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @ClassName: PatientSignController
* @Author:yanliang
* @Date:2024/3/13 14:12
* @Description
*/
@RestController
@RequestMapping("/patientSign")
@Api(tags = "患者签名API")
@Slf4j
public class PatientSignController {
@Autowired
private PatientSignService patientSignService;
@Autowired
private ServiceConfigService serviceConfigService;
@ApiOperation(value = "查询im聊天消息记录", httpMethod = "POST", notes = "查询im消息记录")
@RequestMapping(value = "/getMsg", method = RequestMethod.POST)
public BaseResponse<List<IMSingleMsgResultVO>> getAllMsgContent(@RequestBody IMQueryMsgReqVO reqVO) {
return patientSignService.getAllMsgContent(reqVO);
}
@ApiOperation("查询IM相关信息")
@GetMapping("/v1/queryImInfo")
public BaseResponse<ImInfoResVo> queryImInfo(@RequestParam("admId") String admId) {
return patientSignService.queryImInfo(admId);
}
@ApiOperation("医生AppIM列表")
@PostMapping("/v1/queryImInfoList")
public BaseResponse<PageUtil<ImInfoListResVo>> queryImInfoList(@RequestBody ImInfoListDocReqDTO param) {
return patientSignService.queryImInfoList(param);
}
@ApiOperation("医生IM详情")
@PostMapping("/v1/queryImInfoDetail")
public BaseResponse<ImInfoDetailDocResVo> queryImInfoDetail(@RequestBody ImInfoDetailDocReqDTO param) {
return patientSignService.queryImInfoDetail(param);
}
@ApiOperation(value = "查询医生上下线状态", notes = "查询医生上下线状态")
@RequestMapping(value = "/v1/getDoctorOfficeStatus", method = RequestMethod.POST)
public BaseResponse<RequestOnlineOrOfflineVo> getDoctorOfficeStatus(@RequestBody RequestGetDoctorOfficeStatusDTO requestGetDoctorOfficeStatusDTO) {
RequestOnlineOrOfflineVo onlineOrOfflineVo = new RequestOnlineOrOfflineVo();
try {
onlineOrOfflineVo = serviceConfigService.getDoctorOfficeStatus(requestGetDoctorOfficeStatusDTO);
} catch (Exception e) {
return BaseResponse.error(e.getMessage());
}
return BaseResponse.success(onlineOrOfflineVo);
}
@ApiOperation(value = "医生上下线", notes = "医生上线下线操作")
@RequestMapping(value = "/v2/officeOnlineOrOffline", method = RequestMethod.POST)
public BaseResponse<RequestOnlineOrOfflineVo> officeOnlineOrOffline(@RequestBody RequestOnlineOrOfflineVo requestOnlineOrOfflineVo) {
RequestOnlineOrOfflineVo onlineOrOfflineVo = new RequestOnlineOrOfflineVo();
try {
onlineOrOfflineVo = serviceConfigService.officeOnlineOrOffline(requestOnlineOrOfflineVo);
} catch (Exception e) {
return BaseResponse.error(e.getMessage());
}
return BaseResponse.success(onlineOrOfflineVo);
}
@ApiOperation("添加/修改医生服务信息")
@RequestMapping(value = "/saveServiceInfo", method = RequestMethod.POST)
//@Log(value = "在线问诊",enable = true,type = LogActionType.ADD)
public BaseResponse<Object> saveServiceInfo(@RequestBody @Validated RequestServiceConfigDTO serviceConfigDTO,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return BaseResponse.error(bindingResult.getFieldError().getDefaultMessage());
}
return serviceConfigService.saveServiceInfo(serviceConfigDTO);
}
}
package com.ebaiyihui.family.doctor.server.controller;
import com.ebaiyihui.family.doctor.common.dto.InsertScheduleRecordReqDTO;
import com.ebaiyihui.family.doctor.common.dto.RequestGetScheduleForWeekDTO;
import com.ebaiyihui.family.doctor.common.dto.ScheduleForWeekReqDTO;
import com.ebaiyihui.family.doctor.common.vo.ResponseGetScheduleForWeekVo;
import com.ebaiyihui.family.doctor.common.vo.ScheduleForWeekResVo;
import com.ebaiyihui.family.doctor.server.service.ScheduleRecordService;
import com.ebaiyihui.framework.response.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.List;
/**
* @ClassName: ScheduleRecordController
* @Author:yanliang
* @Date:2024/3/14 16:19
* @Description
*/
@Slf4j
@RestController
@RequestMapping(value = "/schedulerecord")
@Api(tags = "排班API")
public class ScheduleRecordController {
@Autowired
private ScheduleRecordService scheduleRecordService;
@RequestMapping(value = "/insert", method = RequestMethod.POST)
@ApiOperation(value = "增加排班")
public BaseResponse<String> insert(@RequestBody @Valid InsertScheduleRecordReqDTO record) {
return scheduleRecordService.insert(record);
}
@RequestMapping(value = "/getscheduleforweek", method = RequestMethod.POST)
@ApiOperation("获取医生一周的排班")
public BaseResponse<List<ResponseGetScheduleForWeekVo>> getScheduleForWeek(@RequestBody RequestGetScheduleForWeekDTO requestGetScheduleForWeekDTO) {
return scheduleRecordService.getScheduleForWeek(requestGetScheduleForWeekDTO);
}
@RequestMapping(value = "/scheduleForWeekNew", method = RequestMethod.POST)
@ApiOperation("管理端排班列表")
public BaseResponse<List<ScheduleForWeekResVo>> scheduleForWeekNew(@RequestBody ScheduleForWeekReqDTO scheduleForWeekReqDTO) {
return scheduleRecordService.scheduleForWeekNew(scheduleForWeekReqDTO);
}
}
package com.ebaiyihui.family.doctor.server.entity;
import lombok.Data;
import java.util.Date;
/**
* @ClassName: PatientEntity
* @Author:yanliang
* @Date:2024/3/13 16:25
* @Description
*/
@Data
public class PatientEntity {
private String id;
private Date createTime;
private Date updateTime;
private String patientName;
private String credNo;
private String phone;
private String birthDates;
private Integer gender;
private Integer patientType;
private String userId;
}
package com.ebaiyihui.family.doctor.server.entity;
import lombok.Data;
import java.util.Date;
/**
* @ClassName: PatientSign
* @Author:yanliang
* @Date:2024/3/11 13:54
* @Description
*/
@Data
public class PatientSignEntity {
private Long id;
private String admId;
private Date createTime;
private Date updateTime;
private String appCode;
private Long organId;
private String organName;
private String patientId;
private String patientUserId;
private String patientName;
private String patientPhone;
private String credNo;
private Long doctorId;
private String doctorName;
private Long deptId;
private String deptName;
private Integer signStatus;
private Integer subStatus;
private Integer status;
}
package com.ebaiyihui.family.doctor.server.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.Date;
/**
* @ClassName: ScheduleRecord
* @Author:yanliang
* @Date:2024/3/11 13:55
* @Description
*/
@Data
//@TableName("schedule_record")
public class ScheduleRecordEntity {
// @TableId
private Long id;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
@ApiModelProperty(value = "医院id")
@NotBlank(message = "医院id")
private String hospitalId;
@ApiModelProperty(value = "医院名称")
@NotBlank(message = "医院名称")
private String hospitalName;
@ApiModelProperty(value = "医生ID")
@NotBlank(message = "医生ID")
private String doctorId;
@ApiModelProperty(value = "医生名称")
@NotBlank(message = "医生名称")
private String doctorName;
@ApiModelProperty(value = "二级科室编码")
@NotBlank(message = "二级科室编码")
private String deptId;
@ApiModelProperty(value = "二级科室名称")
@NotBlank(message = "二级科室名称")
private String deptName;
@ApiModelProperty(value = "总号源数")
@NotBlank(message = "总号源数")
private Integer totalCount;
@ApiModelProperty(value = "可用号源数")
@NotBlank(message = "可用号源数")
private Integer availableCount;
@ApiModelProperty(value = "号源日期")
@NotBlank(message = "号源日期")
@JsonFormat(pattern = "yyyy-MM-dd" ,timezone = "GMT+8")
private Date scheduleDate;
@ApiModelProperty(value = "排班类型0 全天 1 上午 2下午 3夜间门诊")
private Integer scheduleRange;
@ApiModelProperty(value = "排班状态")
private Integer status;
private String organCode;
@ApiModelProperty("业务类型")
private Integer servType;
@ApiModelProperty("排班开始时间")
private String startTime;
@ApiModelProperty("排班结束时间")
private String endTime;
@ApiModelProperty("是否开启循环排班 1开启 -1关闭")
private Integer isCycleSchedule;
}
package com.ebaiyihui.family.doctor.server.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.Date;
/**
* @ClassName: InquiryServiceConfig
* @Author:yanliang
* @Date:2024/3/11 13:55
* @Description
*/
@Data
public class ServiceConfigEntity {
private String id;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 医生/团队id
*/
@ApiModelProperty("医生Id")
@NotBlank(message = "医生id不能为空")
private String doctorId;
private String organId;
@ApiModelProperty("状态")
private Integer status;
private String appCode;
@ApiModelProperty("是否有排班1/-1")
private Integer isSchedule;
@ApiModelProperty("上下线状态")
private Integer officeStatus;
private String serviceCode;
private Long deptId;
@ApiModelProperty("医生头像")
private String doctorPortrait;
@ApiModelProperty("医生职称")
private String doctorProfession;
}
package com.ebaiyihui.family.doctor.server.exception;
/**
* @ClassName: BusinessException
* @Author:yanliang
* @Date:2024/3/13 13:47
* @Description
*/
public class BusinessException extends RuntimeException {
/**
* 错误码
*/
private String errorCode;
public BusinessException(String errorMsg) {
super(errorMsg);
}
public BusinessException(String errorCode, String errorMsg) {
super(errorMsg);
this.errorCode = errorCode;
}
public BusinessException(String errorCode, Throwable error) {
super(error);
this.errorCode = errorCode;
}
public BusinessException(String errorCode, String errorMsg, Throwable error) {
super(errorMsg, error);
this.errorCode = errorCode;
}
public String getErrorCode() {
return errorCode;
}
}
//package com.ebaiyihui.family.doctor.server.exception;
//
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.web.bind.annotation.ControllerAdvice;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.ResponseBody;
//
///**
// * @ClassName: ExceptionHandle
// * @Author:yanliang
// * @Date:2024/3/13 13:48
// * @Description
// */
//@ControllerAdvice
//public class ExceptionHandle {
//
// private Logger logger = LoggerFactory.getLogger(ExceptionHandle.class);
//
// /**
// * 异常处理
// *
// * @param e 异常
// * @return 统一错误响应
// */
// @ExceptionHandler(value = Exception.class)
// @ResponseBody
// public ResultData<?> handle(Exception e) {
// logger.error(e.getMessage(), e);
//
// // 业务异常
// if (e instanceof BusinessException) {
// BusinessException businessException = (BusinessException) e;
// return new ResultData<>().error(businessException.getMessage());
// }
// return new ResultData<>().error("未知错误");
// }
//}
package com.ebaiyihui.family.doctor.server.feign;
import com.doctoruser.api.DoctorInfoApi;
import org.springframework.cloud.openfeign.FeignClient;
/**
* @ClassName: DoctorInfofeignClient
* @Author:yanliang
* @Date:2024/3/13 14:48
* @Description
*/
@FeignClient(name = "doctoruser-service-api",url ="${cloudDoctorUrl}")
public interface DoctorInfofeignClient extends DoctorInfoApi {
}
package com.ebaiyihui.family.doctor.server.feign;
import com.doctor.basedata.api.DoctorWorkingServiceApi;
import org.springframework.cloud.openfeign.FeignClient;
/**
* @ClassName: DoctorWorkingServiceClient
* @Author:yanliang
* @Date:2024/3/11 17:26
* @Description
*/
@FeignClient(name = "doctoruser-service-api",url ="${cloudDoctorUrl}")
public interface DoctorWorkingServiceClient extends DoctorWorkingServiceApi {
}
package com.ebaiyihui.family.doctor.server.feign;
import com.ebaiyihui.imforward.client.interfaces.IMPushMsgApi;
import org.springframework.cloud.openfeign.FeignClient;
/**
* @ClassName: IMPushMsgFeignClient
* @Author:yanliang
* @Date:2024/3/14 15:58
* @Description
*/
@FeignClient(name = "IMSYS-FORWARD")
public interface IMPushMsgFeignClient extends IMPushMsgApi {
}
package com.ebaiyihui.family.doctor.server.feign;
import com.ebaiyihui.imforward.client.interfaces.IMSyncMsgApi;
import org.springframework.cloud.openfeign.FeignClient;
/**
* @ClassName: IMSyncMsgClient
* @Author:yanliang
* @Date:2024/3/13 14:16
* @Description
*/
@FeignClient(name = "IMSYS-FORWARD")
public interface IMSyncMsgClient extends IMSyncMsgApi {
}
package com.ebaiyihui.family.doctor.server.feign;
import com.ebaiyihui.imforward.client.interfaces.IMClientApi;
import org.springframework.cloud.openfeign.FeignClient;
/**
* @ClassName: ImApiFeignClient
* @Author:yanliang
* @Date:2024/3/13 11:48
* @Description
*/
@FeignClient(name = "IMSYS-FORWARD")
public interface ImApiFeignClient extends IMClientApi {
}
package com.ebaiyihui.family.doctor.server.feign;
import com.doctoruser.api.UserApi;
import org.springframework.cloud.openfeign.FeignClient;
/**
* @ClassName: UserApiFeignClient
* @Author:yanliang
* @Date:2024/3/13 11:21
* @Description
*/
@FeignClient(name = "doctoruser-service-api",url ="${cloudDoctorUserUrl}")
public interface UserApiFeignClient extends UserApi {
}
package com.ebaiyihui.family.doctor.server.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ebaiyihui.family.doctor.server.entity.PatientEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @ClassName: PatientMapper
* @Author:yanliang
* @Date:2024/3/13 16:29
* @Description
*/
@Mapper
public interface PatientMapper extends BaseMapper<PatientEntity> {
}
package com.ebaiyihui.family.doctor.server.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ebaiyihui.family.doctor.common.dto.ImInfoListDocReqDTO;
import com.ebaiyihui.family.doctor.common.vo.ImInfoListResVo;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @ClassName: PatientSignMapper
* @Author:yanliang
* @Date:2024/3/11 14:02
* @Description
*/
@Mapper
public interface PatientSignMapper extends BaseMapper<PatientSignEntity> {
List<ImInfoListResVo> queryImInfoList(ImInfoListDocReqDTO param);
}
package com.ebaiyihui.family.doctor.server.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ebaiyihui.family.doctor.server.entity.ScheduleRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @ClassName: ScheduleRecordMapper
* @Author:yanliang
* @Date:2024/3/11 14:18
* @Description
*/
@Mapper
public interface ScheduleRecordMapper extends BaseMapper<ScheduleRecordEntity> {
}
package com.ebaiyihui.family.doctor.server.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ebaiyihui.family.doctor.server.entity.ServiceConfigEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @ClassName: ServiceConfigMapper
* @Author:yanliang
* @Date:2024/3/14 10:06
* @Description
*/
@Mapper
public interface ServiceConfigMapper extends BaseMapper<ServiceConfigEntity> {
}
package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.common.dto.QueryDoctorsDTO;
import com.ebaiyihui.family.doctor.common.vo.DoctorListVo;
import com.ebaiyihui.framework.page.PageResult;
import com.ebaiyihui.framework.response.BaseResponse;
/**
* @ClassName: DoctorService
* @Author:yanliang
* @Date:2024/3/11 09:48
* @Description
*/
public interface DoctorService {
BaseResponse<PageResult<DoctorListVo>> getDoctorList(QueryDoctorsDTO reqVo);
}
package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import com.ebaiyihui.framework.response.BaseResponse;
import com.ebaiyihui.imforward.client.vo.IMQueryTargetSdkAccountRspVO;
/**
* @ClassName: ImChatTemplate
* @Author:yanliang
* @Date:2024/3/13 11:15
* @Description
*/
public interface ImChatTemplate {
BaseResponse createImSession(PatientSignEntity patientSignEntity);
/**
* 通过admId获取Im账号
*
* @param admId 就诊ID
* @param imAppCode IM设备类型
* @return IM账号
*/
IMQueryTargetSdkAccountRspVO queryImAccount(String admId, String imAppCode, String doctorId);
void doctorPrompted(String admId);
}
package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.common.dto.SignedDoctorDTO;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import com.ebaiyihui.framework.response.BaseResponse;
/**
* @ClassName: PatientService
* @Author:yanliang
* @Date:2024/3/13 09:51
* @Description
*/
public interface PatientService {
BaseResponse<String> signedDoctor(SignedDoctorDTO reqVo);
BaseResponse<PatientSignEntity> getSignedDoctor(SignedDoctorDTO reqVo);
}
package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.common.dto.ImInfoDetailDocReqDTO;
import com.ebaiyihui.family.doctor.common.dto.ImInfoListDocReqDTO;
import com.ebaiyihui.family.doctor.common.vo.ImInfoDetailDocResVo;
import com.ebaiyihui.family.doctor.common.vo.ImInfoListResVo;
import com.ebaiyihui.family.doctor.common.vo.ImInfoResVo;
import com.ebaiyihui.family.doctor.server.util.PageUtil;
import com.ebaiyihui.framework.response.BaseResponse;
import com.ebaiyihui.imforward.client.vo.IMQueryMsgReqVO;
import com.ebaiyihui.imforward.client.vo.IMSingleMsgResultVO;
import java.util.List;
/**
* @ClassName: PatientSignService
* @Author:yanliang
* @Date:2024/3/13 14:14
* @Description
*/
public interface PatientSignService {
/**
* 同步会话消息
*
* @param reqVO
* @return
*/
BaseResponse<List<IMSingleMsgResultVO>> getAllMsgContent(IMQueryMsgReqVO reqVO);
BaseResponse<ImInfoResVo> queryImInfo(String admId);
BaseResponse<PageUtil<ImInfoListResVo>> queryImInfoList(ImInfoListDocReqDTO param);
BaseResponse<ImInfoDetailDocResVo> queryImInfoDetail(ImInfoDetailDocReqDTO param);
}
package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.common.dto.InsertScheduleRecordReqDTO;
import com.ebaiyihui.family.doctor.common.dto.RequestGetScheduleForWeekDTO;
import com.ebaiyihui.family.doctor.common.dto.ScheduleForWeekReqDTO;
import com.ebaiyihui.family.doctor.common.vo.ResponseGetScheduleForWeekVo;
import com.ebaiyihui.family.doctor.common.vo.ScheduleForWeekResVo;
import com.ebaiyihui.framework.response.BaseResponse;
import java.util.List;
/**
* @ClassName: ScheduleRecordService
* @Author:yanliang
* @Date:2024/3/14 16:21
* @Description
*/
public interface ScheduleRecordService {
BaseResponse<String> insert(InsertScheduleRecordReqDTO record);
BaseResponse<List<ResponseGetScheduleForWeekVo>> getScheduleForWeek(RequestGetScheduleForWeekDTO requestGetScheduleForWeekDTO);
BaseResponse<List<ScheduleForWeekResVo>> scheduleForWeekNew(ScheduleForWeekReqDTO scheduleForWeekReqDTO);
}
package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.common.dto.RequestGetDoctorOfficeStatusDTO;
import com.ebaiyihui.family.doctor.common.dto.RequestServiceConfigDTO;
import com.ebaiyihui.family.doctor.common.vo.RequestOnlineOrOfflineVo;
import com.ebaiyihui.framework.response.BaseResponse;
/**
* @ClassName: InquiryServiceConfigService
* @Author:yanliang
* @Date:2024/3/12 09:40
* @Description
*/
public interface ServiceConfigService {
RequestOnlineOrOfflineVo getDoctorOfficeStatus(RequestGetDoctorOfficeStatusDTO requestGetDoctorOfficeStatusDTO);
RequestOnlineOrOfflineVo officeOnlineOrOffline(RequestOnlineOrOfflineVo requestOnlineOrOfflineVo);
BaseResponse<Object> saveServiceInfo(RequestServiceConfigDTO serviceConfigDTO);
}
package com.ebaiyihui.family.doctor.server.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ebaiyihui.family.doctor.common.dto.SignedDoctorDTO;
import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants;
import com.ebaiyihui.family.doctor.server.common.enums.StatusEnum;
import com.ebaiyihui.family.doctor.server.entity.PatientEntity;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import com.ebaiyihui.family.doctor.server.exception.BusinessException;
import com.ebaiyihui.family.doctor.server.mapper.PatientMapper;
import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper;
import com.ebaiyihui.family.doctor.server.service.ImChatTemplate;
import com.ebaiyihui.family.doctor.server.service.PatientService;
import com.ebaiyihui.family.doctor.server.util.IDCardUtil;
import com.ebaiyihui.family.doctor.server.util.UUIDUtil;
import com.ebaiyihui.framework.response.BaseResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Objects;
/**
* @ClassName: PatientServiceImpl
* @Author:yanliang
* @Date:2024/3/13 09:51
* @Description
*/
@Service
@Slf4j
public class PatientServiceImpl implements PatientService {
@Autowired
private PatientSignMapper patientSignMapper;
@Autowired
private PatientMapper patientMapper;
@Autowired
private ImChatTemplate imChatTemplate;
@Override
public BaseResponse<String> signedDoctor(SignedDoctorDTO reqVo) {
String orderId = UUIDUtil.generateViewId();
String admId = UUIDUtil.getUUID();
String patientId = "jtys_" + reqVo.getIdCard();
String patientUserId = orderId + "_jtys";
QueryWrapper<PatientEntity> wrapper = new QueryWrapper<>();
PatientEntity patient = new PatientEntity();
patient.setId(reqVo.getPatientId());
wrapper.setEntity(patient);
PatientEntity patientEntity = patientMapper.selectOne(wrapper);
if (Objects.isNull(patientEntity)) {
patientEntity = new PatientEntity();
patientEntity.setId(patientId);
patientEntity.setPatientName(reqVo.getName());
patientEntity.setPhone(reqVo.getPhone());
patientEntity.setPatientType(CommonConstants.PATIENT_TYPE);
patientEntity.setGender(Integer.valueOf(IDCardUtil.getGenderForInteger(reqVo.getIdCard())));
patientEntity.setBirthDates(IDCardUtil.getBirthByIdCard(reqVo.getIdCard()));
patientEntity.setCredNo(reqVo.getIdCard());
patientEntity.setUserId(patientUserId);
log.info("数据库不存在添加患者: {}", JSON.toJSONString(patientEntity));
patientMapper.insert(patientEntity);
} else {
patientId = patientEntity.getId();
patientUserId = patientEntity.getUserId();
}
// 处理换绑医生
if (Objects.nonNull(reqVo.getAdmId())) {
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
PatientSignEntity patientSign = new PatientSignEntity();
patientSign.setAdmId(admId);
psWrapper.setEntity(patientSign);
PatientSignEntity patientSignEntity = patientSignMapper.selectOne(psWrapper);
if (Objects.nonNull(patientSignEntity)) {
patientSignEntity.setStatus(StatusEnum.FINISH_APPLY.getValue());
patientSignEntity.setSignStatus(3);
patientSignEntity.setSubStatus(2);
patientSignMapper.updateById(patientSignEntity);
}
}
PatientSignEntity patientSignEntity = new PatientSignEntity();
patientSignEntity.setAdmId(admId);
patientSignEntity.setAppCode(CommonConstants.APP_CODE);
patientSignEntity.setOrganId(CommonConstants.ORGAN_CODE);
patientSignEntity.setOrganName(CommonConstants.ORGAN_NAME);
patientSignEntity.setDoctorId(reqVo.getDoctorId());
patientSignEntity.setDoctorName(reqVo.getDoctorName());
patientSignEntity.setDeptId(reqVo.getDeptId());
patientSignEntity.setDeptName(reqVo.getDeptName());
patientSignEntity.setSignStatus(reqVo.getSignStatus());
patientSignEntity.setPatientPhone(reqVo.getPhone());
patientSignEntity.setCredNo(reqVo.getIdCard());
patientSignEntity.setPatientId(patientId);
patientSignEntity.setPatientUserId(patientUserId);
patientSignMapper.insert(patientSignEntity);
//创建IM
BaseResponse createImResponse = imChatTemplate.createImSession(patientSignEntity);
if (!createImResponse.isSuccess()) {
log.info("创建IM失败:{}", createImResponse.getMsg());
throw new BusinessException("创建IM失败");
}
// if (2 == reqVo.getSignStatus()){
// imChatTemplate.doctorPrompted(admId);
// }
return BaseResponse.success(admId);
}
@Override
public BaseResponse<PatientSignEntity> getSignedDoctor(SignedDoctorDTO reqVo) {
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
PatientSignEntity patientSign = new PatientSignEntity();
patientSign.setAdmId(reqVo.getAdmId());
psWrapper.setEntity(patientSign);
PatientSignEntity patientSignEntity = patientSignMapper.selectOne(psWrapper);
if (null == patientSignEntity) {
throw new BusinessException("未查询到签约医生信息!");
}
return BaseResponse.success(patientSignEntity);
}
}
package com.ebaiyihui.family.doctor.server.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ebaiyihui.family.doctor.common.dto.RequestGetDoctorOfficeStatusDTO;
import com.ebaiyihui.family.doctor.common.dto.RequestServiceConfigDTO;
import com.ebaiyihui.family.doctor.common.vo.RequestOnlineOrOfflineVo;
import com.ebaiyihui.family.doctor.server.entity.ServiceConfigEntity;
import com.ebaiyihui.family.doctor.server.exception.BusinessException;
import com.ebaiyihui.family.doctor.server.mapper.ServiceConfigMapper;
import com.ebaiyihui.family.doctor.server.service.ServiceConfigService;
import com.ebaiyihui.framework.response.BaseResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @ClassName: ServiceConfigServiceImpl
* @Author:yanliang
* @Date:2024/3/12 09:41
* @Description
*/
@Service
@Slf4j
public class ServiceConfigServiceImpl implements ServiceConfigService {
@Autowired
private ServiceConfigMapper serviceConfigMapper;
@Override
public RequestOnlineOrOfflineVo getDoctorOfficeStatus(RequestGetDoctorOfficeStatusDTO requestGetDoctorOfficeStatusDTO) {
QueryWrapper<ServiceConfigEntity> queryWrapper = new QueryWrapper<>();
ServiceConfigEntity wrapperEntity = new ServiceConfigEntity();
wrapperEntity.setOrganId(requestGetDoctorOfficeStatusDTO.getHospitalId());
wrapperEntity.setAppCode(requestGetDoctorOfficeStatusDTO.getAppCode());
wrapperEntity.setDoctorId(requestGetDoctorOfficeStatusDTO.getDoctorId());
wrapperEntity.setStatus(1);
queryWrapper.setEntity(wrapperEntity);
queryWrapper.last("limit 1");
ServiceConfigEntity serviceConfigEntity = serviceConfigMapper.selectOne(queryWrapper);
if (null == serviceConfigEntity) {
throw new BusinessException("当前医生未开通家庭医生服务或数据不同步!");
}
RequestOnlineOrOfflineVo requestOnlineOrOfflineVo = new RequestOnlineOrOfflineVo();
requestOnlineOrOfflineVo.setAppCode(serviceConfigEntity.getAppCode());
requestOnlineOrOfflineVo.setDoctorId(serviceConfigEntity.getDoctorId());
requestOnlineOrOfflineVo.setHospitalId(serviceConfigEntity.getOrganId());
requestOnlineOrOfflineVo.setOfficeStatus(serviceConfigEntity.getOfficeStatus());
return requestOnlineOrOfflineVo;
}
@Override
public RequestOnlineOrOfflineVo officeOnlineOrOffline(RequestOnlineOrOfflineVo requestOnlineOrOfflineVo) {
QueryWrapper<ServiceConfigEntity> queryWrapper = new QueryWrapper<>();
ServiceConfigEntity wrapperEntity = new ServiceConfigEntity();
wrapperEntity.setOrganId(requestOnlineOrOfflineVo.getHospitalId());
wrapperEntity.setAppCode(requestOnlineOrOfflineVo.getAppCode());
wrapperEntity.setDoctorId(requestOnlineOrOfflineVo.getDoctorId());
queryWrapper.setEntity(wrapperEntity);
queryWrapper.last("limit 1");
ServiceConfigEntity serviceConfigEntity = serviceConfigMapper.selectOne(queryWrapper);
if (null == serviceConfigEntity) {
throw new BusinessException("未查询到该医生上下线配置信息!");
}
serviceConfigEntity.setOfficeStatus(requestOnlineOrOfflineVo.getOfficeStatus());
int flag = serviceConfigMapper.updateById(serviceConfigEntity);
if (flag > 0) {
if (requestOnlineOrOfflineVo.getOfficeStatus().equals(1)) {
throw new BusinessException("上线失败");
} else {
throw new BusinessException("上线失败");
}
}
return requestOnlineOrOfflineVo;
}
@Override
public BaseResponse<Object> saveServiceInfo(RequestServiceConfigDTO serviceConfigDTO) {
QueryWrapper<ServiceConfigEntity> queryWrapper = new QueryWrapper<>();
ServiceConfigEntity wrapperEntity = new ServiceConfigEntity();
wrapperEntity.setOrganId(serviceConfigDTO.getOrganId());
wrapperEntity.setAppCode(serviceConfigDTO.getAppCode());
wrapperEntity.setDeptId(serviceConfigDTO.getDeptId());
wrapperEntity.setDoctorId(serviceConfigDTO.getDoctorId());
wrapperEntity.setServiceCode(serviceConfigDTO.getServiceCode());
queryWrapper.setEntity(wrapperEntity);
queryWrapper.last("limit 1");
ServiceConfigEntity serviceConfigEntity = serviceConfigMapper.selectOne(queryWrapper);
ServiceConfigEntity entity = new ServiceConfigEntity();
//没有找到具体的医生信息,新增
if (null == serviceConfigEntity) {
BeanUtils.copyProperties(serviceConfigDTO, entity);
entity.setOfficeStatus(1);
log.info("添加家庭医生服务信息entity: {}", entity);
serviceConfigMapper.insert(entity);
return BaseResponse.success("新增家庭医生服务信息成功");
}
//找到了医生信息,修改
BeanUtils.copyProperties(serviceConfigDTO, entity);
log.info("查询到服务信息id:" + serviceConfigEntity.getId());
entity.setId(serviceConfigEntity.getId());
entity.setStatus(serviceConfigDTO.getStatus());
log.info("修改家庭医生服务信息entity: {}", entity);
serviceConfigMapper.updateById(entity);
return BaseResponse.success("修改家庭医生服务信息成功");
}
}
package com.ebaiyihui.family.doctor.server.util;
import com.ebaiyihui.family.doctor.server.common.enums.GenderEnum;
import org.apache.commons.lang.StringUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* @ClassName: IDCardUtil
* @Author:yanliang
* @Date:2024/3/13 16:40
* @Description
*/
public class IDCardUtil {
/**
* 通过身份证号码获取年龄
*
* @param idcard
* @return
* @throws ParseException
* @author ZhangWei
*/
public static Integer getAge(String idcard) {
if (idcard == null) {
return null;
}
//身份证位数不足统一返回null
if (idcard.length() != 18) {
return null;
}
return getAgeByBirthDates(idcard.substring(6, 14), "yyyyMMdd");
}
public static Integer getAgeByBirthDates(String birthDateStr) {
return getAgeByBirthDates(birthDateStr, "yyyy-MM-dd");
}
public static Integer getAgeByBirthDates(String birthDateStr, String format) {
if (birthDateStr == null || format == null) {
return 0;
}
Date birthDate;
try {
birthDate = new SimpleDateFormat(format).parse(birthDateStr);
} catch (ParseException e) {
return 0;
}
// 判断出身日期的合法性
Calendar calendar = Calendar.getInstance();
if (calendar.before(birthDate)) {
return 0;
}
// 获取当前时间的 年 月 日
int yearNow = calendar.get(Calendar.YEAR);
int monthNow = calendar.get(Calendar.MONTH);
int dayOfMonthNow = calendar.get(Calendar.DAY_OF_MONTH);
// 获取出身日期的年月日
calendar.setTime(birthDate);
int yearBirth = calendar.get(Calendar.YEAR);
int monthBirth = calendar.get(Calendar.MONTH);
int dayOfMonthBirth = calendar.get(Calendar.DAY_OF_MONTH);
int age = yearNow - yearBirth;
if (monthNow <= monthBirth) {
if (monthNow == monthBirth) {
if (dayOfMonthNow < dayOfMonthBirth) {
age--;
}
} else {
age--;
}
}
return age;
}
public static String getGender(String idcard) {
if (StringUtils.isBlank(idcard)) {
return null;
}
String gender = null;
char[] number = idcard.toCharArray();
boolean flag = true;
int oldLength = 15;
int newLength = 18;
if (number.length == oldLength) {
for (int x = 0; x < number.length; x++) {
if (!flag) {
return null;
}
flag = Character.isDigit(number[x]);
}
} else if (number.length == newLength) {
for (int x = 0; x < number.length - 1; x++) {
if (!flag) {
return null;
}
flag = Character.isDigit(number[x]);
}
}
if (flag && idcard.length() == oldLength) {
gender = Integer.parseInt(idcard.substring(idcard.length() - 3, idcard.length()))
% 2 == 0 ? GenderEnum.FEMALE.getDesc() : GenderEnum.MALE.getDesc();
} else if (flag && idcard.length() == newLength) {
gender = Integer.parseInt(idcard.substring(idcard.length() - 4, idcard.length() - 1)) % 2 == 0
? GenderEnum.FEMALE.getDesc() : GenderEnum.MALE.getDesc();
}
return gender;
}
public static Integer getGenderForInteger(String idcard) {
if (StringUtils.isBlank(idcard)) {
return null;
}
Integer gender = null;
char[] number = idcard.toCharArray();
boolean flag = true;
int oldLength = 15;
int newLength = 18;
if (number.length == oldLength) {
for (int x = 0; x < number.length; x++) {
if (!flag) {
return null;
}
flag = Character.isDigit(number[x]);
}
} else if (number.length == newLength) {
for (int x = 0; x < number.length - 1; x++) {
if (!flag) {
return null;
}
flag = Character.isDigit(number[x]);
}
}
if (flag && idcard.length() == oldLength) {
gender = Integer.parseInt(idcard.substring(idcard.length() - 3, idcard.length()))
% 2 == 0 ? GenderEnum.FEMALE.getValue() : GenderEnum.MALE.getValue();
} else if (flag && idcard.length() == newLength) {
gender = Integer.parseInt(idcard.substring(idcard.length() - 4, idcard.length() - 1)) % 2 == 0
? GenderEnum.FEMALE.getValue() : GenderEnum.MALE.getValue();
}
return gender;
}
/**
* 通过身份证号码获取生日 格式 yyyy-MM-dd
*/
public static String getBirthByIdCard(String idCard) {
if (idCard == null) {
return null;
}
//身份证位数不足统一返回null
if (idCard.length() != 18) {
return null;
}
String year = idCard.substring(6, 10);
String month = idCard.substring(10, 12);
String day = idCard.substring(12, 14);
String birth = year + "-" + month + "-" + day;
return birth;
}
}
server:
port: 9888
spring:
application:
name: byh-family-doctor
# profiles:
# active: test
cloud:
config:
name: byh-family-doctor
profile: pro # 配置文件版本
label: zryh # 配置文件分支
discovery:
enabled: true #是从配置中心读取文件
service-id: byh-service-config
eureka:
client:
serviceUrl:
defaultZone: http://discover:1111/eureka/
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论