Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
B
byh-family-doctor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
包
包
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
杨凯
byh-family-doctor
Commits
68f8e322
提交
68f8e322
authored
4月 11, 2024
作者:
杨凯
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:家庭医生初始化
上级
3cb36f12
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
44 行增加
和
56 行删除
+44
-56
PatientServiceImpl.java
...family/doctor/server/service/impl/PatientServiceImpl.java
+44
-56
没有找到文件。
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/PatientServiceImpl.java
浏览文件 @
68f8e322
...
@@ -30,6 +30,7 @@ import com.ebaiyihui.family.doctor.server.util.UUIDUtil;
...
@@ -30,6 +30,7 @@ import com.ebaiyihui.family.doctor.server.util.UUIDUtil;
import
com.ebaiyihui.family.doctor.server.vo.OrderTaskVo
;
import
com.ebaiyihui.family.doctor.server.vo.OrderTaskVo
;
import
com.ebaiyihui.framework.response.BaseResponse
;
import
com.ebaiyihui.framework.response.BaseResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -105,14 +106,16 @@ public class PatientServiceImpl implements PatientService {
...
@@ -105,14 +106,16 @@ public class PatientServiceImpl implements PatientService {
PatientSignEntity
oldPatientSignEntity
=
new
PatientSignEntity
();
PatientSignEntity
oldPatientSignEntity
=
new
PatientSignEntity
();
// 改签或者排班医生获取签约的id
// 改签或者排班医生获取签约的id
Date
signCreateTime
=
null
;
if
(!
SignStatus
.
SIGNED
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
if
(!
SignStatus
.
SIGNED
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
patientSign
.
setAdmId
(
reqVo
.
getAdmId
());
patientSign
.
setAdmId
(
reqVo
.
getAdmId
());
psWrapper
.
setEntity
(
patientSign
);
psWrapper
.
setEntity
(
patientSign
);
oldPatientSignEntity
=
patientSignMapper
.
selectOne
(
psWrapper
);
oldPatientSignEntity
=
patientSignMapper
.
selectOne
(
psWrapper
);
signCreateTime
=
oldPatientSignEntity
.
getCreateTime
();
Date
signCreateTime
=
oldPatientSignEntity
.
getCreateTime
();
PatientSignEntity
tempOldPatientSignEntity
=
new
PatientSignEntity
();
BeanUtils
.
copyProperties
(
oldPatientSignEntity
,
tempOldPatientSignEntity
);
log
.
info
(
"tempOldPatientSignEntity={}"
,
tempOldPatientSignEntity
);
log
.
info
(
"入参查询oldPatientSignEntity={}"
,
oldPatientSignEntity
);
log
.
info
(
"入参查询oldPatientSignEntity={}"
,
oldPatientSignEntity
);
// 改签查询原始签约信息
// 改签查询原始签约信息
if
(
SignStatus
.
CANCEL
.
getValue
().
equals
(
reqVo
.
getSignStatus
())
&&
!
oldPatientSignEntity
.
getSignId
().
equals
(
0L
))
{
if
(
SignStatus
.
CANCEL
.
getValue
().
equals
(
reqVo
.
getSignStatus
())
&&
!
oldPatientSignEntity
.
getSignId
().
equals
(
0L
))
{
...
@@ -122,70 +125,55 @@ public class PatientServiceImpl implements PatientService {
...
@@ -122,70 +125,55 @@ public class PatientServiceImpl implements PatientService {
cpsWrapper
.
setEntity
(
cPatientSign
);
cpsWrapper
.
setEntity
(
cPatientSign
);
oldPatientSignEntity
=
patientSignMapper
.
selectOne
(
cpsWrapper
);
oldPatientSignEntity
=
patientSignMapper
.
selectOne
(
cpsWrapper
);
log
.
info
(
"改签查询原始oldPatientSignEntity={}"
,
oldPatientSignEntity
);
log
.
info
(
"改签查询原始oldPatientSignEntity={}"
,
oldPatientSignEntity
);
}
}
if
(!
SignStatus
.
NORMAL
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
Integer
signStatus
=
SignStatus
.
SIGNED
.
getValue
();
Integer
status
=
StatusEnum
.
IN_CONSULTATION
.
getValue
();
if
(
SignStatus
.
SIGNED
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
List
<
PatientSignEntity
>
patientSignEntities
=
getPatientSignList
(
reqVo
.
getPhone
(),
reqVo
.
getPackageOrderId
(),
signStatus
,
status
);
if
(!
patientSignEntities
.
isEmpty
())
{
if
(
SignStatus
.
SIGNED
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
return
BaseResponse
.
error
(
"已经有进行中的签约或者改签医生,不能再进行签约或者改签!!!"
);
}
}
}
else
{
log
.
info
(
"signCreateTime={}, signStartTime={}, signEndTime={}"
,
signCreateTime
,
signStartTime
,
signEndTime
);
log
.
info
(
"signCreateTime={}, signStartTime={}, signEndTime={}"
,
signCreateTime
,
signStartTime
,
signEndTime
);
if
(
signCreateTime
.
after
(
signStartTime
)
&&
signCreateTime
.
before
(
signEndTime
))
{
if
(
signCreateTime
.
after
(
signStartTime
)
&&
signCreateTime
.
before
(
signEndTime
))
{
return
BaseResponse
.
error
(
"已经有进行中的签约或者改签医生,不能再进行签约或者改签!!!"
);
return
BaseResponse
.
error
(
"已经有进行中的签约或者改签医生,不能再进行签约或者改签!!!"
);
}
}
}
}
else
{
// 处理换绑医生
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
if
((!
StringUtils
.
isEmpty
(
reqVo
.
getAdmId
())
||
!
StringUtils
.
isEmpty
(
reqVo
.
getSignSeqId
())))
{
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
if
(
Objects
.
nonNull
(
tempOldPatientSignEntity
))
{
patientSign
.
setSignId
(
oldPatientSignEntity
.
getId
());
signEndTime
=
tempOldPatientSignEntity
.
getSignEndTime
();
patientSign
.
setStatus
(
StatusEnum
.
IN_CONSULTATION
.
getValue
());
tempOldPatientSignEntity
.
setStatus
(
StatusEnum
.
FINISH_APPLY
.
getValue
());
patientSign
.
setSignStatus
(
SignStatus
.
NORMAL
.
getValue
());
tempOldPatientSignEntity
.
setSignStatus
(
SignStatus
.
CANCEL
.
getValue
());
psWrapper
.
setEntity
(
patientSign
);
tempOldPatientSignEntity
.
setSubStatus
(
2
);
PatientSignEntity
patientSignEntity
=
patientSignMapper
.
selectOne
(
psWrapper
);
tempOldPatientSignEntity
.
setSignEndTime
(
curDate
);
if
(
Objects
.
nonNull
(
patientSignEntity
))
{
patientSignMapper
.
updateById
(
tempOldPatientSignEntity
);
return
BaseResponse
.
success
(
patientSignEntity
.
getAdmId
());
}
else
{
}
return
BaseResponse
.
error
(
"未查询到的签约医生,不能进行改签!!!"
);
}
}
// 查询排班医生信息
ScheduleRecordEntity
scheduleRecordEntity
=
getScheduleDoctor
(
reqVo
.
getPatientId
(),
reqVo
.
getPackageOrderId
(),
oldPatientSignEntity
.
getDoctorId
());
doctorId
=
Long
.
valueOf
(
scheduleRecordEntity
.
getDoctorId
());
doctorName
=
scheduleRecordEntity
.
getDoctorName
();
deptId
=
Long
.
valueOf
(
scheduleRecordEntity
.
getDeptId
());
deptName
=
scheduleRecordEntity
.
getDeptName
();
}
}
else
if
(
SignStatus
.
NORMAL
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
// 排班签约信息
QueryWrapper
<
PatientSignEntity
>
nPsWrapper
=
new
QueryWrapper
<>();
PatientSignEntity
nPatientSign
=
new
PatientSignEntity
();
nPatientSign
.
setSignId
(
oldPatientSignEntity
.
getId
());
nPatientSign
.
setStatus
(
StatusEnum
.
IN_CONSULTATION
.
getValue
());
nPatientSign
.
setSignStatus
(
SignStatus
.
NORMAL
.
getValue
());
nPsWrapper
.
setEntity
(
nPatientSign
);
PatientSignEntity
patientSignEntity
=
patientSignMapper
.
selectOne
(
nPsWrapper
);
if
(
Objects
.
nonNull
(
patientSignEntity
))
{
return
BaseResponse
.
success
(
patientSignEntity
.
getAdmId
());
}
// 处理换绑医生
// 查询排班医生信息
if
((!
StringUtils
.
isEmpty
(
reqVo
.
getAdmId
())
||
!
StringUtils
.
isEmpty
(
reqVo
.
getSignSeqId
()))
ScheduleRecordEntity
scheduleRecordEntity
=
getScheduleDoctor
(
reqVo
.
getPatientId
(),
reqVo
.
getPackageOrderId
(),
oldPatientSignEntity
.
getDoctorId
());
&&
SignStatus
.
CANCEL
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
doctorId
=
Long
.
valueOf
(
scheduleRecordEntity
.
getDoctorId
());
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
doctorName
=
scheduleRecordEntity
.
getDoctorName
();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
deptId
=
Long
.
valueOf
(
scheduleRecordEntity
.
getDeptId
());
if
(
Objects
.
nonNull
(
reqVo
.
getAdmId
()))
{
deptName
=
scheduleRecordEntity
.
getDeptName
();
patientSign
.
setAdmId
(
reqVo
.
getAdmId
());
}
}
if
(
Objects
.
nonNull
(
reqVo
.
getSignSeqId
()))
{
}
else
{
// 首次签约
patientSign
.
setId
(
Long
.
valueOf
(
reqVo
.
getSignSeqId
()));
Integer
signStatus
=
SignStatus
.
SIGNED
.
getValue
();
}
Integer
status
=
StatusEnum
.
IN_CONSULTATION
.
getValue
();
psWrapper
.
setEntity
(
patientSign
);
List
<
PatientSignEntity
>
patientSignEntities
=
getPatientSignList
(
reqVo
.
getPhone
(),
reqVo
.
getPackageOrderId
(),
PatientSignEntity
patientSignEntity
=
patientSignMapper
.
selectOne
(
psWrapper
);
signStatus
,
status
);
if
(
Objects
.
nonNull
(
patientSignEntity
))
{
if
(!
patientSignEntities
.
isEmpty
())
{
signEndTime
=
patientSignEntity
.
getSignEndTime
();
if
(
SignStatus
.
SIGNED
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
patientSignEntity
.
setStatus
(
StatusEnum
.
FINISH_APPLY
.
getValue
());
return
BaseResponse
.
error
(
"已经有进行中的签约或者改签医生,不能再进行签约或者改签!!!"
);
patientSignEntity
.
setSignStatus
(
SignStatus
.
CANCEL
.
getValue
());
}
patientSignEntity
.
setSubStatus
(
2
);
patientSignEntity
.
setSignEndTime
(
curDate
);
patientSignMapper
.
updateById
(
patientSignEntity
);
}
else
{
return
BaseResponse
.
error
(
"未查询到的签约医生,不能进行改签!!!"
);
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论