Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hphy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
向怀芳
hphy
Commits
0f6e2d6d
Commit
0f6e2d6d
authored
May 18, 2021
by
向怀芳
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
c881f5d0
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
293 additions
and
41 deletions
+293
-41
ValidateCodeUtil.java
.../sh/stc/sict/cloud/common/core/util/ValidateCodeUtil.java
+60
-0
ValidateCodeGatewayFilter.java
...loud/common/gateway/filter/ValidateCodeGatewayFilter.java
+11
-2
SysUserBaseServiceImpl.java
.../sict/cloud/upms/service/impl/SysUserBaseServiceImpl.java
+29
-4
AppointmentController.java
.../sict/theme/hphy/controller/mp/AppointmentController.java
+1
-0
HphyPatientBaseController.java
...t/theme/hphy/controller/mp/HphyPatientBaseController.java
+18
-0
IntelligentQAController.java
...ict/theme/hphy/controller/mp/IntelligentQAController.java
+3
-3
WDController.java
...cn/sh/stc/sict/theme/hphy/controller/mp/WDController.java
+34
-5
HphyPatientBase.java
...java/cn/sh/stc/sict/theme/hphy/model/HphyPatientBase.java
+2
-0
HpDocInfoServiceImpl.java
...tc/sict/theme/hphy/service/impl/HpDocInfoServiceImpl.java
+29
-26
PythonDTO.java
...src/main/java/cn/sh/stc/sict/theme/hphy/vo/PythonDTO.java
+5
-1
ContractInfoParam.java
.../java/cn/sh/stc/sict/theme/hphy/wd/ContractInfoParam.java
+15
-0
ContractParam.java
...main/java/cn/sh/stc/sict/theme/hphy/wd/ContractParam.java
+20
-0
WanDaHttpUtil.java
...main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaHttpUtil.java
+42
-0
WanDaUtil.java
...src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaUtil.java
+24
-0
No files found.
cloud-common/cloud-common-
data/src/main/java/cn/sh/stc/sict/cloud/common/data
/util/ValidateCodeUtil.java
→
cloud-common/cloud-common-
core/src/main/java/cn/sh/stc/sict/cloud/common/core
/util/ValidateCodeUtil.java
View file @
0f6e2d6d
package
cn
.
sh
.
stc
.
sict
.
cloud
.
common
.
data
.
util
;
package
cn
.
sh
.
stc
.
sict
.
cloud
.
common
.
core
.
util
;
import
cn.hutool.core.util.StrUtil
;
import
cn.sh.stc.sict.cloud.common.core.constant.RedisCacheConstant
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
java.util.concurrent.TimeUnit
;
/**
* @Description 验证码校验工具类
...
...
@@ -12,10 +15,16 @@ import org.springframework.data.redis.core.RedisTemplate;
public
class
ValidateCodeUtil
{
/**
*
从redis取出验证码并验证
*
过期时间/s
*/
public
static
boolean
validateCode
(
RedisTemplate
redisTemplate
,
String
code
,
String
phone
)
{
String
key
=
RedisCacheConstant
.
SICT_PHONE_CODE_KEY
+
phone
;
private
final
static
Long
EXPIRE_TIME_SECOND
=
120L
;
/**
* 从redis取出验证码并验证
* type : 0-登录 1-注册
*/
public
static
boolean
validateCode
(
StringRedisTemplate
redisTemplate
,
String
phone
,
String
code
,
Byte
type
)
{
String
key
=
RedisCacheConstant
.
SICT_PHONE_CODE_KEY
+
":"
+
type
+
":"
+
phone
;
if
(!
redisTemplate
.
hasKey
(
key
))
{
return
false
;
}
...
...
@@ -32,6 +41,20 @@ public class ValidateCodeUtil {
if
(!
StrUtil
.
equals
(
savedCode
,
code
))
{
return
false
;
}
redisTemplate
.
delete
(
key
);
return
true
;
}
public
static
void
saveCode
(
RedisTemplate
redisTemplate
,
String
phone
,
String
code
,
Byte
type
)
{
String
key
=
RedisCacheConstant
.
SICT_PHONE_CODE_KEY
+
":"
+
type
+
":"
+
phone
;
redisTemplate
.
opsForValue
().
set
(
key
,
code
,
EXPIRE_TIME_SECOND
,
TimeUnit
.
SECONDS
);
}
public
static
boolean
hasPhoneKey
(
RedisTemplate
redisTemplate
,
String
phone
,
Byte
type
)
{
String
key
=
RedisCacheConstant
.
SICT_PHONE_CODE_KEY
+
":"
+
type
+
":"
+
phone
;
if
(
redisTemplate
.
hasKey
(
key
))
{
return
true
;
}
return
false
;
}
}
cloud-common/cloud-common-gateway/src/main/java/cn/sh/stc/sict/cloud/common/gateway/filter/ValidateCodeGatewayFilter.java
View file @
0f6e2d6d
...
...
@@ -6,6 +6,8 @@ import cn.sh.stc.sict.cloud.common.core.constant.SecurityConstants;
import
cn.sh.stc.sict.cloud.common.core.constant.enums.LoginTypeEnum
;
import
cn.sh.stc.sict.cloud.common.core.exception.ValidateCodeException
;
import
cn.sh.stc.sict.cloud.common.core.util.R
;
import
cn.sh.stc.sict.cloud.common.core.util.SmsSendUtil
;
import
cn.sh.stc.sict.cloud.common.core.util.ValidateCodeUtil
;
import
cn.sh.stc.sict.cloud.common.core.util.WebUtils
;
import
cn.sh.stc.sict.cloud.common.gateway.config.FilterIgnorePropertiesConfig
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
...
...
@@ -15,6 +17,7 @@ import lombok.SneakyThrows;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.gateway.filter.GatewayFilter
;
import
org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.server.reactive.ServerHttpRequest
;
import
org.springframework.http.server.reactive.ServerHttpResponse
;
...
...
@@ -32,7 +35,7 @@ import reactor.core.publisher.Mono;
public
class
ValidateCodeGatewayFilter
extends
AbstractGatewayFilterFactory
{
private
final
ObjectMapper
objectMapper
;
private
final
FilterIgnorePropertiesConfig
filterIgnorePropertiesConfig
;
// private final SmsSendUtil smsSendUtil
;
private
final
StringRedisTemplate
redisTemplate
;
@Override
public
GatewayFilter
apply
(
Object
config
)
{
...
...
@@ -63,7 +66,13 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory {
if
(
StrUtil
.
containsAnyIgnoreCase
(
request
.
getURI
().
getPath
(),
SecurityConstants
.
SOCIAL_TOKEN_URL
))
{
String
mobile
=
request
.
getQueryParams
().
getFirst
(
"mobile"
);
if
(
StrUtil
.
containsAny
(
mobile
,
LoginTypeEnum
.
SMS
.
getType
()))
{
throw
new
ValidateCodeException
(
"验证码不合法"
);
String
phone
=
mobile
.
split
(
"@"
)[
2
];
String
code
=
request
.
getQueryParams
().
getFirst
(
"code"
);
log
.
error
(
"mobile = {}, code = {}"
,
phone
,
code
);
if
(!
ValidateCodeUtil
.
validateCode
(
redisTemplate
,
phone
,
code
,
Constant
.
BYTE_NO
)){
throw
new
ValidateCodeException
(
"验证码不合法"
);
}
return
chain
.
filter
(
exchange
);
}
else
{
return
chain
.
filter
(
exchange
);
}
...
...
smart-health-modules/cloud-upms/cloud-upms-biz/src/main/java/cn/sh/stc/sict/cloud/upms/service/impl/SysUserBaseServiceImpl.java
View file @
0f6e2d6d
package
cn
.
sh
.
stc
.
sict
.
cloud
.
upms
.
service
.
impl
;
import
cn.sh.stc.sict.cloud.common.core.constant.Constant
;
import
cn.sh.stc.sict.cloud.common.core.constant.enums.LoginTypeEnum
;
import
cn.sh.stc.sict.cloud.common.core.util.NumberUtil
;
import
cn.sh.stc.sict.cloud.upms.dao.SysUserBaseMapper
;
import
cn.sh.stc.sict.cloud.upms.dto.UserDTO
;
...
...
@@ -48,10 +49,14 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
log
.
error
(
"=================> appId = {}, inStr = {}"
,
appId
,
inStr
);
// code = 011Eg6Ga1UOXeA0R5wHa16dkab2Eg6G7
String
[]
split
=
inStr
.
split
(
StringPool
.
AT
);
WxOAuth2AccessToken
token
=
wxMpService
.
getOAuth2Service
().
getAccessToken
(
split
[
2
]);
return
this
.
getByOpenId
(
token
.
getOpenId
());
if
(
LoginTypeEnum
.
SMS
.
getType
().
equals
(
split
[
0
])){
// 手机号登录
return
this
.
getByPhone
(
split
[
2
]);
}
else
{
// 微信登录
WxOAuth2AccessToken
token
=
wxMpService
.
getOAuth2Service
().
getAccessToken
(
split
[
2
]);
return
this
.
getByOpenId
(
token
.
getOpenId
());
}
}
@Override
...
...
@@ -63,6 +68,26 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
return
true
;
}
private
UserInfo
getByPhone
(
String
phone
)
{
LambdaQueryWrapper
<
SysUserBase
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SysUserBase:
:
getPhone
,
phone
);
SysUserBase
user
=
this
.
getOne
(
wrapper
);
// 未注册用户默认注册
if
(
user
==
null
)
{
user
=
new
SysUserBase
();
user
.
setOpenId
(
phone
);
user
.
setStatus
(
Constant
.
BYTE_NO
);
user
.
setPasswd
(
Constant
.
DEFAULT_PASSWORD
);
user
.
setPhone
(
phone
);
this
.
save
(
user
);
}
UserInfo
info
=
new
UserInfo
();
info
.
setSysUserBase
(
user
);
info
.
setOpenId
(
phone
);
return
info
;
}
private
UserInfo
getByOpenId
(
String
openId
)
{
LambdaQueryWrapper
<
SysUserBase
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/AppointmentController.java
View file @
0f6e2d6d
...
...
@@ -171,6 +171,7 @@ public class AppointmentController {
LambdaQueryWrapper
<
HpAppointment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
ge
(
StrUtil
.
isNotBlank
(
startDate
),
HpAppointment:
:
getNumSourceDate
,
startDate
)
.
le
(
StrUtil
.
isNotBlank
(
endDate
),
HpAppointment:
:
getNumSourceDate
,
endDate
)
.
eq
(
HpAppointment:
:
getPatientId
,
patient
.
getId
())
.
orderByDesc
(
HpAppointment:
:
getCreateTime
);
page
=
hpAppointmentService
.
page
(
page
,
wrapper
);
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java
View file @
0f6e2d6d
...
...
@@ -2,17 +2,21 @@ package cn.sh.stc.sict.theme.hphy.controller.mp;
import
cn.hutool.core.util.IdcardUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.sh.stc.sict.cloud.common.core.constant.Constant
;
import
cn.sh.stc.sict.cloud.common.core.util.R
;
import
cn.sh.stc.sict.cloud.common.core.util.ValidateCodeUtil
;
import
cn.sh.stc.sict.cloud.common.security.util.SecurityUtils
;
import
cn.sh.stc.sict.cloud.upms.dto.CurrentUser
;
import
cn.sh.stc.sict.cloud.upms.model.SysUserBase
;
import
cn.sh.stc.sict.theme.hphy.constant.PatientConstant
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
import
cn.sh.stc.sict.theme.hphy.service.HphyPatientBaseService
;
import
cn.sh.stc.sict.theme.hphy.wd.WanDaHttpUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -30,6 +34,7 @@ import org.springframework.web.bind.annotation.*;
public
class
HphyPatientBaseController
{
private
HphyPatientBaseService
hphyPatientBaseService
;
private
StringRedisTemplate
redisTemplate
;
/**
* 注册并关联登录信息
...
...
@@ -43,6 +48,10 @@ public class HphyPatientBaseController {
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
HphyPatientBase
base
=
hphyPatientBaseService
.
getByOpenId
(
current
.
getOpenId
());
patient
.
setOpenId
(
current
.
getOpenId
());
// if(!ValidateCodeUtil.validateCode(redisTemplate, patient.getPhone(), patient.getRandomCode(), Constant.BYTE_YES)){
// return new R().error("验证码错误!");
// }
if
(
base
!=
null
)
{
patient
.
setId
(
base
.
getId
());
}
...
...
@@ -58,6 +67,15 @@ public class HphyPatientBaseController {
patient
.
setGender
(
IdcardUtil
.
getGenderByIdCard
(
patient
.
getCertId
())
==
1
?
"男"
:
"女"
);
// 手机号redis验证
// 根据手机号去重
// 获取家庭医生签约信息
try
{
String
familyDocHos
=
WanDaHttpUtil
.
getContractInfo
(
patient
.
getCertId
());
if
(
StrUtil
.
isNotBlank
(
familyDocHos
)){
patient
.
setFamilyDocHos
(
familyDocHos
);
}
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
}
hphyPatientBaseService
.
saveOrUpdate
(
patient
);
return
new
R
(
patient
.
getId
());
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/IntelligentQAController.java
View file @
0f6e2d6d
...
...
@@ -41,12 +41,12 @@ public class IntelligentQAController {
" <Content><![CDATA["
+
question
+
"]]></Content>\n"
+
" <MsgId>"
+
IdWorker
.
getId
()
+
"</MsgId>\n"
+
"</xml>"
;
String
body
=
HttpRequest
.
post
(
"http://www.365jqr.com/jqrsvr.ashx?Command=talk_162"
)
String
body
=
HttpRequest
.
post
(
"http://30.30.5.74:9988/qa/jqrsvr.ashx?Command=talk_162"
)
.
body
(
xml
)
.
execute
()
.
body
();
log
.
error
(
"孙总接口请求 xml = {}"
,
xml
);
log
.
error
(
"孙总接口返回 body = {}"
,
body
);
Map
<
String
,
Object
>
result
=
XmlUtil
.
xmlToMap
(
body
);
if
(
result
.
containsKey
(
CONTENT
)){
return
new
R
(
result
.
get
(
CONTENT
));
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/WDController.java
View file @
0f6e2d6d
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
controller
.
mp
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.lang.Validator
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.sh.stc.sict.cloud.common.core.constant.Constant
;
import
cn.sh.stc.sict.cloud.common.core.util.R
;
import
cn.sh.stc.sict.cloud.common.core.util.ValidateCodeUtil
;
import
cn.sh.stc.sict.theme.hphy.wd.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -22,6 +27,9 @@ import java.util.List;
@Api
(
tags
=
"[C]万达相关接口"
)
public
class
WDController
{
@Autowired
private
StringRedisTemplate
redisTemplate
;
/**
* 0. 发短信
* 1. 医生查询
...
...
@@ -31,13 +39,34 @@ public class WDController {
* 5. 预约须知
*/
@ApiOperation
(
"发送短信"
)
@PostMapping
(
"/send/msg"
)
public
R
sendMsg
(
@RequestParam
(
"phone"
)
String
phone
,
@ApiParam
(
"类型:0-登录,1-注册"
)
@RequestParam
(
"type"
)
Byte
type
)
{
boolean
mobile
=
Validator
.
isMobile
(
phone
);
if
(!
mobile
)
{
return
new
R
().
error
(
"手机号错误!"
);
}
// 是否重复发送
if
(
ValidateCodeUtil
.
hasPhoneKey
(
redisTemplate
,
phone
,
type
)){
return
new
R
().
success
(
"短信已发送,请等待!"
);
}
String
appName
=
"dx"
;
String
code
=
RandomUtil
.
randomNumbers
(
6
);
String
msg
=
"您的验证码是:"
+
code
;
WanDaHttpUtil
.
sendMsg
(
phone
,
msg
,
appName
);
ValidateCodeUtil
.
saveCode
(
redisTemplate
,
phone
,
code
,
type
);
return
new
R
().
success
(
"短信已发送,请等待!"
);
}
@ApiOperation
(
"获取号源信息"
)
@GetMapping
(
"/num/info"
)
public
R
getOrderNumberInfo
(
NumSourceInfo
numSourceInfo
)
{
List
<
NumSourceInfo
>
list
=
WanDaHttpUtil
.
getOrderNumInfo
(
numSourceInfo
);
if
(
CollUtil
.
isNotEmpty
(
list
))
{
if
(
CollUtil
.
isNotEmpty
(
list
))
{
return
R
.
builder
().
code
(
Constant
.
BYTE_YES
).
data
(
list
).
bizCode
(
Constant
.
INT_NO
).
build
();
}
...
...
@@ -46,7 +75,7 @@ public class WDController {
deptInfo
.
setOneDeptCode
(
numSourceInfo
.
getOneDeptCode
());
deptInfo
.
setDeptCode
(
numSourceInfo
.
getDeptCode
());
List
<
OutPatInfo
>
outPatInfo
=
WanDaHttpUtil
.
getResourceOutPatInfo
(
deptInfo
);
if
(
CollUtil
.
isNotEmpty
(
outPatInfo
))
{
if
(
CollUtil
.
isNotEmpty
(
outPatInfo
))
{
numSourceInfo
.
setOrderType
(
WanDaConstant
.
ORDER_TYPE_CLINC
);
numSourceInfo
.
setResourceCode
(
outPatInfo
.
get
(
0
).
getResourceCode
());
list
=
WanDaHttpUtil
.
getOrderNumInfo
(
numSourceInfo
);
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HphyPatientBase.java
View file @
0f6e2d6d
...
...
@@ -128,6 +128,8 @@ public class HphyPatientBase extends Model<HphyPatientBase> {
@ApiModelProperty
(
value
=
"企业名称"
)
private
String
enterpriseName
;
private
String
familyDocHos
;
@TableField
(
exist
=
false
)
private
String
randomCode
;
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpDocInfoServiceImpl.java
View file @
0f6e2d6d
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.sh.stc.sict.theme.hphy.dao.HpDocInfoMapper
;
import
cn.sh.stc.sict.theme.hphy.model.HpDocInfo
;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideMatch
;
...
...
@@ -40,32 +41,34 @@ public class HpDocInfoServiceImpl extends ServiceImpl<HpDocInfoMapper, HpDocInfo
@Override
public
List
<
DoctorMatchVO
>
getRecommendList
(
HphyGuideRecord
guide
,
List
<
PythonResult
>
pythonList
)
{
List
<
DoctorMatchVO
>
result
=
new
ArrayList
<>();
Map
<
String
,
Double
>
matchMap
=
pythonList
.
stream
().
collect
(
Collectors
.
toMap
(
PythonResult:
:
getDoctorId
,
PythonResult:
:
getMatchScore
));
List
<
String
>
doctorIdList
=
pythonList
.
stream
().
map
(
PythonResult:
:
getDoctorId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
HpDocInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
HpDocInfo:
:
getPersonId
,
doctorIdList
);
List
<
HpDocInfo
>
list
=
this
.
list
(
wrapper
);
List
<
HphyGuideMatch
>
matchList
=
new
ArrayList
<>();
list
.
forEach
(
doctor
->
{
DoctorMatchVO
vo
=
new
DoctorMatchVO
();
vo
.
setDocInfo
(
doctor
);
vo
.
setMatchScore
(
matchMap
.
getOrDefault
(
doctor
.
getPersonId
(),
85.0
));
result
.
add
(
vo
);
HphyGuideMatch
match
=
new
HphyGuideMatch
();
match
.
setDeptId
(
doctor
.
getDeptCode
());
match
.
setDeptName
(
doctor
.
getDeptName
());
match
.
setDoctorId
(
doctor
.
getResourceCode
());
match
.
setDoctorName
(
doctor
.
getResourceName
());
match
.
setGuideId
(
guide
.
getId
());
match
.
setHospId
(
doctor
.
getHosOrgCode
());
match
.
setHospName
(
doctor
.
getHosName
());
match
.
setMatchScore
(
vo
.
getMatchScore
().
toString
());
match
.
setPatientId
(
guide
.
getPatientId
());
match
.
setPatientName
(
guide
.
getPatientName
());
matchList
.
add
(
match
);
});
// 保存医生推荐记录
hphyGuideMatchService
.
asyncSaveBatch
(
matchList
);
if
(
CollUtil
.
isNotEmpty
(
pythonList
)){
Map
<
String
,
Double
>
matchMap
=
pythonList
.
stream
().
collect
(
Collectors
.
toMap
(
PythonResult:
:
getDoctorId
,
PythonResult:
:
getMatchScore
));
List
<
String
>
doctorIdList
=
pythonList
.
stream
().
map
(
PythonResult:
:
getDoctorId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
HpDocInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
HpDocInfo:
:
getPersonId
,
doctorIdList
);
List
<
HpDocInfo
>
list
=
this
.
list
(
wrapper
);
List
<
HphyGuideMatch
>
matchList
=
new
ArrayList
<>();
list
.
forEach
(
doctor
->
{
DoctorMatchVO
vo
=
new
DoctorMatchVO
();
vo
.
setDocInfo
(
doctor
);
vo
.
setMatchScore
(
matchMap
.
getOrDefault
(
doctor
.
getPersonId
(),
85.0
));
result
.
add
(
vo
);
HphyGuideMatch
match
=
new
HphyGuideMatch
();
match
.
setDeptId
(
doctor
.
getDeptCode
());
match
.
setDeptName
(
doctor
.
getDeptName
());
match
.
setDoctorId
(
doctor
.
getResourceCode
());
match
.
setDoctorName
(
doctor
.
getResourceName
());
match
.
setGuideId
(
guide
.
getId
());
match
.
setHospId
(
doctor
.
getHosOrgCode
());
match
.
setHospName
(
doctor
.
getHosName
());
match
.
setMatchScore
(
vo
.
getMatchScore
().
toString
());
match
.
setPatientId
(
guide
.
getPatientId
());
match
.
setPatientName
(
guide
.
getPatientName
());
matchList
.
add
(
match
);
});
// 保存医生推荐记录
hphyGuideMatchService
.
asyncSaveBatch
(
matchList
);
}
return
result
.
stream
()
.
sorted
(
Comparator
.
comparing
(
DoctorMatchVO:
:
getMatchScore
).
reversed
())
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/PythonDTO.java
View file @
0f6e2d6d
...
...
@@ -26,12 +26,13 @@ public class PythonDTO {
private
String
age
=
"N"
;
private
String
exp
=
"N"
;
private
String
fre
=
"N"
;
private
String
familyDocHos
=
""
;
/**
* [纬度,经度]
*/
private
List
<
String
>
add
=
new
ArrayList
<>();
private
List
<
String
>
disease
;
private
List
<
String
>
reserve
_l
ist
=
new
ArrayList
<>();
private
List
<
String
>
reserve
L
ist
=
new
ArrayList
<>();
private
List
<
String
>
appo
=
new
ArrayList
<>();
private
Object
result
;
...
...
@@ -52,6 +53,9 @@ public class PythonDTO {
if
(
StrUtil
.
isNotBlank
(
patient
.
getDisease
()))
{
disease
.
add
(
patient
.
getDisease
());
}
if
(
StrUtil
.
isNotBlank
(
patient
.
getFamilyDocHos
())){
this
.
familyDocHos
=
patient
.
getFamilyDocHos
();
}
}
log
.
error
(
"disease----------------->{}"
,
disease
.
toString
());
if
(
CollUtil
.
isNotEmpty
(
disease
))
{
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/ContractInfoParam.java
0 → 100644
View file @
0f6e2d6d
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
wd
;
import
lombok.Data
;
/**
* 家庭医生签约信息查询 param
*/
@Data
public
class
ContractInfoParam
{
private
String
loginName
=
"hpwgzxwx"
;
private
String
authCode
=
"870032"
;
private
String
searchParam
;
private
String
pageNo
=
"1"
;
private
String
pageSize
=
"10"
;
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/ContractParam.java
0 → 100644
View file @
0f6e2d6d
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
wd
;
import
lombok.Data
;
@Data
public
class
ContractParam
{
private
String
loginName
;
private
String
authCode
;
private
String
searchParam
;
private
String
pageNo
;
private
String
pageSize
;
public
ContractParam
(
String
searchParam
)
{
this
.
loginName
=
"hpwgzxwx"
;
this
.
authCode
=
"870032"
;
this
.
searchParam
=
"and ZJHM = '"
+
searchParam
+
"'"
;
this
.
pageNo
=
"1"
;
this
.
pageSize
=
"1"
;
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaHttpUtil.java
View file @
0f6e2d6d
...
...
@@ -3,6 +3,10 @@ package cn.sh.stc.sict.theme.hphy.wd;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.XmlUtil
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.json.JSON
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
cn.sh.stc.sict.cloud.common.core.constant.Constant
;
import
lombok.experimental.UtilityClass
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -18,9 +22,46 @@ import java.util.List;
@UtilityClass
public
class
WanDaHttpUtil
{
String
URL
=
"http://173.18.1.29:7001/yyzlWS/webservice/ss"
;
String
CONTRACT_INFO_URL
=
"http://173.18.1.66:7001/api/service/accessResources/302fe34ac9ad4b3291329cd3bf6ca9d0"
;
String
MSG_URL
=
"http://173.18.1.94:8080/dxpt/ws/smsService"
;
String
CODE_XPATH
=
"//Response/MessageHeader/code"
;
String
DESC_XPATH
=
"//Response/MessageHeader/desc"
;
/**
* 获取家庭医生签约信息
*/
public
static
String
getContractInfo
(
String
idNo
){
ContractParam
param
=
new
ContractParam
(
idNo
);
String
body
=
HttpRequest
.
post
(
CONTRACT_INFO_URL
)
.
body
(
JSONUtil
.
toJsonStr
(
param
))
.
execute
()
.
body
();
System
.
out
.
println
(
body
);
JSON
parse
=
JSONUtil
.
parse
(
body
);
Object
obj
=
parse
.
getByPath
(
"data.pageInfo.totals"
);
if
(
null
!=
obj
&&
Integer
.
valueOf
(
obj
.
toString
())>
0
){
JSONArray
arr
=
parse
.
getByPath
(
"data.data"
,
JSONArray
.
class
);
return
((
JSONObject
)
arr
.
get
(
0
)).
get
(
"SQJGMC"
).
toString
();
}
return
""
;
}
/**
* 发送短信
* @param phone
* @param msg
* @param appName
*/
public
static
void
sendMsg
(
String
phone
,
String
msg
,
String
appName
)
{
String
xml
=
WanDaUtil
.
GetSendMsgServiceXML
(
phone
,
msg
,
appName
);
System
.
out
.
println
(
xml
);
String
body
=
HttpRequest
.
post
(
MSG_URL
)
.
body
(
xml
)
.
execute
()
.
body
();
System
.
out
.
println
(
body
);
}
/**
* 调用万达 webservice 接口获取医院信息
*
...
...
@@ -509,4 +550,5 @@ public class WanDaHttpUtil {
return
"//soap:Envelope/soap:Body/ns2:"
+
response
+
"Response/return"
;
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaUtil.java
View file @
0f6e2d6d
...
...
@@ -315,4 +315,28 @@ public class WanDaUtil {
return
xStream
.
toXML
(
o
);
}
/**
* 发送短信
*
* @param phone
* @param msg
* @param appName
* @return
*/
public
static
String
GetSendMsgServiceXML
(
String
phone
,
String
msg
,
String
appName
)
{
String
body
=
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sms=\"http://sms.wondersgroup.com/\">"
+
" <soapenv:Header/>"
+
" <soapenv:Body>"
+
" <sms:sendMessageForDsf>"
+
" <!--Optional:-->"
+
" <arg0>"
+
phone
+
"</arg0>"
+
" <!--Optional:-->"
+
" <arg1>【黄浦卫管】"
+
msg
+
"</arg1>"
+
" <!--Optional:-->"
+
" <arg2>"
+
appName
+
"</arg2>"
+
" </sms:sendMessageForDsf>"
+
" </soapenv:Body>"
+
"</soapenv:Envelope>"
;
return
body
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment