Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
B
byh-family-doctor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
包
包
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
杨凯
byh-family-doctor
Commits
be4dcb59
提交
be4dcb59
authored
3月 22, 2024
作者:
杨凯
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:家庭医生初始化
上级
a4adf680
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
36 行增加
和
36 行删除
+36
-36
PatientServiceImpl.java
...family/doctor/server/service/impl/PatientServiceImpl.java
+36
-36
没有找到文件。
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/PatientServiceImpl.java
浏览文件 @
be4dcb59
...
...
@@ -33,10 +33,7 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Random
;
import
java.util.*
;
/**
* @ClassName: PatientServiceImpl
...
...
@@ -97,29 +94,18 @@ public class PatientServiceImpl implements PatientService {
String
doctorName
=
reqVo
.
getDoctorName
();
Long
deptId
=
reqVo
.
getDeptId
();
String
deptName
=
reqVo
.
getDeptName
();
List
<
PatientSignEntity
>
patientSignEntities
=
new
ArrayList
<>();
if
(
SignStatus
.
SIGNED
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
patientSign
.
setPatientPhone
(
reqVo
.
getPhone
());
patientSign
.
setPackageOrderId
(
reqVo
.
getPackageOrderId
());
patientSign
.
setSignStatus
(
SignStatus
.
SIGNED
.
getValue
());
patientSign
.
setStatus
(
StatusEnum
.
IN_CONSULTATION
.
getValue
());
psWrapper
.
setEntity
(
patientSign
);
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignMapper
.
selectList
(
psWrapper
);
patientSignEntities
=
getPatientSignList
(
reqVo
.
getPhone
(),
reqVo
.
getPackageOrderId
(),
SignStatus
.
SIGNED
.
getValue
(),
StatusEnum
.
IN_CONSULTATION
.
getValue
());
if
(!
patientSignEntities
.
isEmpty
())
{
return
BaseResponse
.
error
(
"已经有进行中的签约的医生,不能再进行签约!!!"
);
}
}
else
if
(
SignStatus
.
CANCEL
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
patientSign
.
setPatientPhone
(
reqVo
.
getPhone
());
patientSign
.
setPackageOrderId
(
reqVo
.
getPackageOrderId
());
patientSign
.
setSignStatus
(
SignStatus
.
CANCEL
.
getValue
());
patientSign
.
setStatus
(
StatusEnum
.
IN_CONSULTATION
.
getValue
());
psWrapper
.
setEntity
(
patientSign
);
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignMapper
.
selectList
(
psWrapper
);
patientSignEntities
=
getPatientSignList
(
reqVo
.
getPhone
(),
reqVo
.
getPackageOrderId
(),
SignStatus
.
CANCEL
.
getValue
(),
StatusEnum
.
IN_CONSULTATION
.
getValue
());
if
(!
patientSignEntities
.
isEmpty
())
{
return
BaseResponse
.
error
(
"已经有进行中的
签约的医生,不能再进行
签约!!!"
);
return
BaseResponse
.
error
(
"已经有进行中的
改签医生,不能再进行改签
签约!!!"
);
}
}
else
{
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
...
...
@@ -141,18 +127,6 @@ public class PatientServiceImpl implements PatientService {
deptId
=
Long
.
valueOf
(
scheduleRecordEntity
.
getDeptId
());
deptName
=
scheduleRecordEntity
.
getDeptName
();
}
if
(
SignStatus
.
CANCEL
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
patientSign
.
setPatientPhone
(
reqVo
.
getPhone
());
psWrapper
.
setEntity
(
patientSign
);
psWrapper
.
between
(
"update_time"
,
entity
.
getBenefitsStartTime
(),
entity
.
getBenefitsEndTime
());
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignMapper
.
selectList
(
psWrapper
);
if
(!
patientSignEntities
.
isEmpty
()
&&
patientSignEntities
.
size
()
>=
2
)
{
return
BaseResponse
.
error
(
"30天之内已经进行过改签医生,不能在进行改签!!!"
);
}
}
// 处理换绑医生
if
((
Objects
.
nonNull
(
reqVo
.
getAdmId
())
||
Objects
.
nonNull
(
reqVo
.
getSignSeqId
())
&&
SignStatus
.
CANCEL
.
getValue
().
equals
(
reqVo
.
getSignStatus
())))
{
...
...
@@ -194,8 +168,8 @@ public class PatientServiceImpl implements PatientService {
patientSignEntity
.
setStatus
(
StatusEnum
.
IN_CONSULTATION
.
getValue
());
patientSignEntity
.
setPackageOrderId
(
reqVo
.
getPackageOrderId
());
patientSignEntity
.
setSignEndTime
(
signEndTime
);
if
(
Objects
.
nonNull
(
reqVo
.
getSignSeqId
()
))
{
patientSignEntity
.
setSignId
(
reqVo
.
getSignSeq
Id
());
if
(
!
patientSignEntities
.
isEmpty
(
))
{
patientSignEntity
.
setSignId
(
patientSignEntities
.
get
(
0
).
getSign
Id
());
}
patientSignMapper
.
insert
(
patientSignEntity
);
...
...
@@ -259,7 +233,10 @@ public class PatientServiceImpl implements PatientService {
}
// 推送第三方签名相关订单信息
thirdOrderPushUtil
.
pushSignedOrder
(
String
.
valueOf
(
reqVo
.
getDoctorId
()),
reqVo
.
getPhone
(),
String
.
valueOf
(
patientSignEntity
.
getId
()),
reqVo
.
getPackageOrderId
(),
reqVo
.
getSignStatus
());
thirdOrderPushUtil
.
pushSignedOrder
(
String
.
valueOf
(
reqVo
.
getDoctorId
()),
reqVo
.
getPhone
(),
SignStatus
.
SIGNED
.
getValue
().
equals
(
reqVo
.
getSignStatus
())
?
String
.
valueOf
(
patientSignEntity
.
getId
())
:
String
.
valueOf
(
patientSignEntity
.
getSignId
()),
reqVo
.
getPackageOrderId
(),
reqVo
.
getSignStatus
());
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
...
...
@@ -331,4 +308,27 @@ public class PatientServiceImpl implements PatientService {
log
.
info
(
"当前下单的医生:{}"
,
JSON
.
toJSONString
(
scheduleRecordEntity
));
return
scheduleRecordEntity
;
}
/**
* 查询患者签名信息
*
* @param phone
* @param packageOrderId
* @param signStatus
* @param status
* @return
*/
List
<
PatientSignEntity
>
getPatientSignList
(
String
phone
,
String
packageOrderId
,
Integer
signStatus
,
Integer
status
)
{
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
patientSign
.
setPatientPhone
(
phone
);
patientSign
.
setPackageOrderId
(
packageOrderId
);
patientSign
.
setSignStatus
(
signStatus
);
patientSign
.
setStatus
(
status
);
psWrapper
.
setEntity
(
patientSign
);
psWrapper
.
orderByDesc
(
"create_time"
);
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignMapper
.
selectList
(
psWrapper
);
return
patientSignEntities
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论