Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
B
byh-family-doctor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
包
包
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
杨凯
byh-family-doctor
Commits
6ada2bc1
提交
6ada2bc1
authored
3月 15, 2024
作者:
杨凯
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:家庭医生初始化
上级
e63756a8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
332 行增加
和
3 行删除
+332
-3
GoeasyPushMsgReqDTO.java
...aiyihui/family/doctor/common/dto/GoeasyPushMsgReqDTO.java
+23
-0
ProjProperties.java
...family/doctor/server/common/constants/ProjProperties.java
+23
-0
UrlConstants.java
...i/family/doctor/server/common/constants/UrlConstants.java
+13
-0
GoEasyPushService.java
...yihui/family/doctor/server/service/GoEasyPushService.java
+13
-0
GoEasyPushServiceImpl.java
...ily/doctor/server/service/impl/GoEasyPushServiceImpl.java
+126
-0
PatientSignServiceImpl.java
...ly/doctor/server/service/impl/PatientSignServiceImpl.java
+3
-2
UserRestTemplateUtil.java
...yihui/family/doctor/server/util/UserRestTemplateUtil.java
+125
-0
application-test.yml
family-doctor-server/src/main/resources/application-test.yml
+6
-1
没有找到文件。
family-doctor-common/src/main/java/com/ebaiyihui/family/doctor/common/dto/GoeasyPushMsgReqDTO.java
0 → 100644
浏览文件 @
6ada2bc1
package
com
.
ebaiyihui
.
family
.
doctor
.
common
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @ClassName: GoeasyPushMsgReqDTO
* @Author:yanliang
* @Date:2024/3/15 16:50
* @Description
*/
@Data
public
class
GoeasyPushMsgReqDTO
{
@ApiModelProperty
(
value
=
"通知的主体内容"
)
private
String
body
;
@ApiModelProperty
(
value
=
"业务编码"
)
private
String
busiCode
;
@ApiModelProperty
(
value
=
"用户ID"
)
private
String
userId
;
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/common/constants/ProjProperties.java
0 → 100644
浏览文件 @
6ada2bc1
package
com
.
ebaiyihui
.
family
.
doctor
.
server
.
common
.
constants
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
/**
* @ClassName: ProjProperties
* @Author:yanliang
* @Date:2024/3/15 16:45
* @Description
*/
@Data
@Component
@ConfigurationProperties
(
prefix
=
"projprops"
)
public
class
ProjProperties
{
private
String
userFindUserId
;
private
String
userInfo
;
private
String
baseAddress
;
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/common/constants/UrlConstants.java
0 → 100644
浏览文件 @
6ada2bc1
package
com
.
ebaiyihui
.
family
.
doctor
.
server
.
common
.
constants
;
/**
* @ClassName: UrlConstants
* @Author:yanliang
* @Date:2024/3/15 16:49
* @Description
*/
public
class
UrlConstants
{
public
static
final
String
GO_EASY_PUSH
=
"/cloud/push/goeasy/pushgoeasyuserid"
;
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/GoEasyPushService.java
0 → 100644
浏览文件 @
6ada2bc1
package
com
.
ebaiyihui
.
family
.
doctor
.
server
.
service
;
/**
* @ClassName: GoEasyPushService
* @Author:yanliang
* @Date:2024/3/15 16:29
* @Description
*/
public
interface
GoEasyPushService
{
void
newOrderToReceive
(
String
admId
);
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/GoEasyPushServiceImpl.java
0 → 100644
浏览文件 @
6ada2bc1
package
com
.
ebaiyihui
.
family
.
doctor
.
server
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.doctoruser.api.pojo.vo.*
;
import
com.ebaiyihui.family.doctor.common.dto.GoeasyPushMsgReqDTO
;
import
com.ebaiyihui.family.doctor.server.common.constants.IMInformConstants
;
import
com.ebaiyihui.family.doctor.server.common.constants.ProjProperties
;
import
com.ebaiyihui.family.doctor.server.common.constants.UrlConstants
;
import
com.ebaiyihui.family.doctor.server.common.enums.StatusEnum
;
import
com.ebaiyihui.family.doctor.server.entity.PatientSignEntity
;
import
com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper
;
import
com.ebaiyihui.family.doctor.server.service.GoEasyPushService
;
import
com.ebaiyihui.family.doctor.server.util.UserRestTemplateUtil
;
import
com.ebaiyihui.framework.utils.HttpKit
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
/**
* @ClassName: GoEasyPushServiceImpl
* @Author:yanliang
* @Date:2024/3/15 16:30
* @Description
*/
@Service
@Slf4j
public
class
GoEasyPushServiceImpl
implements
GoEasyPushService
{
@Autowired
private
ProjProperties
projProperties
;
@Autowired
private
PatientSignMapper
patientSignMapper
;
@Override
public
void
newOrderToReceive
(
String
admId
)
{
log
.
info
(
"医生web端推送开始:{}"
,
admId
);
QueryWrapper
<
PatientSignEntity
>
wrapper
=
new
QueryWrapper
<>();
PatientSignEntity
patientSign
=
new
PatientSignEntity
();
patientSign
.
setAdmId
(
admId
);
wrapper
.
setEntity
(
patientSign
);
PatientSignEntity
patientSignEntity
=
patientSignMapper
.
selectOne
(
wrapper
);
//是否订单
boolean
isOrder
=
Objects
.
equals
(
StatusEnum
.
IN_CONSULTATION
.
getValue
(),
patientSignEntity
.
getStatus
());
if
(
isOrder
)
{
UserInfoByUserIdRespVO
userInfoByUserIdRespVO
=
queryDocAccountInfo
(
String
.
valueOf
(
patientSignEntity
.
getDoctorId
()));
String
userId
=
userInfoByUserIdRespVO
.
getUserId
();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
patientSignEntity
.
getAdmId
());
map
.
put
(
"body"
,
"您有一笔新的家庭医生订单待处理,请及时查看"
);
map
.
put
(
"type"
,
"jtys_new_order"
);
map
.
put
(
"title"
,
"家庭医生订单提醒"
);
map
.
put
(
"subTitle"
,
"家庭医生订单提醒"
);
map
.
put
(
"pushCode"
,
"1"
);
goEasyPush
(
userId
,
JSON
.
toJSONString
(
map
),
IMInformConstants
.
IM_SYSTEM_BUSINESS_CODE
);
}
}
/**
* @param docId 医生ID
* @return 医生userId
*/
private
UserInfoByUserIdRespVO
queryDocAccountInfo
(
String
docId
)
{
// 查询医生userId
FindUserIdListReq
findUserIdListReq
=
new
FindUserIdListReq
();
FindUserIdReqVO
findUserIdReqVO
=
new
FindUserIdReqVO
();
findUserIdReqVO
.
setReqId
(
docId
);
findUserIdReqVO
.
setUserType
((
short
)
1
);
List
<
FindUserIdReqVO
>
findUserIdReqVOList
=
new
ArrayList
<>(
1
);
findUserIdReqVOList
.
add
(
findUserIdReqVO
);
findUserIdListReq
.
setFindUserIdReqVOS
(
findUserIdReqVOList
);
log
.
info
(
"findUserIdListReq:{}"
,
JSON
.
toJSONString
(
findUserIdListReq
));
//查询医生userId
List
<
com
.
doctoruser
.
api
.
pojo
.
vo
.
FindUserIdRespVO
>
findUserIdRespVOS
=
UserRestTemplateUtil
.
queryUserIdList
(
findUserIdListReq
,
projProperties
.
getUserFindUserId
());
log
.
info
(
"00001查询用户Id请求对象:{}"
,
JSON
.
toJSONString
(
findUserIdRespVOS
));
if
(
null
==
findUserIdRespVOS
)
{
return
null
;
}
FindUserIdRespVO
findUserIdRespVO
=
findUserIdRespVOS
.
get
(
0
);
log
.
info
(
"000========:{}"
,
JSON
.
toJSONString
(
findUserIdRespVO
));
// 查询医生账号信息
GetUserInfoByUserIdReqVO
getUserInfoByUserIdReqVO
=
new
GetUserInfoByUserIdReqVO
();
getUserInfoByUserIdReqVO
.
setUserId
(
findUserIdRespVO
.
getUserId
());
log
.
info
(
"0002获取用户基础资料请求对象入参:{}"
,
JSON
.
toJSONString
(
getUserInfoByUserIdReqVO
));
//获取用户基础资料
UserInfoByUserIdRespVO
userInfo
=
UserRestTemplateUtil
.
getUserInfo
(
getUserInfoByUserIdReqVO
,
projProperties
.
getUserInfo
());
log
.
info
(
"0002获取用户基础资料请求对象出参:{}"
,
JSON
.
toJSONString
(
userInfo
));
if
(
null
!=
userInfo
)
{
return
userInfo
;
}
return
null
;
}
public
void
goEasyPush
(
String
userId
,
String
text
,
String
busiCode
)
{
String
url
=
projProperties
.
getBaseAddress
()
+
UrlConstants
.
GO_EASY_PUSH
;
try
{
log
.
info
(
"goeasy推送url----------->{}"
,
url
);
GoeasyPushMsgReqDTO
vo
=
new
GoeasyPushMsgReqDTO
();
vo
.
setBusiCode
(
busiCode
);
vo
.
setBody
(
text
);
vo
.
setUserId
(
userId
);
log
.
info
(
"=======>goeasy推送参数----->{}"
,
JSON
.
toJSONString
(
vo
));
String
httpResult
=
HttpKit
.
jsonPost
(
url
,
JSON
.
toJSONString
(
vo
));
log
.
info
(
"=======>goeasy推送返回结果----->{}"
,
httpResult
);
}
catch
(
Exception
e
)
{
log
.
info
(
"=======>goeasy推送 - 获取异常"
,
e
);
}
}
}
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/service/impl/PatientSignServiceImpl.java
浏览文件 @
6ada2bc1
...
@@ -8,6 +8,7 @@ import com.doctoruser.api.pojo.base.vo.doctor.PersonnelInfo;
...
@@ -8,6 +8,7 @@ import com.doctoruser.api.pojo.base.vo.doctor.PersonnelInfo;
import
com.ebaiyihui.family.doctor.common.dto.ImInfoDetailDocReqDTO
;
import
com.ebaiyihui.family.doctor.common.dto.ImInfoDetailDocReqDTO
;
import
com.ebaiyihui.family.doctor.common.dto.ImInfoListDocReqDTO
;
import
com.ebaiyihui.family.doctor.common.dto.ImInfoListDocReqDTO
;
import
com.ebaiyihui.family.doctor.common.vo.*
;
import
com.ebaiyihui.family.doctor.common.vo.*
;
import
com.ebaiyihui.family.doctor.server.common.constants.IMInformConstants
;
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.StatusEnum
;
import
com.ebaiyihui.family.doctor.server.common.enums.StatusEnum
;
import
com.ebaiyihui.family.doctor.server.entity.PatientEntity
;
import
com.ebaiyihui.family.doctor.server.entity.PatientEntity
;
...
@@ -111,9 +112,9 @@ public class PatientSignServiceImpl implements PatientSignService {
...
@@ -111,9 +112,9 @@ public class PatientSignServiceImpl implements PatientSignService {
log
.
info
(
"获取IM登录信息:{}"
,
imSysResult
);
log
.
info
(
"获取IM登录信息:{}"
,
imSysResult
);
IMQueryMsgReqVO
imQueryMsgReqVO
=
new
IMQueryMsgReqVO
();
IMQueryMsgReqVO
imQueryMsgReqVO
=
new
IMQueryMsgReqVO
();
imQueryMsgReqVO
.
setAppCode
(
"EHOS_PATIENT"
);
imQueryMsgReqVO
.
setAppCode
(
IMInformConstants
.
PATIENT_APPLICATION_CODE
);
imQueryMsgReqVO
.
setUserId
(
patientSignEntity
.
getPatientUserId
());
imQueryMsgReqVO
.
setUserId
(
patientSignEntity
.
getPatientUserId
());
imQueryMsgReqVO
.
setBusinessCode
(
"zxzx"
);
imQueryMsgReqVO
.
setBusinessCode
(
IMInformConstants
.
IM_SYSTEM_BUSINESS_CODE
);
imQueryMsgReqVO
.
setMsgType
(
"1"
);
imQueryMsgReqVO
.
setMsgType
(
"1"
);
imQueryMsgReqVO
.
setPageSize
(
999
);
imQueryMsgReqVO
.
setPageSize
(
999
);
imQueryMsgReqVO
.
setSortOrder
(
"ASC"
);
imQueryMsgReqVO
.
setSortOrder
(
"ASC"
);
...
...
family-doctor-server/src/main/java/com/ebaiyihui/family/doctor/server/util/UserRestTemplateUtil.java
0 → 100644
浏览文件 @
6ada2bc1
package
com
.
ebaiyihui
.
family
.
doctor
.
server
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.doctoruser.api.pojo.dto.UcConfigurationDTO
;
import
com.doctoruser.api.pojo.vo.*
;
import
com.doctoruser.api.pojo.vo.account.DoctorIdReqVO
;
import
com.doctoruser.api.pojo.vo.account.DoctorInfoRespVO
;
import
com.ebaiyihui.framework.response.BaseResponse
;
import
com.ebaiyihui.framework.utils.HttpKit
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.List
;
/**
* @ClassName: UserRestTemplateUtil
* @Author:yanliang
* @Date:2024/3/15 16:51
* @Description
*/
@Slf4j
public
class
UserRestTemplateUtil
{
public
static
UserInfoByUserIdRespVO
getUserInfo
(
GetUserInfoByUserIdReqVO
getUserInfoByUserIdReqVO
,
String
url
)
{
log
.
info
(
"1用户调用"
+
JSON
.
toJSONString
(
getUserInfoByUserIdReqVO
));
BaseResponse
response
=
null
;
try
{
String
result
=
HttpKit
.
jsonPost
(
url
,
JSON
.
toJSONString
(
getUserInfoByUserIdReqVO
));
response
=
JSONObject
.
toJavaObject
(
JSONObject
.
parseObject
(
result
),
BaseResponse
.
class
);
log
.
info
(
"response:{}"
+
JSON
.
toJSONString
(
response
));
}
catch
(
Exception
e
)
{
log
.
error
(
"调用用户资料接口失败"
+
e
.
getMessage
());
}
log
.
info
(
"response :{}"
,
JSON
.
toJSONString
(
response
));
if
(
"-1"
.
equals
(
response
.
getErrCode
()))
{
log
.
info
(
"=================用户调用失败================"
);
return
null
;
}
UserInfoByUserIdRespVO
userInfoByUserIdRespVO
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
response
.
getData
()),
UserInfoByUserIdRespVO
.
class
);
return
userInfoByUserIdRespVO
;
}
/**
* @param findUserIdListReq
*/
public
static
List
<
FindUserIdRespVO
>
queryUserIdList
(
FindUserIdListReq
findUserIdListReq
,
String
url
)
{
log
.
info
(
"2用户调用"
+
JSON
.
toJSONString
(
findUserIdListReq
));
BaseResponse
response
=
null
;
try
{
String
result
=
HttpKit
.
jsonPost
(
url
,
JSON
.
toJSONString
(
findUserIdListReq
));
response
=
JSONObject
.
toJavaObject
(
JSONObject
.
parseObject
(
result
),
BaseResponse
.
class
);
log
.
info
(
"response:{}"
+
JSON
.
toJSONString
(
response
));
}
catch
(
Exception
e
)
{
log
.
error
(
"调用批量查询用户id接口失败"
+
e
.
getMessage
());
}
log
.
info
(
"response :{}"
,
JSON
.
toJSONString
(
response
));
if
(
"-1"
.
equals
(
response
.
getErrCode
()))
{
log
.
info
(
"=================用户调用失败================"
);
return
null
;
}
Object
data
=
response
.
getData
();
List
<
FindUserIdRespVO
>
userIdResplist
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
data
),
new
TypeReference
<
List
<
FindUserIdRespVO
>>()
{
});
log
.
info
(
"userIdResplist:{}"
+
userIdResplist
.
toString
());
return
userIdResplist
;
}
/**
* @param doctorIdReqVO
*/
public
static
DoctorInfoRespVO
queryDoctorByDoctorId
(
DoctorIdReqVO
doctorIdReqVO
,
String
url
)
{
log
.
info
(
"3用户调用"
+
JSON
.
toJSONString
(
doctorIdReqVO
));
HttpHeaders
headers
=
new
HttpHeaders
();
//定义请求参数类型,这里用json所以是MediaType.APPLICATION_JSON
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
HttpEntity
<
DoctorIdReqVO
>
request
=
new
HttpEntity
<>(
doctorIdReqVO
,
headers
);
RestTemplate
restTemplate
=
new
RestTemplate
();
log
.
info
(
"url :{}"
,
JSON
.
toJSONString
(
url
));
log
.
info
(
"request :{}"
,
JSON
.
toJSONString
(
request
));
BaseResponse
response
=
restTemplate
.
postForObject
(
url
,
request
,
BaseResponse
.
class
);
log
.
info
(
"response :{}"
,
JSON
.
toJSONString
(
response
));
if
(
"-1"
.
equals
(
response
.
getErrCode
()))
{
log
.
info
(
"=================用户调用失败================"
);
return
null
;
}
DoctorInfoRespVO
doctorInfoResp
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
response
.
getData
()),
DoctorInfoRespVO
.
class
);
return
doctorInfoResp
;
}
/**
* 获取 配置详情
*
* @param appCode
* @return
*/
public
static
String
getConfigurationDetail
(
String
appCode
,
String
type
,
String
url
)
{
UcConfigurationDTO
ucConfigurationDTO
=
new
UcConfigurationDTO
();
ucConfigurationDTO
.
setType
(
type
);
ucConfigurationDTO
.
setAppCode
(
appCode
);
BaseResponse
response
=
null
;
try
{
String
result
=
HttpKit
.
jsonPost
(
url
,
JSON
.
toJSONString
(
ucConfigurationDTO
));
response
=
JSONObject
.
toJavaObject
(
JSONObject
.
parseObject
(
result
),
BaseResponse
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用推送接口失败"
+
e
.
getMessage
());
}
log
.
info
(
"获取配置详情 返回:{}"
,
JSON
.
toJSONString
(
response
));
UcConfigurationVO
ucConfigurationVO
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
response
.
getData
()),
UcConfigurationVO
.
class
);
log
.
info
(
"获取配置详情看json解析: {}"
,
JSON
.
toJSONString
(
ucConfigurationVO
));
return
ucConfigurationVO
.
getClientCode
();
}
}
family-doctor-server/src/main/resources/application-test.yml
浏览文件 @
6ada2bc1
...
@@ -63,4 +63,9 @@ swagger:
...
@@ -63,4 +63,9 @@ swagger:
enabled
:
true
enabled
:
true
cloudDoctorUrl
:
https://testapi.chinachdu.com/cloud/doctorbasedata/
cloudDoctorUrl
:
https://testapi.chinachdu.com/cloud/doctorbasedata/
cloudDoctorUserUrl
:
https://testapi.chinachdu.com/cloud/doctoruser/
cloudDoctorUserUrl
:
https://testapi.chinachdu.com/cloud/doctoruser/
\ No newline at end of file
projprops
:
userFindUserId
:
https://testapi.chinachdu.com/cloud/doctoruser/user/finduserid
userInfo
:
https://testapi.chinachdu.com/cloud/doctoruser/user/getuserinfoByUserId
baseAddress
:
https://testapi.chinachdu.com/
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论