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
...
@@ -7,7 +7,10 @@ import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO;
...
@@ -7,7 +7,10 @@ import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO;
import
com.ebaiyihui.family.doctor.server.common.constants.CommonConstants
;
import
com.ebaiyihui.family.doctor.server.common.constants.CommonConstants
;
import
com.ebaiyihui.family.doctor.server.common.constants.ImConstants
;
import
com.ebaiyihui.family.doctor.server.common.constants.ImConstants
;
import
com.ebaiyihui.family.doctor.server.common.enums.MsgTempTypeEnum
;
import
com.ebaiyihui.family.doctor.server.common.enums.MsgTempTypeEnum
;
import
com.ebaiyihui.family.doctor.server.common.enums.StatusEnum
;
import
com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity
;
import
com.ebaiyihui.family.doctor.server.entity.PatientSignEntity
;
import
com.ebaiyihui.family.doctor.server.entity.PatientSignEntity
;
import
com.ebaiyihui.family.doctor.server.mapper.MobileBenefitPackageMapper
;
import
com.ebaiyihui.family.doctor.server.service.ImMsgTemplateService
;
import
com.ebaiyihui.family.doctor.server.service.ImMsgTemplateService
;
import
com.ebaiyihui.family.doctor.server.service.PatientSignService
;
import
com.ebaiyihui.family.doctor.server.service.PatientSignService
;
import
com.ebaiyihui.family.doctor.server.util.DateUtils
;
import
com.ebaiyihui.family.doctor.server.util.DateUtils
;
...
@@ -19,7 +22,6 @@ import com.ebaiyihui.imforward.client.vo.IMQueryUserLoginRspVO;
...
@@ -19,7 +22,6 @@ import com.ebaiyihui.imforward.client.vo.IMQueryUserLoginRspVO;
import
com.ebaiyihui.imforward.client.vo.IMSingleMsgResultVO
;
import
com.ebaiyihui.imforward.client.vo.IMSingleMsgResultVO
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -42,128 +44,162 @@ public class ScheduleTask {
...
@@ -42,128 +44,162 @@ public class ScheduleTask {
@Autowired
@Autowired
private
PatientSignService
patientSignSevice
;
private
PatientSignService
patientSignSevice
;
@Autowired
private
MobileBenefitPackageMapper
mobileBenefitPackageMapper
;
@Autowired
@Autowired
private
ThirdOrderPushUtil
thirdOrderPushUtil
;
private
ThirdOrderPushUtil
thirdOrderPushUtil
;
@Scheduled
(
cron
=
"0 0 10 * * ?"
)
//
@Scheduled(cron = "0 0 10 * * ?")
public
void
healthRecordWhetherUpdate
()
{
public
void
healthRecordWhetherUpdate
()
{
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignSevice
.
selectList
(
new
PatientSignEntity
());
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignSevice
.
selectList
(
new
PatientSignEntity
());
for
(
PatientSignEntity
ps
:
patientSignEntities
)
{
if
(!
patientSignEntities
.
isEmpty
())
{
HealthInfoDTO
healthInfoDTO
=
new
HealthInfoDTO
();
for
(
PatientSignEntity
ps
:
patientSignEntities
)
{
healthInfoDTO
.
setPhone
(
ps
.
getPatientPhone
());
HealthInfoDTO
healthInfoDTO
=
new
HealthInfoDTO
();
// 查询用户健康档案30天内是否有更新
healthInfoDTO
.
setPhone
(
ps
.
getPatientPhone
());
String
result
=
thirdOrderPushUtil
.
getHealthRecordWhetherUpdate
(
healthInfoDTO
);
// 查询用户健康档案30天内是否有更新
Result
<
Boolean
>
res
=
JSONObject
.
parseObject
(
result
,
Result
.
class
);
String
result
=
thirdOrderPushUtil
.
getHealthRecordWhetherUpdate
(
healthInfoDTO
);
Boolean
flag
=
res
.
getData
();
Result
<
Boolean
>
res
=
JSONObject
.
parseObject
(
result
,
Result
.
class
);
SendImMsgDTO
sendImMsgDTO
=
new
SendImMsgDTO
();
Boolean
flag
=
res
.
getData
();
sendImMsgDTO
.
setAppCode
(
CommonConstants
.
APP_CODE
);
SendImMsgDTO
sendImMsgDTO
=
new
SendImMsgDTO
();
sendImMsgDTO
.
setOrganId
(
CommonConstants
.
ORGAN_CODE
);
sendImMsgDTO
.
setAppCode
(
CommonConstants
.
APP_CODE
);
sendImMsgDTO
.
setAdmId
(
ps
.
getAdmId
());
sendImMsgDTO
.
setOrganId
(
CommonConstants
.
ORGAN_CODE
);
if
(!
flag
)
{
sendImMsgDTO
.
setAdmId
(
ps
.
getAdmId
());
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_PUSH_HEAL_REC
.
getValue
());
if
(!
flag
)
{
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_PUSH_HEAL_REC
.
getValue
());
}
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
// 1、签约完成定时任务第10天,主动触发 2、定时任务之后每隔15天,主动触发
}
Date
curDate
=
new
Date
();
// 1、签约完成定时任务第10天,主动触发 2、定时任务之后每隔15天,主动触发
int
difDay
=
DateUtils
.
daysBetween
(
ps
.
getCreateTime
(),
curDate
);
Date
curDate
=
new
Date
();
int
afterFifteenDay
=
DateUtils
.
daysBetween
(
ps
.
getCreateTime
(),
curDate
);
int
difDay
=
DateUtils
.
daysBetween
(
ps
.
getCreateTime
(),
curDate
);
if
(
10
==
difDay
||
afterFifteenDay
%
15
==
0
)
{
int
afterFifteenDay
=
DateUtils
.
daysBetween
(
ps
.
getCreateTime
(),
curDate
);
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT__SIG_SUC
.
getValue
());
if
(
10
==
difDay
||
afterFifteenDay
%
15
==
0
)
{
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT__SIG_SUC
.
getValue
());
}
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
// 1、当用户有触发过‘报告异常’问诊 2、定时任务触发20天后主动触发
}
if
(
20
==
difDay
)
{
// 1、当用户有触发过‘报告异常’问诊 2、定时任务触发20天后主动触发
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_REP_ANO
.
getValue
());
if
(
20
==
difDay
)
{
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_REP_ANO
.
getValue
());
}
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
// 1、当用户与医生7天未进行沟通 2、判断后主动触发
}
// {"appCode":"EHOS_PATIENT","appointmentId":["9ad0b140bd1b4b86b1aa68f59c9dbf9a"],"businessCode":"jtys","msgType":"1","page":0,"pageSize":999,"sortOrder":"ASC","userId":"18170905967"}
// 1、当用户与医生7天未进行沟通 2、判断后主动触发
IMQueryMsgReqVO
imQueryMsgReqVO
=
new
IMQueryMsgReqVO
();
// {"appCode":"EHOS_PATIENT","appointmentId":["9ad0b140bd1b4b86b1aa68f59c9dbf9a"],"businessCode":"jtys","msgType":"1","page":0,"pageSize":999,"sortOrder":"ASC","userId":"18170905967"}
imQueryMsgReqVO
.
setAppCode
(
ImConstants
.
IM_PAT_ACCOUNT_NUM
);
IMQueryMsgReqVO
imQueryMsgReqVO
=
new
IMQueryMsgReqVO
();
imQueryMsgReqVO
.
setBusinessCode
(
ImConstants
.
IM_QUERY_ACCOUNT_CODE
);
imQueryMsgReqVO
.
setAppCode
(
ImConstants
.
IM_PAT_ACCOUNT_NUM
);
imQueryMsgReqVO
.
setMsgType
(
"1"
);
imQueryMsgReqVO
.
setBusinessCode
(
ImConstants
.
IM_QUERY_ACCOUNT_CODE
);
imQueryMsgReqVO
.
setPageSize
(
10
);
imQueryMsgReqVO
.
setMsgType
(
"1"
);
imQueryMsgReqVO
.
setSortOrder
(
"DESC"
);
imQueryMsgReqVO
.
setPageSize
(
10
);
List
<
String
>
appointmentIds
=
new
ArrayList
<>();
imQueryMsgReqVO
.
setSortOrder
(
"DESC"
);
appointmentIds
.
add
(
ps
.
getAdmId
());
List
<
String
>
appointmentIds
=
new
ArrayList
<>();
imQueryMsgReqVO
.
setAppointmentId
(
appointmentIds
);
appointmentIds
.
add
(
ps
.
getAdmId
());
imQueryMsgReqVO
.
setUserId
(
ps
.
getPatientUserId
());
imQueryMsgReqVO
.
setAppointmentId
(
appointmentIds
);
String
sendTimeStr
=
"2023-12-01 00:00:00"
;
imQueryMsgReqVO
.
setUserId
(
ps
.
getPatientUserId
());
try
{
String
sendTimeStr
=
"2023-12-01 00:00:00"
;
BaseResponse
<
List
<
IMSingleMsgResultVO
>>
msgContent
=
patientSignSevice
.
getAllMsgContent
(
imQueryMsgReqVO
);
try
{
if
(
"1"
.
equals
(
msgContent
.
getCode
()))
{
BaseResponse
<
List
<
IMSingleMsgResultVO
>>
msgContent
=
patientSignSevice
.
getAllMsgContent
(
imQueryMsgReqVO
);
List
<
IMSingleMsgResultVO
>
imSingleMsgResultVOS
=
msgContent
.
getData
();
if
(
"1"
.
equals
(
msgContent
.
getCode
()))
{
IMQueryUserLoginReqVO
imQueryUserLoginReqVO
=
new
IMQueryUserLoginReqVO
();
List
<
IMSingleMsgResultVO
>
imSingleMsgResultVOS
=
msgContent
.
getData
();
imQueryUserLoginReqVO
.
setAppCode
(
ImConstants
.
IM_PAT_ACCOUNT_NUM
);
IMQueryUserLoginReqVO
imQueryUserLoginReqVO
=
new
IMQueryUserLoginReqVO
();
imQueryUserLoginReqVO
.
setUserId
(
ps
.
getPatientUserId
());
imQueryUserLoginReqVO
.
setAppCode
(
ImConstants
.
IM_PAT_ACCOUNT_NUM
);
BaseResponse
<
IMQueryUserLoginRspVO
>
sdkLogin
=
patientSignSevice
.
querySdkLogin
(
imQueryUserLoginReqVO
);
imQueryUserLoginReqVO
.
setUserId
(
ps
.
getPatientUserId
());
if
(
"1"
.
equals
(
sdkLogin
.
getCode
()))
{
BaseResponse
<
IMQueryUserLoginRspVO
>
sdkLogin
=
patientSignSevice
.
querySdkLogin
(
imQueryUserLoginReqVO
);
IMQueryUserLoginRspVO
imQueryUserLoginRspVO
=
sdkLogin
.
getData
();
if
(
"1"
.
equals
(
sdkLogin
.
getCode
()))
{
String
sdkAccount
=
imQueryUserLoginRspVO
.
getSdkAccount
();
IMQueryUserLoginRspVO
imQueryUserLoginRspVO
=
sdkLogin
.
getData
();
for
(
IMSingleMsgResultVO
imSingleMsgResultVO
:
imSingleMsgResultVOS
)
{
String
sdkAccount
=
imQueryUserLoginRspVO
.
getSdkAccount
();
if
(
imSingleMsgResultVO
.
getSender
().
equals
(
sdkAccount
))
{
for
(
IMSingleMsgResultVO
imSingleMsgResultVO
:
imSingleMsgResultVOS
)
{
sendTimeStr
=
imSingleMsgResultVO
.
getSendTime
();
if
(
imSingleMsgResultVO
.
getSender
().
equals
(
sdkAccount
))
{
break
;
sendTimeStr
=
imSingleMsgResultVO
.
getSendTime
();
break
;
}
}
}
}
}
Date
sendTime
=
DateUtils
.
parseDate
(
sendTimeStr
,
DateUtils
.
FULL_FORMAT
);
int
difSendDay
=
DateUtils
.
daysBetween
(
sendTime
,
curDate
);
if
(
7
==
difSendDay
)
{
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_UN_CON
.
getValue
());
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
}
}
}
Date
sendTime
=
DateUtils
.
parseDate
(
sendTimeStr
,
DateUtils
.
FULL_FORMAT
);
}
catch
(
Exception
e
)
{
int
difSendDay
=
DateUtils
.
daysBetween
(
sendTime
,
curDate
);
log
.
error
(
"获取发送消息异常"
,
e
);
if
(
7
==
difSendDay
)
{
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_UN_CON
.
getValue
());
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
}
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"获取发送消息异常"
,
e
);
}
}
}
}
}
}
@Scheduled
(
cron
=
"0 0 20 * * ?"
)
//
@Scheduled(cron = "0 0 20 * * ?")
public
void
holidayPush
()
{
public
void
holidayPush
()
{
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignSevice
.
selectList
(
new
PatientSignEntity
());
List
<
PatientSignEntity
>
patientSignEntities
=
patientSignSevice
.
selectList
(
new
PatientSignEntity
());
for
(
PatientSignEntity
ps
:
patientSignEntities
)
{
try
{
try
{
if
(!
patientSignEntities
.
isEmpty
())
{
SendImMsgDTO
sendImMsgDTO
=
new
SendImMsgDTO
();
for
(
PatientSignEntity
ps
:
patientSignEntities
)
{
sendImMsgDTO
.
setAppCode
(
CommonConstants
.
APP_CODE
);
sendImMsgDTO
.
setOrganId
(
CommonConstants
.
ORGAN_CODE
);
sendImMsgDTO
.
setAdmId
(
ps
.
getAdmId
());
Date
curDate
=
new
Date
();
Date
qmBeforeDay
=
DateUtils
.
getQingMingBeforeDay
(
curDate
);
Date
curDay
=
DateUtils
.
parseDate
(
DateUtils
.
getFormatDateString
(
curDate
,
DateUtils
.
SIMPLE_FORMAT
),
DateUtils
.
SIMPLE_FORMAT
);
if
(
qmBeforeDay
.
equals
(
curDay
))
{
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_TSD
.
getValue
());
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
}
Date
laborBeforeDay
=
DateUtils
.
getLaborBeforeDay
(
curDate
);
SendImMsgDTO
sendImMsgDTO
=
new
SendImMsgDTO
();
if
(
laborBeforeDay
.
equals
(
curDay
))
{
sendImMsgDTO
.
setAppCode
(
CommonConstants
.
APP_CODE
);
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_LD
.
getValue
());
sendImMsgDTO
.
setOrganId
(
CommonConstants
.
ORGAN_CODE
);
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
sendImMsgDTO
.
setAdmId
(
ps
.
getAdmId
());
}
Date
curDate
=
new
Date
();
Date
qmBeforeDay
=
DateUtils
.
getQingMingBeforeDay
(
curDate
);
Date
curDay
=
DateUtils
.
parseDate
(
DateUtils
.
getFormatDateString
(
curDate
,
DateUtils
.
SIMPLE_FORMAT
),
DateUtils
.
SIMPLE_FORMAT
);
if
(
qmBeforeDay
.
equals
(
curDay
))
{
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_TSD
.
getValue
());
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
}
Date
duanWu
BeforeDay
=
DateUtils
.
getLaborBeforeDay
(
curDate
);
Date
labor
BeforeDay
=
DateUtils
.
getLaborBeforeDay
(
curDate
);
if
(
duanWu
BeforeDay
.
equals
(
curDay
))
{
if
(
labor
BeforeDay
.
equals
(
curDay
))
{
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_TDBF
.
getValue
());
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_LD
.
getValue
());
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
}
}
Date
zhongQiuBeforeDay
=
DateUtils
.
getZhongQiu
BeforeDay
(
curDate
);
Date
duanWuBeforeDay
=
DateUtils
.
getLabor
BeforeDay
(
curDate
);
if
(
zhongQi
uBeforeDay
.
equals
(
curDay
))
{
if
(
duanW
uBeforeDay
.
equals
(
curDay
))
{
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_MA
F
.
getValue
());
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_TDB
F
.
getValue
());
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
}
}
Date
guoQingBeforeDay
=
DateUtils
.
getGuoQingBeforeDay
(
curDate
);
Date
zhongQiuBeforeDay
=
DateUtils
.
getZhongQiuBeforeDay
(
curDate
);
if
(
guoQingBeforeDay
.
equals
(
curDay
))
{
if
(
zhongQiuBeforeDay
.
equals
(
curDay
))
{
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_MAF
.
getValue
());
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_MAF
.
getValue
());
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
}
Date
guoQingBeforeDay
=
DateUtils
.
getGuoQingBeforeDay
(
curDate
);
if
(
guoQingBeforeDay
.
equals
(
curDay
))
{
sendImMsgDTO
.
setType
(
MsgTempTypeEnum
.
ACT_FU_MAF
.
getValue
());
imMsgTemplateService
.
sendImMsg
(
sendImMsgDTO
);
}
}
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"节日日期转换异常"
,
e
);
}
}
}
catch
(
Exception
e
)
{
// @Scheduled(cron = "0 0 1 * * ?")
log
.
error
(
"节日日期转换异常"
,
e
);
public
void
orderInvalidation
()
{
List
<
MobileBenefitPackageEntity
>
mobileBenefitPackageEntities
=
mobileBenefitPackageMapper
.
queryMaxOneList
();
try
{
if
(!
mobileBenefitPackageEntities
.
isEmpty
())
{
for
(
MobileBenefitPackageEntity
mbp
:
mobileBenefitPackageEntities
)
{
Date
curTime
=
new
Date
();
Date
endTime
=
DateUtils
.
parseDate
(
mbp
.
getBenefitsEndTime
(),
DateUtils
.
FULL_FORMAT
);
PatientSignEntity
patientSignEntity
=
patientSignSevice
.
getOneByPhone
(
mbp
.
getPhone
());
mbp
.
setVersion
(
1
);
if
(
endTime
.
after
(
curTime
))
{
patientSignEntity
.
setPackageOrderId
(
mbp
.
getActivateOrderId
());
patientSignEntity
.
setSignEndTime
(
endTime
);
}
else
{
patientSignEntity
.
setStatus
(
StatusEnum
.
FINISH_APPLY
.
getValue
());
}
patientSignSevice
.
updateById
(
patientSignEntity
);
mobileBenefitPackageMapper
.
updateVersion
(
mbp
);
}
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"日期转换异常"
,
e
);
}
}
}
}
}
}
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论