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
4e9a8dfb
Commit
4e9a8dfb
authored
Oct 10, 2022
by
向怀芳
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 解决CORS跨域问题
2. 导医推荐添加查询条件 3. 预约记录添加查询条件,列表显示字段 4. 新增查询个人历史医生list 5. 新增家庭成员管理接口:列表,新增,删除
parent
26fc5718
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
509 additions
and
29 deletions
+509
-29
GlobalCorsConfig.java
...tc/sict/cloud/common/gateway/config/GlobalCorsConfig.java
+16
-2
HpAppointmentEvaController.java
...me/hpgp/controller/mobile/HpAppointmentEvaController.java
+1
-0
HpHzjlController.java
...c/sict/theme/hpgp/controller/mobile/HpHzjlController.java
+25
-6
HpAppointmentEva.java
...ava/cn/sh/stc/sict/theme/hpgp/model/HpAppointmentEva.java
+1
-0
HpHzjlService.java
...java/cn/sh/stc/sict/theme/hpgp/service/HpHzjlService.java
+3
-0
HpHzjlServiceImpl.java
...h/stc/sict/theme/hpgp/service/impl/HpHzjlServiceImpl.java
+27
-0
HphyPatientBaseController.java
...t/theme/hphy/controller/mp/HphyPatientBaseController.java
+15
-3
HphyPatientRelationController.java
...eme/hphy/controller/mp/HphyPatientRelationController.java
+104
-0
AppEvaController.java
.../stc/sict/theme/hphy/controller/web/AppEvaController.java
+39
-0
GuideRecordController.java
...sict/theme/hphy/controller/web/GuideRecordController.java
+7
-1
HpAppointmentController.java
...ct/theme/hphy/controller/web/HpAppointmentController.java
+14
-2
HphyGuideMatchController.java
...t/theme/hphy/controller/web/HphyGuideMatchController.java
+11
-3
HphyPatientRelationMapper.java
...sh/stc/sict/theme/hphy/dao/HphyPatientRelationMapper.java
+19
-0
HphyGuideMatch.java
.../java/cn/sh/stc/sict/theme/hphy/model/HphyGuideMatch.java
+11
-11
HphyPatientRelation.java
.../cn/sh/stc/sict/theme/hphy/model/HphyPatientRelation.java
+45
-0
HphyPatientBaseService.java
...h/stc/sict/theme/hphy/service/HphyPatientBaseService.java
+6
-0
HphyPatientRelationService.java
...c/sict/theme/hphy/service/HphyPatientRelationService.java
+18
-0
HphyPatientBaseServiceImpl.java
...t/theme/hphy/service/impl/HphyPatientBaseServiceImpl.java
+43
-1
HphyPatientRelationServiceImpl.java
...eme/hphy/service/impl/HphyPatientRelationServiceImpl.java
+28
-0
PatientRelationDTO.java
...java/cn/sh/stc/sict/theme/hphy/vo/PatientRelationDTO.java
+11
-0
PatientRelationVO.java
.../java/cn/sh/stc/sict/theme/hphy/vo/PatientRelationVO.java
+11
-0
bootstrap-dev.yml
...modules/theme-schema/src/main/resources/bootstrap-dev.yml
+1
-0
HphyPatientRelationMapper.xml
.../main/resources/mapper/hphy/HphyPatientRelationMapper.xml
+53
-0
No files found.
cloud-common/cloud-common-gateway/src/main/java/cn/sh/stc/sict/cloud/common/gateway/config/GlobalCorsConfig.java
View file @
4e9a8dfb
...
@@ -13,6 +13,9 @@ import org.springframework.web.server.WebFilter;
...
@@ -13,6 +13,9 @@ import org.springframework.web.server.WebFilter;
import
org.springframework.web.server.WebFilterChain
;
import
org.springframework.web.server.WebFilterChain
;
import
reactor.core.publisher.Mono
;
import
reactor.core.publisher.Mono
;
import
java.util.HashSet
;
import
java.util.Set
;
/**
/**
* @Description
* @Description
* @Author
* @Author
...
@@ -26,7 +29,14 @@ public class GlobalCorsConfig {
...
@@ -26,7 +29,14 @@ public class GlobalCorsConfig {
*/
*/
private
static
final
String
ALLOWED_HEADERS
=
"x-requested-with, authorization, Content-Type, Authorization, credential, X-XSRF-TOKEN,token,username,client,access-token"
;
private
static
final
String
ALLOWED_HEADERS
=
"x-requested-with, authorization, Content-Type, Authorization, credential, X-XSRF-TOKEN,token,username,client,access-token"
;
private
static
final
String
ALLOWED_METHODS
=
"*"
;
private
static
final
String
ALLOWED_METHODS
=
"*"
;
private
static
final
String
ALLOWED_ORIGIN
=
"https://inno.sh-sict.com/, https://hy.hpwjsns.org.cn/"
;
private
static
final
Set
<
String
>
ALLOWED_ORIGINS
=
new
HashSet
<
String
>(){{
add
(
"https://inno.sh-sict.com"
);
add
(
"https://hy.hpwjsns.org.cn"
);
add
(
"http://localhost:12998"
);
add
(
"http://127.0.0.1:12998"
);
add
(
"http://sict-gateway:12998"
);
add
(
"http://192.168.31.140:12998"
);
}};
private
static
final
String
ALLOWED_Expose
=
"*"
;
private
static
final
String
ALLOWED_Expose
=
"*"
;
private
static
final
String
MAX_AGE
=
"18000L"
;
private
static
final
String
MAX_AGE
=
"18000L"
;
...
@@ -37,7 +47,11 @@ public class GlobalCorsConfig {
...
@@ -37,7 +47,11 @@ public class GlobalCorsConfig {
if
(
CorsUtils
.
isCorsRequest
(
request
))
{
if
(
CorsUtils
.
isCorsRequest
(
request
))
{
ServerHttpResponse
response
=
ctx
.
getResponse
();
ServerHttpResponse
response
=
ctx
.
getResponse
();
HttpHeaders
headers
=
response
.
getHeaders
();
HttpHeaders
headers
=
response
.
getHeaders
();
headers
.
add
(
"Access-Control-Allow-Origin"
,
ALLOWED_ORIGIN
);
if
(
ALLOWED_ORIGINS
.
contains
(
request
.
getHeaders
().
getOrigin
())){
headers
.
add
(
"Access-Control-Allow-Origin"
,
request
.
getHeaders
().
getOrigin
());
}
else
{
headers
.
add
(
"Access-Control-Allow-Origin"
,
"https://hy.hpwjsns.org.cn"
);
}
headers
.
add
(
"Access-Control-Allow-Methods"
,
ALLOWED_METHODS
);
headers
.
add
(
"Access-Control-Allow-Methods"
,
ALLOWED_METHODS
);
headers
.
add
(
"Access-Control-Max-Age"
,
MAX_AGE
);
headers
.
add
(
"Access-Control-Max-Age"
,
MAX_AGE
);
headers
.
add
(
"Access-Control-Allow-Headers"
,
ALLOWED_HEADERS
);
headers
.
add
(
"Access-Control-Allow-Headers"
,
ALLOWED_HEADERS
);
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpAppointmentEvaController.java
View file @
4e9a8dfb
...
@@ -74,6 +74,7 @@ public class HpAppointmentEvaController {
...
@@ -74,6 +74,7 @@ public class HpAppointmentEvaController {
}
}
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
eva
.
setUserId
(
current
.
getId
());
eva
.
setUserId
(
current
.
getId
());
eva
.
setPatientName
(
app
.
getPatientName
());
eva
.
setHospCode
(
app
.
getHosOrgCode
());
eva
.
setHospCode
(
app
.
getHosOrgCode
());
eva
.
setHospName
(
app
.
getHosOrgName
());
eva
.
setHospName
(
app
.
getHosOrgName
());
eva
.
setDeptCode
(
app
.
getDeptCode
());
eva
.
setDeptCode
(
app
.
getDeptCode
());
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpHzjlController.java
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hpgp
.
controller
.
mobile
;
package
cn
.
sh
.
stc
.
sict
.
theme
.
hpgp
.
controller
.
mobile
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.sh.stc.sict.cloud.common.security.util.SecurityUtils
;
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.dto.CurrentUser
;
import
cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction
;
import
cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction
;
import
cn.sh.stc.sict.theme.hphy.model.HpDocInfo
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
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.service.HphyPatientBaseService
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
@@ -34,7 +34,7 @@ import java.util.List;
...
@@ -34,7 +34,7 @@ import java.util.List;
@Slf4j
@Slf4j
@RestController
@RestController
@AllArgsConstructor
@AllArgsConstructor
@Api
(
tags
=
"患者就诊记录"
)
@Api
(
tags
=
"
[C]
患者就诊记录"
)
@RequestMapping
(
"/hpHzjl"
)
@RequestMapping
(
"/hpHzjl"
)
public
class
HpHzjlController
{
public
class
HpHzjlController
{
/**
/**
...
@@ -43,20 +43,39 @@ public class HpHzjlController {
...
@@ -43,20 +43,39 @@ public class HpHzjlController {
private
final
HpHzjlService
hpHzjlService
;
private
final
HpHzjlService
hpHzjlService
;
private
final
HphyPatientBaseService
hphyPatientBaseService
;
private
final
HphyPatientBaseService
hphyPatientBaseService
;
@ApiOperation
(
"历史科室 list"
)
@GetMapping
(
"/history/dept/list"
)
@GetMapping
(
"/history/dept/list"
)
public
R
historyDeptList
(){
public
R
historyDeptList
()
{
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
if
(
ObjectUtil
.
isEmpty
(
current
)
||
StrUtil
.
isBlank
(
current
.
getOpenId
()))
{
log
.
error
(
"current = {}"
,
JSONUtil
.
toJsonStr
(
current
));
return
new
R
().
error
(
"当前的登录人信息异常"
);
}
HphyPatientBase
patient
=
hphyPatientBaseService
.
getByOpenId
(
current
.
getOpenId
());
if
(
ObjectUtil
.
isEmpty
(
patient
)
||
StrUtil
.
isBlank
(
patient
.
getCertId
()))
{
log
.
error
(
"patient = {}"
,
JSONUtil
.
toJsonStr
(
patient
));
return
new
R
().
error
(
"患者信息异常!"
);
}
List
<
HpgpBusyIdlePrediction
>
result
=
hpHzjlService
.
listByCertId
(
patient
.
getCertId
());
return
new
R
(
result
);
}
@ApiOperation
(
"历史医生 list"
)
@GetMapping
(
"/history/doctor/list"
)
public
R
historyDoctorList
()
{
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
if
(
ObjectUtil
.
isEmpty
(
current
)||
StrUtil
.
isBlank
(
current
.
getOpenId
()))
{
if
(
ObjectUtil
.
isEmpty
(
current
)
||
StrUtil
.
isBlank
(
current
.
getOpenId
()))
{
log
.
error
(
"current = {}"
,
JSONUtil
.
toJsonStr
(
current
));
log
.
error
(
"current = {}"
,
JSONUtil
.
toJsonStr
(
current
));
return
new
R
().
error
(
"当前的登录人信息异常"
);
return
new
R
().
error
(
"当前的登录人信息异常"
);
}
}
HphyPatientBase
patient
=
hphyPatientBaseService
.
getByOpenId
(
current
.
getOpenId
());
HphyPatientBase
patient
=
hphyPatientBaseService
.
getByOpenId
(
current
.
getOpenId
());
if
(
ObjectUtil
.
isEmpty
(
patient
)||
StrUtil
.
isBlank
(
patient
.
getCertId
()))
{
if
(
ObjectUtil
.
isEmpty
(
patient
)
||
StrUtil
.
isBlank
(
patient
.
getCertId
()))
{
log
.
error
(
"patient = {}"
,
JSONUtil
.
toJsonStr
(
patient
));
log
.
error
(
"patient = {}"
,
JSONUtil
.
toJsonStr
(
patient
));
return
new
R
().
error
(
"患者信息异常!"
);
return
new
R
().
error
(
"患者信息异常!"
);
}
}
List
<
HpgpBusyIdlePrediction
>
result
=
hpHzjlService
.
listByCertId
(
patient
.
getCertId
());
List
<
HpDocInfo
>
result
=
hpHzjlService
.
listDoctorByCertId
(
patient
.
getCertId
());
return
new
R
(
result
);
return
new
R
(
result
);
}
}
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/model/HpAppointmentEva.java
View file @
4e9a8dfb
...
@@ -23,6 +23,7 @@ public class HpAppointmentEva extends Model<HpAppointmentEva> {
...
@@ -23,6 +23,7 @@ public class HpAppointmentEva extends Model<HpAppointmentEva> {
private
Long
id
;
private
Long
id
;
private
Long
userId
;
private
Long
userId
;
private
Long
patientId
;
private
Long
patientId
;
private
String
patientName
;
private
Long
appId
;
private
Long
appId
;
private
String
hospCode
;
private
String
hospCode
;
private
String
hospName
;
private
String
hospName
;
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/HpHzjlService.java
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hpgp
.
service
;
package
cn
.
sh
.
stc
.
sict
.
theme
.
hpgp
.
service
;
import
cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction
;
import
cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction
;
import
cn.sh.stc.sict.theme.hphy.model.HpDocInfo
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
cn.sh.stc.sict.theme.hpgp.model.HpHzjl
;
import
cn.sh.stc.sict.theme.hpgp.model.HpHzjl
;
...
@@ -15,4 +16,6 @@ import java.util.List;
...
@@ -15,4 +16,6 @@ import java.util.List;
public
interface
HpHzjlService
extends
IService
<
HpHzjl
>
{
public
interface
HpHzjlService
extends
IService
<
HpHzjl
>
{
List
<
HpgpBusyIdlePrediction
>
listByCertId
(
String
certId
);
List
<
HpgpBusyIdlePrediction
>
listByCertId
(
String
certId
);
List
<
HpDocInfo
>
listDoctorByCertId
(
String
certId
);
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/service/impl/HpHzjlServiceImpl.java
View file @
4e9a8dfb
...
@@ -8,6 +8,9 @@ import cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction;
...
@@ -8,6 +8,9 @@ import cn.sh.stc.sict.theme.hpgp.model.HpgpBusyIdlePrediction;
import
cn.sh.stc.sict.theme.hpgp.model.HpgpDepartmentRank
;
import
cn.sh.stc.sict.theme.hpgp.model.HpgpDepartmentRank
;
import
cn.sh.stc.sict.theme.hpgp.service.HpgpBusyIdlePredictionService
;
import
cn.sh.stc.sict.theme.hpgp.service.HpgpBusyIdlePredictionService
;
import
cn.sh.stc.sict.theme.hpgp.service.HpgpDepartmentRankService
;
import
cn.sh.stc.sict.theme.hpgp.service.HpgpDepartmentRankService
;
import
cn.sh.stc.sict.theme.hphy.model.HpDocInfo
;
import
cn.sh.stc.sict.theme.hphy.model.HphyDoctor
;
import
cn.sh.stc.sict.theme.hphy.service.HpDocInfoService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
@@ -32,6 +35,7 @@ public class HpHzjlServiceImpl extends ServiceImpl<HpHzjlMapper, HpHzjl> impleme
...
@@ -32,6 +35,7 @@ public class HpHzjlServiceImpl extends ServiceImpl<HpHzjlMapper, HpHzjl> impleme
private
final
HpgpDepartmentRankService
hpgpDepartmentRankService
;
private
final
HpgpDepartmentRankService
hpgpDepartmentRankService
;
private
final
HpgpBusyIdlePredictionService
hpgpBusyIdlePredictionService
;
private
final
HpgpBusyIdlePredictionService
hpgpBusyIdlePredictionService
;
private
final
HpDocInfoService
hpDocInfoService
;
/**
/**
* 根据身份证号查找最后三次不同科室就诊记录,并计算忙闲
* 根据身份证号查找最后三次不同科室就诊记录,并计算忙闲
...
@@ -75,4 +79,27 @@ public class HpHzjlServiceImpl extends ServiceImpl<HpHzjlMapper, HpHzjl> impleme
...
@@ -75,4 +79,27 @@ public class HpHzjlServiceImpl extends ServiceImpl<HpHzjlMapper, HpHzjl> impleme
return
result
;
return
result
;
}
}
@Override
public
List
<
HpDocInfo
>
listDoctorByCertId
(
String
certId
)
{
LambdaQueryWrapper
<
HpHzjl
>
wrapper
=
Wrappers
.
lambdaQuery
();
wrapper
.
eq
(
HpHzjl:
:
getZjhm
,
certId
)
.
groupBy
(
HpHzjl:
:
getYljgdm
,
HpHzjl:
:
getJzksbm
,
HpHzjl:
:
getZzysgh
)
.
orderByDesc
(
HpHzjl:
:
getJzksrq
)
.
last
(
"limit 10"
);
List
<
HpHzjl
>
recordList
=
this
.
list
(
wrapper
);
List
<
HpDocInfo
>
doctorList
=
new
ArrayList
<>();
if
(
CollUtil
.
isNotEmpty
(
recordList
))
{
recordList
.
forEach
(
r
->
{
LambdaQueryWrapper
<
HpDocInfo
>
dw
=
Wrappers
.
lambdaQuery
();
dw
.
eq
(
HpDocInfo:
:
getHosOrgCode
,
r
.
getYljgdm
())
.
eq
(
HpDocInfo:
:
getResourceCode
,
r
.
getZzysgh
())
.
eq
(
HpDocInfo:
:
getResourceName
,
r
.
getZzysxm
())
.
last
(
"limit 1"
);
HpDocInfo
one
=
hpDocInfoService
.
getOne
(
dw
);
doctorList
.
add
(
one
);
});
}
return
doctorList
;
}
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java
View file @
4e9a8dfb
...
@@ -58,8 +58,12 @@ public class HphyPatientBaseController {
...
@@ -58,8 +58,12 @@ public class HphyPatientBaseController {
@PostMapping
(
"/register"
)
@PostMapping
(
"/register"
)
public
R
register
(
@RequestBody
HphyPatientBase
patient
)
{
public
R
register
(
@RequestBody
HphyPatientBase
patient
)
{
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
HphyPatientBase
base
=
hphyPatientBaseService
.
get
ByOpenId
(
current
.
getOpenId
()
);
HphyPatientBase
base
=
hphyPatientBaseService
.
get
CurrentBase
(
);
patient
.
setOpenId
(
current
.
getOpenId
());
patient
.
setOpenId
(
current
.
getOpenId
());
// 根据手机号去重
if
(
base
==
null
||
NumberUtil
.
isNullOrZero
(
base
.
getId
()))
{
base
=
hphyPatientBaseService
.
getByPhone
(
current
.
getPhone
(),
true
);
}
if
(
base
!=
null
&&
NumberUtil
.
isNotNullOrZero
(
base
.
getId
()))
{
if
(
base
!=
null
&&
NumberUtil
.
isNotNullOrZero
(
base
.
getId
()))
{
patient
.
setId
(
base
.
getId
());
patient
.
setId
(
base
.
getId
());
...
@@ -78,7 +82,6 @@ public class HphyPatientBaseController {
...
@@ -78,7 +82,6 @@ public class HphyPatientBaseController {
patient
.
setAge
(
String
.
valueOf
(
IdcardUtil
.
getAgeByIdCard
(
patient
.
getCertId
())));
patient
.
setAge
(
String
.
valueOf
(
IdcardUtil
.
getAgeByIdCard
(
patient
.
getCertId
())));
patient
.
setGender
(
IdcardUtil
.
getGenderByIdCard
(
patient
.
getCertId
())
==
1
?
"男"
:
"女"
);
patient
.
setGender
(
IdcardUtil
.
getGenderByIdCard
(
patient
.
getCertId
())
==
1
?
"男"
:
"女"
);
// 手机号redis验证
// 手机号redis验证
// 根据手机号去重
// 获取家庭医生签约信息
// 获取家庭医生签约信息
try
{
try
{
String
familyDocHos
=
WanDaHttpUtil
.
getContractInfo
(
patient
.
getCertId
());
String
familyDocHos
=
WanDaHttpUtil
.
getContractInfo
(
patient
.
getCertId
());
...
@@ -137,7 +140,16 @@ public class HphyPatientBaseController {
...
@@ -137,7 +140,16 @@ public class HphyPatientBaseController {
}
}
// 获取患者信息
// 获取患者信息
HphyPatientBase
base
=
hphyPatientBaseService
.
getByOpenId
(
current
.
getOpenId
());
HphyPatientBase
base
=
hphyPatientBaseService
.
getByOpenId
(
current
.
getOpenId
());
log
.
error
(
"third-party.base1 = {}"
,
JSONUtil
.
toJsonStr
(
base
));
// 根据手机号去重
if
(
ObjectUtil
.
isNull
(
base
)
||
NumberUtil
.
isNullOrZero
(
base
.
getId
()))
{
base
=
hphyPatientBaseService
.
getByPhone
(
current
.
getPhone
(),
true
);
if
(
NumberUtil
.
isNotNullOrZero
(
base
.
getId
())){
HphyPatientBase
update
=
new
HphyPatientBase
();
update
.
setOpenId
(
current
.
getOpenId
());
update
.
setId
(
base
.
getId
());
hphyPatientBaseService
.
updateById
(
update
);
}
}
if
(
ObjectUtil
.
isNull
(
base
)
||
NumberUtil
.
isNullOrZero
(
base
.
getId
()))
{
if
(
ObjectUtil
.
isNull
(
base
)
||
NumberUtil
.
isNullOrZero
(
base
.
getId
()))
{
if
(
LoginTypeEnum
.
SSB
.
getType
().
equals
(
source
))
{
if
(
LoginTypeEnum
.
SSB
.
getType
().
equals
(
source
))
{
WDUserInfo
userInfo
=
SsbUtil
.
getUserInfo
(
token
);
WDUserInfo
userInfo
=
SsbUtil
.
getUserInfo
(
token
);
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientRelationController.java
0 → 100644
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
controller
.
mp
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.sh.stc.sict.cloud.common.core.util.NumberUtil
;
import
cn.sh.stc.sict.cloud.common.core.util.R
;
import
cn.sh.stc.sict.cloud.common.security.util.SecurityUtils
;
import
cn.sh.stc.sict.cloud.upms.dto.CurrentUser
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientRelation
;
import
cn.sh.stc.sict.theme.hphy.service.HphyPatientBaseService
;
import
cn.sh.stc.sict.theme.hphy.service.HphyPatientRelationService
;
import
cn.sh.stc.sict.theme.hphy.vo.PatientRelationDTO
;
import
cn.sh.stc.sict.theme.hphy.vo.PatientRelationVO
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 患者-家庭成员关系表(HphyPatientRelation)表控制层
*
* @author F_xh
* @since 2022-10-10 14:41:04
*/
@Slf4j
@RestController
@AllArgsConstructor
@Api
(
tags
=
"[C]患者-家庭成员关系表"
)
@RequestMapping
(
"/hphyPatientRelation"
)
public
class
HphyPatientRelationController
{
/**
* 服务对象
*/
private
final
HphyPatientRelationService
hphyPatientRelationService
;
private
final
HphyPatientBaseService
hphyPatientBaseService
;
@ApiOperation
(
"获取自己的家庭成员"
)
@GetMapping
(
"/list"
)
public
R
list
()
{
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
HphyPatientBase
base
=
hphyPatientBaseService
.
getByOpenId
(
current
.
getOpenId
());
if
(
ObjectUtil
.
isNull
(
base
)
||
NumberUtil
.
isNullOrZero
(
base
.
getId
()))
{
return
new
R
();
}
List
<
PatientRelationVO
>
result
=
hphyPatientRelationService
.
listPatientRelation
(
base
.
getId
());
return
new
R
(
result
);
}
@ApiOperation
(
"新增家庭成员"
)
@PostMapping
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
R
insert
(
@RequestBody
PatientRelationDTO
dto
)
{
HphyPatientBase
base
=
hphyPatientBaseService
.
getCurrentBase
();
if
(
ObjectUtil
.
isNull
(
base
)
||
NumberUtil
.
isNullOrZero
(
base
.
getId
()))
{
return
new
R
().
error
(
"当前登陆人信息异常"
);
}
if
(
StrUtil
.
isBlank
(
dto
.
getPatient
().
getName
()))
{
return
new
R
().
error
(
"姓名不可为空!"
);
}
if
(
StrUtil
.
isBlank
(
dto
.
getPatient
().
getCertId
()))
{
return
new
R
().
error
(
"身份证号不可为空!"
);
}
if
(
StrUtil
.
isBlank
(
dto
.
getRelation
().
getRelationName
()))
{
return
new
R
().
error
(
"关系不可为空!"
);
}
if
(
StrUtil
.
isBlank
(
dto
.
getPatient
().
getPhone
()))
{
return
new
R
().
error
(
"手机号不可为空!"
);
}
hphyPatientBaseService
.
savePatient
(
dto
.
getPatient
());
dto
.
getRelation
().
setSourcePatientId
(
base
.
getId
());
dto
.
getRelation
().
setTargetPatientId
(
dto
.
getPatient
().
getId
());
LambdaQueryWrapper
<
HphyPatientRelation
>
wrapper
=
Wrappers
.
lambdaQuery
();
wrapper
.
and
(
i
->
i
.
eq
(
HphyPatientRelation:
:
getSourcePatientId
,
base
.
getId
()).
eq
(
HphyPatientRelation:
:
getTargetPatientId
,
dto
.
getPatient
().
getId
()))
.
or
().
and
(
i
->
i
.
eq
(
HphyPatientRelation:
:
getSourcePatientId
,
dto
.
getPatient
().
getId
()).
eq
(
HphyPatientRelation:
:
getTargetPatientId
,
base
.
getId
()));
hphyPatientRelationService
.
saveOrUpdate
(
dto
.
getRelation
(),
wrapper
);
return
new
R
();
}
@ApiOperation
(
"删除关系"
)
@DeleteMapping
(
"/{relationId}"
)
public
R
delete
(
@PathVariable
Long
relationId
)
{
HphyPatientRelation
relation
=
hphyPatientRelationService
.
getById
(
relationId
);
if
(
ObjectUtil
.
isNull
(
relation
)
||
NumberUtil
.
isNullOrZero
(
relation
.
getId
()))
{
return
new
R
().
error
(
"未找到待删除项!"
);
}
hphyPatientRelationService
.
removeById
(
relationId
);
return
new
R
();
}
}
\ No newline at end of file
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/AppEvaController.java
0 → 100644
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
controller
.
web
;
import
cn.hutool.core.util.StrUtil
;
import
cn.sh.stc.sict.cloud.common.core.util.R
;
import
cn.sh.stc.sict.theme.hpgp.model.HpAppointmentEva
;
import
cn.sh.stc.sict.theme.hpgp.service.HpAppointmentEvaService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
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.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
@Slf4j
@RestController
@AllArgsConstructor
@Api
(
tags
=
"[B]预约评价"
)
@RequestMapping
(
"/app/eva"
)
public
class
AppEvaController
{
private
final
HpAppointmentEvaService
hpAppointmentEvaService
;
@ApiOperation
(
"分页"
)
@GetMapping
(
"/page"
)
public
R
hasEavedPage
(
Page
page
,
HpAppointmentEva
eva
)
{
LambdaQueryWrapper
<
HpAppointmentEva
>
wrapper
=
Wrappers
.
lambdaQuery
();
wrapper
.
like
(
StrUtil
.
isNotBlank
(
eva
.
getPatientName
()),
HpAppointmentEva:
:
getPatientName
,
eva
.
getPatientName
())
.
like
(
StrUtil
.
isNotBlank
(
eva
.
getHospName
()),
HpAppointmentEva:
:
getHospName
,
eva
.
getHospName
())
.
like
(
StrUtil
.
isNotBlank
(
eva
.
getDeptName
()),
HpAppointmentEva:
:
getDeptName
,
eva
.
getDeptName
())
.
like
(
StrUtil
.
isNotBlank
(
eva
.
getDoctorName
()),
HpAppointmentEva:
:
getDoctorName
,
eva
.
getDoctorName
())
.
orderByDesc
(
HpAppointmentEva:
:
getCreateTime
);
return
new
R
(
hpAppointmentEvaService
.
page
(
page
,
wrapper
));
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/GuideRecordController.java
View file @
4e9a8dfb
...
@@ -35,10 +35,16 @@ public class GuideRecordController {
...
@@ -35,10 +35,16 @@ public class GuideRecordController {
@ApiOperation
(
"分页查询"
)
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
public
R
<
HphyGuideRecord
>
page
(
Page
page
,
String
patientName
,
String
disease
){
public
R
<
HphyGuideRecord
>
page
(
Page
page
,
String
patientName
,
String
disease
,
String
hospName
,
String
deptName
,
String
doctorName
){
LambdaQueryWrapper
<
HphyGuideRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
HphyGuideRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
like
(
StrUtil
.
isNotBlank
(
patientName
),
HphyGuideRecord:
:
getPatientName
,
patientName
)
wrapper
.
like
(
StrUtil
.
isNotBlank
(
patientName
),
HphyGuideRecord:
:
getPatientName
,
patientName
)
.
like
(
StrUtil
.
isNotBlank
(
disease
),
HphyGuideRecord:
:
getDisease
,
disease
)
.
like
(
StrUtil
.
isNotBlank
(
disease
),
HphyGuideRecord:
:
getDisease
,
disease
)
// .like(StrUtil.isNotBlank(hospName), HphyGuideRecord)
.
orderByDesc
(
HphyGuideRecord:
:
getUpdateTime
,
HphyGuideRecord:
:
getCreateTime
);
.
orderByDesc
(
HphyGuideRecord:
:
getUpdateTime
,
HphyGuideRecord:
:
getCreateTime
);
page
=
hphyGuideRecordService
.
page
(
page
,
wrapper
);
page
=
hphyGuideRecordService
.
page
(
page
,
wrapper
);
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpAppointmentController.java
View file @
4e9a8dfb
...
@@ -37,9 +37,15 @@ public class HpAppointmentController extends ApiController {
...
@@ -37,9 +37,15 @@ public class HpAppointmentController extends ApiController {
@ApiOperation
(
"分页查询 - 预约记录"
)
@ApiOperation
(
"分页查询 - 预约记录"
)
@GetMapping
(
"/app/page"
)
@GetMapping
(
"/app/page"
)
public
R
appPage
(
Page
page
,
public
R
appPage
(
Page
page
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"hospName"
,
required
=
false
)
String
hospName
,
@RequestParam
(
value
=
"deptName"
,
required
=
false
)
String
deptName
,
@RequestParam
(
value
=
"doctorName"
,
required
=
false
)
String
doctorName
)
{
LambdaQueryWrapper
<
HpAppointment
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
HpAppointment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
like
(
StrUtil
.
isNotBlank
(
name
),
HpAppointment:
:
getPatientName
,
name
)
wrapper
.
like
(
StrUtil
.
isNotBlank
(
name
),
HpAppointment:
:
getPatientName
,
name
)
.
like
(
StrUtil
.
isNotBlank
(
hospName
),
HpAppointment:
:
getHosOrgName
,
hospName
)
.
like
(
StrUtil
.
isNotBlank
(
doctorName
),
HpAppointment:
:
getDoctorName
,
doctorName
)
.
like
(
StrUtil
.
isNotBlank
(
deptName
),
HpAppointment:
:
getDeptName
,
deptName
)
.
orderByDesc
(
HpAppointment:
:
getCreateTime
);
.
orderByDesc
(
HpAppointment:
:
getCreateTime
);
page
=
hpAppointmentService
.
page
(
page
,
wrapper
);
page
=
hpAppointmentService
.
page
(
page
,
wrapper
);
...
@@ -49,10 +55,16 @@ public class HpAppointmentController extends ApiController {
...
@@ -49,10 +55,16 @@ public class HpAppointmentController extends ApiController {
@ApiOperation
(
"分页查询 - 取消预约记录"
)
@ApiOperation
(
"分页查询 - 取消预约记录"
)
@GetMapping
(
"/cancel/page"
)
@GetMapping
(
"/cancel/page"
)
public
R
cancelPage
(
Page
page
,
public
R
cancelPage
(
Page
page
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
{
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"hospName"
,
required
=
false
)
String
hospName
,
@RequestParam
(
value
=
"deptName"
,
required
=
false
)
String
deptName
,
@RequestParam
(
value
=
"doctorName"
,
required
=
false
)
String
doctorName
)
{
LambdaQueryWrapper
<
HpAppointment
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
HpAppointment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
HpAppointment:
:
getStatus
,
Constant
.
BYTE_YES
)
wrapper
.
eq
(
HpAppointment:
:
getStatus
,
Constant
.
BYTE_YES
)
.
like
(
StrUtil
.
isNotBlank
(
name
),
HpAppointment:
:
getPatientName
,
name
)
.
like
(
StrUtil
.
isNotBlank
(
name
),
HpAppointment:
:
getPatientName
,
name
)
.
like
(
StrUtil
.
isNotBlank
(
hospName
),
HpAppointment:
:
getHosOrgName
,
hospName
)
.
like
(
StrUtil
.
isNotBlank
(
doctorName
),
HpAppointment:
:
getDoctorName
,
doctorName
)
.
like
(
StrUtil
.
isNotBlank
(
deptName
),
HpAppointment:
:
getDeptName
,
deptName
)
.
orderByDesc
(
HpAppointment:
:
getCreateTime
);
.
orderByDesc
(
HpAppointment:
:
getCreateTime
);
page
=
hpAppointmentService
.
page
(
page
,
wrapper
);
page
=
hpAppointmentService
.
page
(
page
,
wrapper
);
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HphyGuideMatchController.java
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
controller
.
web
;
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
controller
.
web
;
import
cn.hutool.core.util.StrUtil
;
import
cn.sh.stc.sict.cloud.common.core.util.R
;
import
cn.sh.stc.sict.cloud.common.core.util.R
;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideMatch
;
import
cn.sh.stc.sict.theme.hphy.model.HphyGuideMatch
;
import
cn.sh.stc.sict.theme.hphy.service.HphyGuideMatchService
;
import
cn.sh.stc.sict.theme.hphy.service.HphyGuideMatchService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -34,13 +36,19 @@ public class HphyGuideMatchController {
...
@@ -34,13 +36,19 @@ public class HphyGuideMatchController {
* 分页查询
* 分页查询
*
*
* @param page 分页对象
* @param page 分页对象
* @param hphyGuideMatch 导医推荐记录
* @return
* @return
*/
*/
@ApiOperation
(
"分页查询 导医推荐记录"
)
@ApiOperation
(
"分页查询 导医推荐记录"
)
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
public
R
<
HphyGuideMatch
>
getHphyGuideMatchPage
(
Page
page
,
HphyGuideMatch
hphyGuideMatch
)
{
public
R
<
HphyGuideMatch
>
getHphyGuideMatchPage
(
Page
page
,
HphyGuideMatch
guide
)
{
page
=
hphyGuideMatchService
.
page
(
page
,
Wrappers
.
query
(
hphyGuideMatch
));
LambdaQueryWrapper
<
HphyGuideMatch
>
wrapper
=
Wrappers
.
lambdaQuery
();
wrapper
.
like
(
StrUtil
.
isNotBlank
(
guide
.
getPatientName
()),
HphyGuideMatch:
:
getPatientName
,
guide
.
getPatientName
())
.
like
(
StrUtil
.
isNotBlank
(
guide
.
getHospName
()),
HphyGuideMatch:
:
getHospName
,
guide
.
getHospName
())
.
like
(
StrUtil
.
isNotBlank
(
guide
.
getDeptName
()),
HphyGuideMatch:
:
getDeptName
,
guide
.
getDeptName
())
.
like
(
StrUtil
.
isNotBlank
(
guide
.
getDoctorName
()),
HphyGuideMatch:
:
getDoctorName
,
guide
.
getDoctorName
())
.
orderByDesc
(
HphyGuideMatch:
:
getCreateTime
);
page
=
hphyGuideMatchService
.
page
(
page
,
wrapper
);
return
new
R
(
page
);
return
new
R
(
page
);
}
}
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HphyPatientRelationMapper.java
0 → 100644
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
dao
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientRelation
;
import
cn.sh.stc.sict.theme.hphy.vo.PatientRelationVO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 患者-家庭成员关系表(HphyPatientRelation)表数据库访问层
*
* @author F_xh
* @since 2022-10-10 14:41:03
*/
public
interface
HphyPatientRelationMapper
extends
BaseMapper
<
HphyPatientRelation
>
{
List
<
PatientRelationVO
>
listPatientRelation
(
@Param
(
"patientId"
)
Long
patientId
);
}
\ No newline at end of file
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HphyGuideMatch.java
View file @
4e9a8dfb
...
@@ -28,57 +28,57 @@ public class HphyGuideMatch extends Model<HphyGuideMatch> {
...
@@ -28,57 +28,57 @@ public class HphyGuideMatch extends Model<HphyGuideMatch> {
* id
* id
*/
*/
@TableId
@TableId
@ApiModelProperty
(
hidden
=
false
,
value
=
"id"
)
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
private
Long
id
;
/**
/**
* 患者id
* 患者id
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"患者id"
)
@ApiModelProperty
(
value
=
"患者id"
)
private
Long
patientId
;
private
Long
patientId
;
/**
/**
* 患者name
* 患者name
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"患者name"
)
@ApiModelProperty
(
value
=
"患者name"
)
private
String
patientName
;
private
String
patientName
;
/**
/**
* 导医id
* 导医id
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"导医id"
)
@ApiModelProperty
(
value
=
"导医id"
)
private
Long
guideId
;
private
Long
guideId
;
/**
/**
* 医院id
* 医院id
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"医院id"
)
@ApiModelProperty
(
value
=
"医院id"
)
private
String
hospId
;
private
String
hospId
;
/**
/**
* 医院name
* 医院name
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"医院name"
)
@ApiModelProperty
(
value
=
"医院name"
)
private
String
hospName
;
private
String
hospName
;
/**
/**
* 科室id
* 科室id
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"科室id"
)
@ApiModelProperty
(
value
=
"科室id"
)
private
String
deptId
;
private
String
deptId
;
/**
/**
* 科室name
* 科室name
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"科室name"
)
@ApiModelProperty
(
value
=
"科室name"
)
private
String
deptName
;
private
String
deptName
;
/**
/**
* 医生id
* 医生id
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"医生id"
)
@ApiModelProperty
(
value
=
"医生id"
)
private
String
doctorId
;
private
String
doctorId
;
/**
/**
* 医生name
* 医生name
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"医生name"
)
@ApiModelProperty
(
value
=
"医生name"
)
private
String
doctorName
;
private
String
doctorName
;
/**
/**
* 匹配度(%)
* 匹配度(%)
*/
*/
@ApiModelProperty
(
hidden
=
false
,
value
=
"匹配度(%)"
)
@ApiModelProperty
(
value
=
"匹配度(%)"
)
private
String
matchScore
;
private
String
matchScore
;
/**
/**
* 创建时间
* 创建时间
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HphyPatientRelation.java
0 → 100644
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
model
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 患者-家庭成员关系表(HphyPatientRelation)表实体类
*
* @author F_xh
* @since 2022-10-10 14:41:03
*/
@Data
@SuppressWarnings
(
"serial"
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
HphyPatientRelation
extends
Model
<
HphyPatientRelation
>
{
private
Long
id
;
private
Long
sourcePatientId
;
private
Long
targetPatientId
;
private
String
relationCode
;
private
String
relationName
;
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
String
createUserName
;
@TableField
(
fill
=
FieldFill
.
UPDATE
)
private
Date
updateTime
;
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
String
updateUserName
;
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
\ No newline at end of file
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HphyPatientBaseService.java
View file @
4e9a8dfb
...
@@ -17,6 +17,12 @@ import java.util.List;
...
@@ -17,6 +17,12 @@ import java.util.List;
public
interface
HphyPatientBaseService
extends
IService
<
HphyPatientBase
>
{
public
interface
HphyPatientBaseService
extends
IService
<
HphyPatientBase
>
{
HphyPatientBase
getByOpenId
(
String
openId
);
HphyPatientBase
getByOpenId
(
String
openId
);
HphyPatientBase
getByPhone
(
String
phone
,
Boolean
flag
);
HphyPatientBase
saveSSbInfo
(
CurrentUser
current
,
WDUserInfo
userInfo
,
List
<
WDUserCardInfo
>
cardList
);
HphyPatientBase
saveSSbInfo
(
CurrentUser
current
,
WDUserInfo
userInfo
,
List
<
WDUserCardInfo
>
cardList
);
void
savePatient
(
HphyPatientBase
patient
);
HphyPatientBase
getCurrentBase
();
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HphyPatientRelationService.java
0 → 100644
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
service
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientRelation
;
import
cn.sh.stc.sict.theme.hphy.vo.PatientRelationVO
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* 患者-家庭成员关系表(HphyPatientRelation)表服务接口
*
* @author F_xh
* @since 2022-10-10 14:41:04
*/
public
interface
HphyPatientRelationService
extends
IService
<
HphyPatientRelation
>
{
List
<
PatientRelationVO
>
listPatientRelation
(
Long
patientId
);
}
\ No newline at end of file
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HphyPatientBaseServiceImpl.java
View file @
4e9a8dfb
...
@@ -6,6 +6,8 @@ import cn.hutool.core.util.ObjectUtil;
...
@@ -6,6 +6,8 @@ import cn.hutool.core.util.ObjectUtil;
import
cn.sh.stc.sict.cloud.common.core.constant.Constant
;
import
cn.sh.stc.sict.cloud.common.core.constant.Constant
;
import
cn.sh.stc.sict.cloud.common.core.dto.WDUserCardInfo
;
import
cn.sh.stc.sict.cloud.common.core.dto.WDUserCardInfo
;
import
cn.sh.stc.sict.cloud.common.core.dto.WDUserInfo
;
import
cn.sh.stc.sict.cloud.common.core.dto.WDUserInfo
;
import
cn.sh.stc.sict.cloud.common.core.util.NumberUtil
;
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.dto.CurrentUser
;
import
cn.sh.stc.sict.theme.hphy.dao.HphyPatientBaseMapper
;
import
cn.sh.stc.sict.theme.hphy.dao.HphyPatientBaseMapper
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
...
@@ -32,6 +34,17 @@ public class HphyPatientBaseServiceImpl extends ServiceImpl<HphyPatientBaseMappe
...
@@ -32,6 +34,17 @@ public class HphyPatientBaseServiceImpl extends ServiceImpl<HphyPatientBaseMappe
return
this
.
getOne
(
wrapper
);
return
this
.
getOne
(
wrapper
);
}
}
@Override
public
HphyPatientBase
getByPhone
(
String
phone
,
Boolean
flag
)
{
LambdaQueryWrapper
<
HphyPatientBase
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
HphyPatientBase:
:
getPhone
,
phone
)
.
isNull
(
flag
,
HphyPatientBase:
:
getOpenId
)
.
orderByDesc
(
HphyPatientBase:
:
getUpdateTime
)
.
last
(
"limit 1"
);
return
this
.
getOne
(
wrapper
);
}
@Override
@Override
public
HphyPatientBase
saveSSbInfo
(
CurrentUser
current
,
WDUserInfo
userInfo
,
List
<
WDUserCardInfo
>
cardList
)
{
public
HphyPatientBase
saveSSbInfo
(
CurrentUser
current
,
WDUserInfo
userInfo
,
List
<
WDUserCardInfo
>
cardList
)
{
if
(
ObjectUtil
.
isNotNull
(
userInfo
))
{
if
(
ObjectUtil
.
isNotNull
(
userInfo
))
{
...
@@ -44,7 +57,7 @@ public class HphyPatientBaseServiceImpl extends ServiceImpl<HphyPatientBaseMappe
...
@@ -44,7 +57,7 @@ public class HphyPatientBaseServiceImpl extends ServiceImpl<HphyPatientBaseMappe
base
.
setAge
(
String
.
valueOf
(
IdcardUtil
.
getAgeByIdCard
(
userInfo
.
getPersoncard
())));
base
.
setAge
(
String
.
valueOf
(
IdcardUtil
.
getAgeByIdCard
(
userInfo
.
getPersoncard
())));
base
.
setGender
(
Constant
.
BYTE_YES
.
equals
(
userInfo
.
getGender
())
?
"男"
:
"女"
);
base
.
setGender
(
Constant
.
BYTE_YES
.
equals
(
userInfo
.
getGender
())
?
"男"
:
"女"
);
base
.
setVerifyStatus
(
userInfo
.
getVerifyStatus
());
base
.
setVerifyStatus
(
userInfo
.
getVerifyStatus
());
if
(
CollUtil
.
isNotEmpty
(
cardList
))
{
if
(
CollUtil
.
isNotEmpty
(
cardList
))
{
WDUserCardInfo
card
=
cardList
.
get
(
0
);
WDUserCardInfo
card
=
cardList
.
get
(
0
);
base
.
setMediCardId
(
card
.
getCardNo
());
base
.
setMediCardId
(
card
.
getCardNo
());
base
.
setMediCardType
(
card
.
getCardType
());
base
.
setMediCardType
(
card
.
getCardType
());
...
@@ -55,4 +68,33 @@ public class HphyPatientBaseServiceImpl extends ServiceImpl<HphyPatientBaseMappe
...
@@ -55,4 +68,33 @@ public class HphyPatientBaseServiceImpl extends ServiceImpl<HphyPatientBaseMappe
}
}
return
null
;
return
null
;
}
}
@Override
public
void
savePatient
(
HphyPatientBase
patient
)
{
HphyPatientBase
base
=
this
.
getByCertId
(
patient
.
getCertId
());
if
(
ObjectUtil
.
isNull
(
base
)
||
NumberUtil
.
isNullOrZero
(
base
.
getId
()))
{
base
=
this
.
getByPhone
(
patient
.
getPhone
(),
false
);
}
if
(
ObjectUtil
.
isNotNull
(
base
)
&&
NumberUtil
.
isNotNullOrZero
(
base
.
getId
()))
{
patient
.
setId
(
base
.
getId
());
this
.
updateById
(
patient
);
}
else
{
this
.
save
(
patient
);
}
}
private
HphyPatientBase
getByCertId
(
String
certId
)
{
LambdaQueryWrapper
<
HphyPatientBase
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
HphyPatientBase:
:
getCertId
,
certId
)
.
orderByDesc
(
HphyPatientBase:
:
getUpdateTime
)
.
last
(
"limit 1"
);
return
this
.
getOne
(
wrapper
);
}
@Override
public
HphyPatientBase
getCurrentBase
()
{
CurrentUser
current
=
SecurityUtils
.
getCurrentUser
();
return
this
.
getByOpenId
(
current
.
getOpenId
());
}
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HphyPatientRelationServiceImpl.java
0 → 100644
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
service
.
impl
;
import
cn.sh.stc.sict.theme.hphy.dao.HphyPatientRelationMapper
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientRelation
;
import
cn.sh.stc.sict.theme.hphy.service.HphyPatientRelationService
;
import
cn.sh.stc.sict.theme.hphy.vo.PatientRelationVO
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.AllArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 患者-家庭成员关系表(HphyPatientRelation)表服务实现类
*
* @author F_xh
* @since 2022-10-10 14:41:04
*/
@AllArgsConstructor
@Service
(
"hphyPatientRelationService"
)
public
class
HphyPatientRelationServiceImpl
extends
ServiceImpl
<
HphyPatientRelationMapper
,
HphyPatientRelation
>
implements
HphyPatientRelationService
{
private
final
HphyPatientRelationMapper
hphyPatientRelationMapper
;
@Override
public
List
<
PatientRelationVO
>
listPatientRelation
(
Long
patientId
)
{
return
hphyPatientRelationMapper
.
listPatientRelation
(
patientId
);
}
}
\ No newline at end of file
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/PatientRelationDTO.java
0 → 100644
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
vo
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientRelation
;
import
lombok.Data
;
@Data
public
class
PatientRelationDTO
{
private
HphyPatientRelation
relation
;
private
HphyPatientBase
patient
;
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/PatientRelationVO.java
0 → 100644
View file @
4e9a8dfb
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
vo
;
import
cn.sh.stc.sict.theme.hphy.model.HphyPatientBase
;
import
lombok.Data
;
@Data
public
class
PatientRelationVO
extends
HphyPatientBase
{
private
Long
relationId
;
private
String
relationCode
;
private
String
relationName
;
}
smart-health-modules/theme-schema/src/main/resources/bootstrap-dev.yml
View file @
4e9a8dfb
...
@@ -20,3 +20,4 @@ spring:
...
@@ -20,3 +20,4 @@ spring:
logging
:
logging
:
level
:
level
:
cn.sh.stc.sict.theme.hpgp.dao
:
DEBUG
cn.sh.stc.sict.theme.hpgp.dao
:
DEBUG
cn.sh.stc.sict.theme.hphy.dao
:
DEBUG
smart-health-modules/theme-schema/src/main/resources/mapper/hphy/HphyPatientRelationMapper.xml
0 → 100644
View file @
4e9a8dfb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.sh.stc.sict.theme.hphy.dao.HphyPatientRelationMapper"
>
<resultMap
type=
"cn.sh.stc.sict.theme.hphy.model.HphyPatientRelation"
id=
"HphyPatientRelationMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"sourcePatientId"
column=
"source_patient_id"
/>
<result
property=
"targetPatientId"
column=
"target_patient_id"
/>
<result
property=
"relationCode"
column=
"relation_code"
/>
<result
property=
"relationName"
column=
"relation_name"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createUserName"
column=
"create_user_name"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"updateUserName"
column=
"update_user_name"
/>
</resultMap>
<select
id=
"listPatientRelation"
resultType=
"cn.sh.stc.sict.theme.hphy.vo.PatientRelationVO"
>
select r.id relationId,
r.relation_code relationCode,
r.relation_name relationName,
p.id,
p.user_id userId,
p.open_id openId,
p.patient_id patientId,
p.name,
p.gender,
p.age,
p.education,
p.current_address currentAddress,
p.marriage_status marriageStatus
, p.`avg_hospitalized_days` avgHospitalizedDays
, p.`insurance_type` insuranceType
, p.`nation`
, p.`blood_type` bloodType
, p.`resident_address` residentAddress
, p.`occupation`
, p.`cert_id` certId
, p.`update_time` updateTime
, p.`disease`
, p.`tag`
, p.`condition`
, p.`phone`
, p.`medi_card_id` mediCardId
, p.`medi_card_type` mediCardType
, p.`enterprise_name` enterpriseName
, p.`family_doc_hos` familyDocHos
, p.`verify_status` verifyStatus
from hphy_patient_relation r
join hphy_patient_base p on r.target_patient_id = p.id or r.source_patient_id = p.id
where (r.source_patient_id = #{patientId} or r.target_patient_id = #{patientId})
and p.id
<>
#{patientId}
</select>
</mapper>
\ No newline at end of file
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