Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
B
byh-family-doctor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
包
包
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
杨凯
byh-family-doctor
Commits
913f0850
提交
913f0850
authored
3月 25, 2024
作者:
杨凯
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:家庭医生初始化
上级
e11965b6
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
209 行增加
和
57 行删除
+209
-57
RequestGetScheduleForWeekDTO.java
...amily/doctor/common/dto/RequestGetScheduleForWeekDTO.java
+3
-0
RequestUpdateScheduleStatusDTO.java
...ily/doctor/common/dto/RequestUpdateScheduleStatusDTO.java
+26
-0
ScheduleRecordController.java
...ly/doctor/server/controller/ScheduleRecordController.java
+7
-0
ScheduleRecordService.java
...i/family/doctor/server/service/ScheduleRecordService.java
+3
-0
ScheduleRecordServiceImpl.java
...doctor/server/service/impl/ScheduleRecordServiceImpl.java
+162
-52
ScheduleTask.java
...com/ebaiyihui/family/doctor/server/task/ScheduleTask.java
+0
-1
SignedTask.java
...a/com/ebaiyihui/family/doctor/server/task/SignedTask.java
+7
-4
MobileBenefitPackageMapper.xml
.../src/main/resources/mapper/MobileBenefitPackageMapper.xml
+1
-0
没有找到文件。
family-doctor-common/src/main/java/com/ebaiyihui/family/doctor/common/dto/RequestGetScheduleForWeekDTO.java
浏览文件 @
913f0850
...
...
@@ -23,6 +23,9 @@ public class RequestGetScheduleForWeekDTO {
@ApiModelProperty
(
"第几周"
)
private
Integer
week
;
@ApiModelProperty
(
"更多周"
)
private
Integer
[]
weeks
;
@ApiModelProperty
(
"医生id"
)
private
String
doctorId
;
...
...
family-doctor-common/src/main/java/com/ebaiyihui/family/doctor/common/dto/RequestUpdateScheduleStatusDTO.java
0 → 100644
浏览文件 @
913f0850
package
com
.
ebaiyihui
.
family
.
doctor
.
common
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @ClassName: RequestUpdateScheduleStatusDTO
* @Author:yanliang
* @Date:2024/3/25 11:21
* @Description
*/
@Data
public
class
RequestUpdateScheduleStatusDTO
{
@ApiModelProperty
(
"排班id"
)
private
Long
id
;
@ApiModelProperty
(
"停诊复诊:正常—— 1 停诊—— -1"
)
private
Integer
scheduleStatus
;
@ApiModelProperty
(
"需要停诊的日期 yyyy-MM-dd"
)
private
String
scheduleTime
;
@ApiModelProperty
(
"是否开启循环排班 1开启 -1关闭"
)
private
Integer
isCycleSchedule
;
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/controller/ScheduleRecordController.java
浏览文件 @
913f0850
...
...
@@ -2,6 +2,7 @@ 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.RequestUpdateScheduleStatusDTO
;
import
com.ebaiyihui.family.doctor.common.dto.ScheduleForWeekReqDTO
;
import
com.ebaiyihui.family.doctor.common.vo.ResponseGetScheduleForWeekVo
;
import
com.ebaiyihui.family.doctor.common.vo.ScheduleForWeekResVo
;
...
...
@@ -56,4 +57,10 @@ public class ScheduleRecordController {
return
scheduleRecordService
.
scheduleForWeekNew
(
scheduleForWeekReqDTO
);
}
@RequestMapping
(
value
=
"/updateStatus"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
"更新或者删除排班"
)
public
BaseResponse
<
String
>
updateStatus
(
@RequestBody
RequestUpdateScheduleStatusDTO
updateScheduleStatusDTO
)
{
return
scheduleRecordService
.
updateStatus
(
updateScheduleStatusDTO
);
}
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/ScheduleRecordService.java
浏览文件 @
913f0850
...
...
@@ -2,6 +2,7 @@ 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.RequestUpdateScheduleStatusDTO
;
import
com.ebaiyihui.family.doctor.common.dto.ScheduleForWeekReqDTO
;
import
com.ebaiyihui.family.doctor.common.vo.ResponseGetScheduleForWeekVo
;
import
com.ebaiyihui.family.doctor.common.vo.ScheduleForWeekResVo
;
...
...
@@ -23,4 +24,6 @@ public interface ScheduleRecordService {
BaseResponse
<
List
<
ResponseGetScheduleForWeekVo
>>
getScheduleForWeek
(
RequestGetScheduleForWeekDTO
requestGetScheduleForWeekDTO
);
BaseResponse
<
List
<
ScheduleForWeekResVo
>>
scheduleForWeekNew
(
ScheduleForWeekReqDTO
scheduleForWeekReqDTO
);
BaseResponse
<
String
>
updateStatus
(
RequestUpdateScheduleStatusDTO
updateScheduleStatusDTO
);
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/ScheduleRecordServiceImpl.java
浏览文件 @
913f0850
...
...
@@ -125,8 +125,11 @@ public class ScheduleRecordServiceImpl implements ScheduleRecordService {
Date
intEndDate
=
DateUtils
.
dateToDateAsFormat
(
DateUtils
.
getEndDayOfWeek
());
Integer
week
=
requestGetScheduleForWeekDTO
.
getWeek
();
Integer
[]
weeks
=
requestGetScheduleForWeekDTO
.
getWeeks
();
List
<
ResponseGetScheduleForWeekVo
>
resList
=
new
ArrayList
<>();
for
(
Integer
week
:
weeks
)
{
Date
startDate
=
null
;
Date
endDate
=
null
;
...
...
@@ -197,8 +200,10 @@ public class ScheduleRecordServiceImpl implements ScheduleRecordService {
}
scheduleForWeekVo
.
setScheduleOfDayVoList
(
scheduleOfDayVoList
);
list
.
add
(
scheduleForWeekVo
);
resList
.
addAll
(
list
);
}
return
BaseResponse
.
success
(
list
);
}
return
BaseResponse
.
success
(
resList
);
}
@Override
...
...
@@ -305,6 +310,111 @@ public class ScheduleRecordServiceImpl implements ScheduleRecordService {
return
BaseResponse
.
success
(
list
);
}
@Override
public
BaseResponse
<
String
>
updateStatus
(
RequestUpdateScheduleStatusDTO
updateScheduleStatusDTO
)
{
ScheduleRecordEntity
entity
=
scheduleRecordMapper
.
selectById
(
updateScheduleStatusDTO
.
getId
());
if
(
null
==
entity
)
{
return
BaseResponse
.
error
(
"排班信息不存在"
);
}
//操作循环排班
if
(
null
!=
updateScheduleStatusDTO
.
getIsCycleSchedule
())
{
closeCycle
(
updateScheduleStatusDTO
,
entity
);
log
.
info
(
"======循环排班操作成功======"
);
return
BaseResponse
.
success
();
}
//操作停诊
BaseResponse
<
String
>
baseResponse
=
closeSchedule
(
updateScheduleStatusDTO
,
entity
);
return
baseResponse
;
}
/**
* Discreption: 关闭循环排班:该排班之后的循环排班停诊
*/
private
void
closeCycle
(
RequestUpdateScheduleStatusDTO
updateScheduleStatusDTO
,
ScheduleRecordEntity
entity
)
{
ScheduleRecordEntity
entityUpdate
=
new
ScheduleRecordEntity
();
entityUpdate
.
setIsCycleSchedule
(
updateScheduleStatusDTO
.
getIsCycleSchedule
());
entityUpdate
.
setId
(
updateScheduleStatusDTO
.
getId
());
scheduleRecordMapper
.
updateById
(
entityUpdate
);
String
date
=
DateUtils
.
dateToSimpleString
(
entity
.
getScheduleDate
());
//查询循环排班日期
List
<
String
>
nextDays
=
DateUtils
.
getOneDayNextWeekTwo
(
new
ArrayList
<
String
>()
{{
add
(
date
);
}},
5
);
List
<
ScheduleRecordEntity
>
list
=
scheduleRecordMapper
.
selectList
(
new
QueryWrapper
<
ScheduleRecordEntity
>().
lambda
()
.
eq
(
ScheduleRecordEntity:
:
getDeptId
,
entity
.
getDeptId
())
.
eq
(
ScheduleRecordEntity:
:
getDoctorId
,
entity
.
getDoctorId
())
.
eq
(
ScheduleRecordEntity:
:
getHospitalId
,
entity
.
getHospitalId
())
.
eq
(
ScheduleRecordEntity:
:
getServType
,
entity
.
getServType
())
.
eq
(
ScheduleRecordEntity:
:
getStartTime
,
entity
.
getStartTime
())
.
eq
(
ScheduleRecordEntity:
:
getEndTime
,
entity
.
getEndTime
())
.
in
(
ScheduleRecordEntity:
:
getScheduleDate
,
nextDays
));
//停诊
for
(
ScheduleRecordEntity
scheduleRecordEntity
:
list
)
{
if
(!
scheduleRecordEntity
.
getId
().
equals
(
entity
.
getId
()))
{
closeSchedule
(
updateScheduleStatusDTO
,
scheduleRecordEntity
);
}
}
}
/**
* Discreption:停诊取消排班
*/
private
BaseResponse
<
String
>
closeSchedule
(
RequestUpdateScheduleStatusDTO
updateScheduleStatusDTO
,
ScheduleRecordEntity
entity
)
{
//查询排班
BaseResponse
<
String
>
x
=
getStringBaseResponse
(
entity
);
if
(
x
!=
null
)
{
return
x
;
}
ScheduleRecordEntity
entityUpdate
=
new
ScheduleRecordEntity
();
entityUpdate
.
setStatus
(-
1
);
if
(
Objects
.
nonNull
(
updateScheduleStatusDTO
.
getIsCycleSchedule
()))
{
entityUpdate
.
setIsCycleSchedule
(
updateScheduleStatusDTO
.
getIsCycleSchedule
());
}
entityUpdate
.
setId
(
entity
.
getId
());
scheduleRecordMapper
.
updateById
(
entityUpdate
);
return
BaseResponse
.
success
(
"医生排班停诊成功"
);
}
private
BaseResponse
<
String
>
getStringBaseResponse
(
ScheduleRecordEntity
entity
)
{
String
nowDateStr
=
DateUtils
.
getCurrentDateSimpleToString
();
log
.
info
(
"nowDateStr{}"
,
nowDateStr
);
String
hourAndSecond
=
DateUtils
.
getHourAndSecond
();
log
.
info
(
"hourAndSecond{}"
,
hourAndSecond
);
Date
now
=
null
;
Date
endEntity
=
null
;
Date
hourAndSec
=
null
;
try
{
now
=
DateUtils
.
strToDate
(
nowDateStr
,
"yyyy-MM-dd"
);
endEntity
=
DateUtils
.
strToDate
(
entity
.
getEndTime
(),
"HH:mm"
);
hourAndSec
=
DateUtils
.
strToDate
(
hourAndSecond
,
"HH:mm"
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
if
(
entity
.
getStatus
().
equals
(
WhetherEnum
.
FORBID
.
getValue
()))
{
return
BaseResponse
.
error
(
"已停诊,请勿重复停诊"
);
}
if
(
isBoolean
(
entity
,
now
,
endEntity
,
hourAndSec
))
{
return
BaseResponse
.
error
(
"超时不能停诊"
);
}
return
null
;
}
private
boolean
isBoolean
(
ScheduleRecordEntity
entity
,
Date
now
,
Date
endEntity
,
Date
hourAndSec
)
{
return
entity
.
getScheduleDate
().
equals
(
now
)
&&
hourAndSec
.
after
(
endEntity
)
||
entity
.
getScheduleDate
().
before
(
now
);
}
private
void
getInsertSchedule
(
InsertScheduleRecordReqDTO
record
,
DoctorInfoForScheduleDTO
doctorInfo
,
ScheduleRangeAndTimeDTO
rangeRes
,
String
s
)
{
ScheduleRecordEntity
schedule
=
new
ScheduleRecordEntity
();
BeanUtils
.
copyProperties
(
record
,
schedule
);
...
...
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/task/ScheduleTask.java
浏览文件 @
913f0850
...
...
@@ -34,7 +34,6 @@ public class ScheduleTask {
@Autowired
private
ScheduleRecordMapper
scheduleRecordMapper
;
// @Scheduled(cron = "0 0/2 * * * ?")
@Scheduled
(
cron
=
"0 0 0 * * ?"
)
public
void
regularTimeExport
()
{
...
...
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/task/SignedTask.java
浏览文件 @
913f0850
...
...
@@ -22,6 +22,7 @@ import com.ebaiyihui.imforward.client.vo.IMQueryUserLoginRspVO;
import
com.ebaiyihui.imforward.client.vo.IMSingleMsgResultVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
...
...
@@ -50,9 +51,11 @@ public class SignedTask {
@Autowired
private
ThirdOrderPushUtil
thirdOrderPushUtil
;
//
@Scheduled(cron = "0 0 10 * * ?")
@Scheduled
(
cron
=
"0 0 10 * * ?"
)
public
void
healthRecordWhetherUpdate
()
{
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignSevice
.
selectList
(
new
PatientSignEntity
());
PatientSignEntity
patientSignEntity
=
new
PatientSignEntity
();
patientSignEntity
.
setStatus
(
StatusEnum
.
IN_CONSULTATION
.
getValue
());
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignSevice
.
selectList
(
patientSignEntity
);
if
(!
patientSignEntities
.
isEmpty
())
{
for
(
PatientSignEntity
ps
:
patientSignEntities
)
{
HealthInfoDTO
healthInfoDTO
=
new
HealthInfoDTO
();
...
...
@@ -128,7 +131,7 @@ public class SignedTask {
}
//
@Scheduled(cron = "0 0 20 * * ?")
@Scheduled
(
cron
=
"0 0 20 * * ?"
)
public
void
holidayPush
()
{
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignSevice
.
selectList
(
new
PatientSignEntity
());
try
{
...
...
@@ -177,7 +180,7 @@ public class SignedTask {
}
}
//
@Scheduled(cron = "0 0 1 * * ?")
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
public
void
orderInvalidation
()
{
List
<
MobileBenefitPackageEntity
>
mobileBenefitPackageEntities
=
mobileBenefitPackageMapper
.
queryMaxOneList
();
try
{
...
...
family-doctor-server/src/main/resources/mapper/MobileBenefitPackageMapper.xml
浏览文件 @
913f0850
...
...
@@ -59,6 +59,7 @@
mobile_benefit_package
WHERE
phone = #{mobile} and activateOrderId = #{activateOrderId}
and NOW() BETWEEN STR_TO_DATE(benefitsStartTime, '%Y-%m-%d %H:%i:%s') AND STR_TO_DATE(benefitsEndTime, '%Y-%m-%d %H:%i:%s')
ORDER BY
x_create_time DESC
LIMIT 0,1
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论