Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
B
byh-family-doctor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
包
包
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
杨凯
byh-family-doctor
Commits
a190e6ee
提交
a190e6ee
authored
3月 21, 2024
作者:
杨凯
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:家庭医生初始化
上级
f6310f70
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
232 行增加
和
105 行删除
+232
-105
MobileBenefitPackageEntity.java
...mily/doctor/server/entity/MobileBenefitPackageEntity.java
+2
-0
MobileBenefitPackageMapper.java
...mily/doctor/server/mapper/MobileBenefitPackageMapper.java
+4
-0
RabbitConsumer.java
...aiyihui/family/doctor/server/rabbitmq/RabbitConsumer.java
+1
-1
RabbitProduct.java
...baiyihui/family/doctor/server/rabbitmq/RabbitProduct.java
+7
-1
PatientSignService.java
...ihui/family/doctor/server/service/PatientSignService.java
+4
-0
PatientServiceImpl.java
...family/doctor/server/service/impl/PatientServiceImpl.java
+43
-2
PatientSignServiceImpl.java
...ly/doctor/server/service/impl/PatientSignServiceImpl.java
+17
-0
ScheduleTask.java
...com/ebaiyihui/family/doctor/server/task/ScheduleTask.java
+137
-101
OrderTaskVo.java
...va/com/ebaiyihui/family/doctor/server/vo/OrderTaskVo.java
+2
-0
MobileBenefitPackageMapper.xml
.../src/main/resources/mapper/MobileBenefitPackageMapper.xml
+15
-0
没有找到文件。
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/entity/MobileBenefitPackageEntity.java
浏览文件 @
a190e6ee
...
@@ -61,4 +61,6 @@ public class MobileBenefitPackageEntity {
...
@@ -61,4 +61,6 @@ public class MobileBenefitPackageEntity {
@ApiModelProperty
(
value
=
"医生id"
)
@ApiModelProperty
(
value
=
"医生id"
)
private
String
doctorId
;
private
String
doctorId
;
private
Integer
version
;
}
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/mapper/MobileBenefitPackageMapper.java
浏览文件 @
a190e6ee
...
@@ -27,5 +27,9 @@ public interface MobileBenefitPackageMapper {
...
@@ -27,5 +27,9 @@ public interface MobileBenefitPackageMapper {
void
updateDoctorId
(
MobileBenefitPackageEntity
entity
);
void
updateDoctorId
(
MobileBenefitPackageEntity
entity
);
void
updateVersion
(
MobileBenefitPackageEntity
entity
);
List
<
String
>
getPatientIdsByPhoneAndOrderId
(
@Param
(
"phone"
)
String
phone
);
List
<
String
>
getPatientIdsByPhoneAndOrderId
(
@Param
(
"phone"
)
String
phone
);
List
<
MobileBenefitPackageEntity
>
queryMaxOneList
();
}
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/rabbitmq/RabbitConsumer.java
浏览文件 @
a190e6ee
...
@@ -39,7 +39,7 @@ public class RabbitConsumer {
...
@@ -39,7 +39,7 @@ public class RabbitConsumer {
// 存在进行中订单则将订单状态改为失效
// 存在进行中订单则将订单状态改为失效
if
(
StatusEnum
.
IN_CONSULTATION
.
getValue
().
equals
(
patientSignEntity
.
getStatus
()))
{
if
(
StatusEnum
.
IN_CONSULTATION
.
getValue
().
equals
(
patientSignEntity
.
getStatus
()))
{
patientSignEntity
.
setStatus
(
StatusEnum
.
EXPIRED
.
getValue
());
patientSignEntity
.
setStatus
(
StatusEnum
.
FINISH_APPLY
.
getValue
());
patientSignMapper
.
updateById
(
patientSignEntity
);
patientSignMapper
.
updateById
(
patientSignEntity
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/rabbitmq/RabbitProduct.java
浏览文件 @
a190e6ee
...
@@ -8,6 +8,8 @@ import org.springframework.amqp.core.MessageDeliveryMode;
...
@@ -8,6 +8,8 @@ import org.springframework.amqp.core.MessageDeliveryMode;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Objects
;
/**
/**
* @ClassName: RabbitProduct
* @ClassName: RabbitProduct
* @Author:yanliang
* @Author:yanliang
...
@@ -31,10 +33,14 @@ public class RabbitProduct {
...
@@ -31,10 +33,14 @@ public class RabbitProduct {
if
(
orderTaskVo
.
getType
()
==
1
)
{
if
(
orderTaskVo
.
getType
()
==
1
)
{
long
time
=
EXPIRE_TIME_MAX
;
long
time
=
EXPIRE_TIME_MAX
;
if
(
Objects
.
nonNull
(
orderTaskVo
.
getExpireTime
()))
{
time
=
Long
.
valueOf
(
orderTaskVo
.
getExpireTime
());
}
log
.
info
(
"过期时间:{}"
,
time
);
log
.
info
(
"过期时间:{}"
,
time
);
long
finalTime
=
time
;
this
.
rabbitTemplate
.
convertAndSend
(
RabbitMqConfig
.
ORDER_DELAY_EXCHANGE
,
this
.
rabbitTemplate
.
convertAndSend
(
RabbitMqConfig
.
ORDER_DELAY_EXCHANGE
,
RabbitMqConfig
.
ORDER_ROUTING_KEY_5
,
orderTaskVo
,
message
->
{
RabbitMqConfig
.
ORDER_ROUTING_KEY_5
,
orderTaskVo
,
message
->
{
message
.
getMessageProperties
().
setHeader
(
"x-delay"
,
t
ime
);
message
.
getMessageProperties
().
setHeader
(
"x-delay"
,
finalT
ime
);
message
.
getMessageProperties
().
setDeliveryMode
(
MessageDeliveryMode
.
PERSISTENT
);
message
.
getMessageProperties
().
setDeliveryMode
(
MessageDeliveryMode
.
PERSISTENT
);
return
message
;
return
message
;
});
});
...
...
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/PatientSignService.java
浏览文件 @
a190e6ee
...
@@ -46,4 +46,8 @@ public interface PatientSignService {
...
@@ -46,4 +46,8 @@ public interface PatientSignService {
BaseResponse
<
IMQueryUserLoginRspVO
>
querySdkLogin
(
IMQueryUserLoginReqVO
reqVO
);
BaseResponse
<
IMQueryUserLoginRspVO
>
querySdkLogin
(
IMQueryUserLoginReqVO
reqVO
);
List
<
PatientSignEntity
>
selectList
(
PatientSignEntity
patientSignEntity
);
List
<
PatientSignEntity
>
selectList
(
PatientSignEntity
patientSignEntity
);
PatientSignEntity
getOneByPhone
(
String
phone
);
int
updateById
(
PatientSignEntity
patientSignEntity
);
}
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/PatientServiceImpl.java
浏览文件 @
a190e6ee
...
@@ -27,8 +27,10 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -27,8 +27,10 @@ import lombok.extern.slf4j.Slf4j;
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.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
/**
/**
...
@@ -74,11 +76,45 @@ public class PatientServiceImpl implements PatientService {
...
@@ -74,11 +76,45 @@ public class PatientServiceImpl implements PatientService {
String
admId
=
UUIDUtil
.
getUUID
();
String
admId
=
UUIDUtil
.
getUUID
();
Date
curDate
=
new
Date
();
Date
curDate
=
new
Date
();
Date
signEndTime
=
DateUtils
.
getAfterDay
(
curDate
,
CommonConstants
.
DAY
);
Date
signEndTime
=
DateUtils
.
getAfterDay
(
curDate
,
CommonConstants
.
DAY
);
Date
signStartTime
=
new
Date
();
try
{
if
(!
StringUtils
.
isEmpty
(
entity
.
getBenefitsEndTime
()))
{
signEndTime
=
DateUtils
.
parseDate
(
entity
.
getBenefitsEndTime
(),
DateUtils
.
FULL_FORMAT
);
signStartTime
=
DateUtils
.
parseDate
(
entity
.
getBenefitsStartTime
(),
DateUtils
.
FULL_FORMAT
);
}
}
catch
(
Exception
e
)
{
return
BaseResponse
.
error
(
"没有查询到有关权益"
);
}
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
.
setStatus
(
StatusEnum
.
IN_CONSULTATION
.
getValue
());
psWrapper
.
setEntity
(
patientSign
);
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignMapper
.
selectList
(
psWrapper
);
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
());
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
()))
{
if
(
Objects
.
nonNull
(
reqVo
.
getAdmId
()))
{
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
patientSign
.
setAdmId
(
admId
);
patientSign
.
setAdmId
(
reqVo
.
getAdmId
()
);
psWrapper
.
setEntity
(
patientSign
);
psWrapper
.
setEntity
(
patientSign
);
PatientSignEntity
patientSignEntity
=
patientSignMapper
.
selectOne
(
psWrapper
);
PatientSignEntity
patientSignEntity
=
patientSignMapper
.
selectOne
(
psWrapper
);
if
(
Objects
.
nonNull
(
patientSignEntity
))
{
if
(
Objects
.
nonNull
(
patientSignEntity
))
{
...
@@ -155,11 +191,16 @@ public class PatientServiceImpl implements PatientService {
...
@@ -155,11 +191,16 @@ public class PatientServiceImpl implements PatientService {
throw
new
BusinessException
(
"未查询到签约信息,不能获取排班医生!"
);
throw
new
BusinessException
(
"未查询到签约信息,不能获取排班医生!"
);
}
}
sendImMsgDTO
.
setOldAdmId
(
pse
.
getAdmId
());
sendImMsgDTO
.
setOldAdmId
(
pse
.
getAdmId
());
}
//放入MQ任务,处理订单到时结束
//放入MQ任务,处理订单到时结束
if
(
"0"
.
equals
(
entity
.
getIsRenew
())
||
SignStatus
.
NORMAL
.
getValue
().
equals
(
reqVo
.
getSignStatus
()))
{
OrderTaskVo
orderTaskVo
=
new
OrderTaskVo
();
OrderTaskVo
orderTaskVo
=
new
OrderTaskVo
();
orderTaskVo
.
setType
(
1
);
orderTaskVo
.
setType
(
1
);
orderTaskVo
.
setId
(
String
.
valueOf
(
patientSignEntity
.
getId
()));
orderTaskVo
.
setId
(
String
.
valueOf
(
patientSignEntity
.
getId
()));
if
(
"0"
.
equals
(
entity
.
getIsRenew
()))
{
orderTaskVo
.
setExpireTime
(
DateUtils
.
secondBetween
(
signStartTime
,
signEndTime
));
}
rabbitProduct
.
sendDelay
(
orderTaskVo
);
rabbitProduct
.
sendDelay
(
orderTaskVo
);
}
}
...
...
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/PatientSignServiceImpl.java
浏览文件 @
a190e6ee
...
@@ -292,6 +292,23 @@ public class PatientSignServiceImpl implements PatientSignService {
...
@@ -292,6 +292,23 @@ public class PatientSignServiceImpl implements PatientSignService {
return
patientSignEntities
;
return
patientSignEntities
;
}
}
@Override
public
PatientSignEntity
getOneByPhone
(
String
phone
)
{
QueryWrapper
<
PatientSignEntity
>
psWrapper
=
new
QueryWrapper
<>();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
patientSign
.
setPatientPhone
(
phone
);
psWrapper
.
setEntity
(
patientSign
);
psWrapper
.
orderByDesc
(
"createTime"
);
psWrapper
.
last
(
"limit 1"
);
PatientSignEntity
pse
=
patientSignMapper
.
selectOne
(
psWrapper
);
return
pse
;
}
@Override
public
int
updateById
(
PatientSignEntity
patientSignEntity
)
{
return
patientSignMapper
.
updateById
(
patientSignEntity
);
}
public
ImAccountVo
getImAccounts
(
PatientSignEntity
patientSignEntity
,
String
admId
,
String
imAppCode
,
String
doctorId
)
{
public
ImAccountVo
getImAccounts
(
PatientSignEntity
patientSignEntity
,
String
admId
,
String
imAppCode
,
String
doctorId
)
{
ImAccountVo
admission
=
new
ImAccountVo
();
ImAccountVo
admission
=
new
ImAccountVo
();
...
...
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/task/ScheduleTask.java
浏览文件 @
a190e6ee
差异被折叠。
点击展开。
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/vo/OrderTaskVo.java
浏览文件 @
a190e6ee
...
@@ -18,4 +18,6 @@ public class OrderTaskVo implements Serializable {
...
@@ -18,4 +18,6 @@ public class OrderTaskVo implements Serializable {
private
String
id
;
private
String
id
;
private
Integer
type
;
private
Integer
type
;
private
Integer
expireTime
;
}
}
family-doctor-server/src/main/resources/mapper/MobileBenefitPackageMapper.xml
浏览文件 @
a190e6ee
...
@@ -46,6 +46,12 @@
...
@@ -46,6 +46,12 @@
where phone = #{phone,jdbcType=VARCHAR} and orderId = #{orderId}
where phone = #{phone,jdbcType=VARCHAR} and orderId = #{orderId}
</update>
</update>
<update
id=
"updateVersion"
>
update mobile_benefit_package set
version = #{version,jdbcType=TINYINT}
where phone = #{phone,jdbcType=VARCHAR} and orderId = #{orderId}
</update>
<select
id=
"queryByPhone"
resultType=
"com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity"
>
<select
id=
"queryByPhone"
resultType=
"com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity"
>
SELECT
SELECT
<include
refid=
"base_columns"
/>
<include
refid=
"base_columns"
/>
...
@@ -53,6 +59,7 @@
...
@@ -53,6 +59,7 @@
mobile_benefit_package
mobile_benefit_package
WHERE
WHERE
phone = #{mobile} and orderId = #{activateOrderId}
phone = #{mobile} and orderId = #{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
ORDER BY
x_create_time DESC
x_create_time DESC
LIMIT 0,1
LIMIT 0,1
...
@@ -78,4 +85,12 @@
...
@@ -78,4 +85,12 @@
WHERE
WHERE
mbp.phone = #{phone}
mbp.phone = #{phone}
</select>
</select>
<select
id=
"queryMaxOneList"
resultType=
"com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity"
>
SELECT t.x_id,t.productId,t.phone,t.userId,t.orderId,t.timeLimit,t.used, t.benefitOrderId, t.benefitsStartTime, t.benefitsEndTime, t.isRenew
FROM mobile_benefit_package t
LEFT JOIN mobile_benefit_package t2
ON t.phone = t2.phone AND t.x_create_time
<
t2.x_create_time
WHERE t2.phone IS NULL and t.isRenew = 1 and t.version = 0;
</select>
</mapper>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论