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
894db9ad
Commit
894db9ad
authored
Jun 01, 2023
by
gaozhaochen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 敏感数据加密解密处理,卫管中心预约统计
parent
c6fc236d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
23 deletions
+71
-23
SysUserBaseServiceImpl.java
.../sict/cloud/upms/service/impl/SysUserBaseServiceImpl.java
+4
-2
EncryptionUtil.java
...va/cn/sh/stc/sict/theme/common/crypto/EncryptionUtil.java
+12
-12
HpGpIntelligentQAController.java
...e/hpgp/controller/mobile/HpGpIntelligentQAController.java
+17
-2
HpStatisticsController.java
...ict/theme/hphy/controller/web/HpStatisticsController.java
+0
-1
HpStatisticsMapper.java
...ava/cn/sh/stc/sict/theme/hphy/dao/HpStatisticsMapper.java
+10
-1
HpStatisticsServiceImpl.java
...sict/theme/hphy/service/impl/HpStatisticsServiceImpl.java
+12
-5
StatisticsUsageVO.java
.../java/cn/sh/stc/sict/theme/hphy/vo/StatisticsUsageVO.java
+4
-0
HpStatisticsMapper.xml
...ema/src/main/resources/mapper/hphy/HpStatisticsMapper.xml
+12
-0
No files found.
smart-health-modules/cloud-upms/cloud-upms-biz/src/main/java/cn/sh/stc/sict/cloud/upms/service/impl/SysUserBaseServiceImpl.java
View file @
894db9ad
...
...
@@ -89,7 +89,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
return
this
.
getByPhone
(
split
[
2
]);
// 随身办登陆
case
SSB:
return
this
.
getBySSBToken
(
split
[
0
],
split
[
2
]);
return
this
.
getBySSBToken
(
split
[
0
],
split
[
2
]
,
split
[
1
]
);
// 香山中医院公众号登陆
// inStr = 公众号标识符@公众号appId@token@hospitalCode
case
WOA_NL:
...
...
@@ -174,7 +174,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
}
private
UserInfo
getBySSBToken
(
String
source
,
String
token
)
{
private
UserInfo
getBySSBToken
(
String
source
,
String
token
,
String
appId
)
{
WDUserInfo
wdUser
=
SsbUtil
.
getUserInfo
(
token
);
log
.
error
(
"ssb.login.wdUser = {}"
,
JSONUtil
.
toJsonStr
(
wdUser
));
if
(
ObjectUtil
.
isNull
(
wdUser
)
||
StrUtil
.
isBlank
(
wdUser
.
getMobile
()))
{
...
...
@@ -196,6 +196,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
user
.
setStatus
(
Constant
.
BYTE_NO
);
user
.
setPasswd
(
ENCODER
.
encode
(
Constant
.
DEFAULT_PASSWORD
));
user
.
setPhone
(
wdUser
.
getMobile
());
user
.
setAppId
(
appId
);
this
.
save
(
user
);
// List<WDUserCardInfo> cardList = SsbUtil.getUserCardInfoList(token);
}
...
...
@@ -203,6 +204,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl<SysUserBaseMapper, SysUs
UserInfo
info
=
new
UserInfo
();
info
.
setSysUserBase
(
user
);
info
.
setOpenId
(
wdUser
.
getMobile
());
info
.
setAppId
(
appId
);
return
info
;
}
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/common/crypto/EncryptionUtil.java
View file @
894db9ad
...
...
@@ -52,17 +52,17 @@ public class EncryptionUtil {
}
public
static
void
main
(
String
[]
args
)
{
KeyPair
kp
=
SecureUtil
.
generateKeyPair
(
SIGN_TYPE_RSA
,
DEFAULT_RSA_KEY_SIZE
);
PublicKey
pbkey
=
kp
.
getPublic
();
PrivateKey
prkey
=
kp
.
getPrivate
();
String
pubkey
=
(
new
BASE64Encoder
()).
encode
(
pbkey
.
getEncoded
());
String
prikey
=
(
new
BASE64Encoder
()).
encode
(
prkey
.
getEncoded
());
//logger.info("{}生成秘钥成功,公钥:{},私钥:{}",appkey,pubkey,prikey);
Map
map
=
new
HashMap
();
map
.
put
(
"pub"
,
pubkey
);
map
.
put
(
"pri"
,
prikey
);
}
//
public static void main(String[] args) {
//
KeyPair kp = SecureUtil.generateKeyPair(SIGN_TYPE_RSA, DEFAULT_RSA_KEY_SIZE);
//
PublicKey pbkey = kp.getPublic();
//
PrivateKey prkey = kp.getPrivate();
//
String pubkey = (new BASE64Encoder()).encode(pbkey.getEncoded());
//
String prikey = (new BASE64Encoder()).encode(prkey.getEncoded());
//
//logger.info("{}生成秘钥成功,公钥:{},私钥:{}",appkey,pubkey,prikey);
//
Map map = new HashMap();
//
map.put("pub", pubkey);
//
map.put("pri", prikey);
//
//
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hpgp/controller/mobile/HpGpIntelligentQAController.java
View file @
894db9ad
...
...
@@ -11,6 +11,7 @@ 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.hpgp.vo.IntelligentAnswerVO
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.google.common.collect.Sets
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
...
...
@@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Map
;
import
java.util.Set
;
/**
* @author F_xh
...
...
@@ -32,6 +34,11 @@ import java.util.Map;
public
class
HpGpIntelligentQAController
{
private
final
static
String
CONTENT
=
"Content"
;
/**
* 打浦桥科室
*/
private
final
static
Set
<
String
>
DPQ_DEPARTMENT
=
Sets
.
newHashSet
(
"皮肤性病科"
,
"中医科"
,
"儿保科"
,
"全科医疗科"
);
@SysLog
@ApiOperation
(
"智能问答"
)
@PostMapping
...
...
@@ -57,10 +64,18 @@ public class HpGpIntelligentQAController {
log
.
error
(
"孙总接口返回 body = {}"
,
body
);
IntelligentAnswerVO
answerVO
=
new
IntelligentAnswerVO
();
Map
<
String
,
Object
>
result
=
XmlUtil
.
xmlToMap
(
body
);
if
(
result
.
containsKey
(
CONTENT
))
{
if
(
result
.
containsKey
(
CONTENT
))
{
answerVO
.
setAnswer
(
MapUtil
.
getStr
(
result
,
CONTENT
));
if
(
StrUtil
.
isNotBlank
(
current
.
getHospitalCode
())
&&
"42502942300"
.
equals
(
current
.
getHospitalCode
()))
{
if
(
StrUtil
.
isNotBlank
(
answerVO
.
getDeptName
())
&&
!
DPQ_DEPARTMENT
.
contains
(
answerVO
.
getDeptName
()))
{
String
oldDeptName
=
answerVO
.
getDeptName
();
answerVO
.
setAnswer
(
answerVO
.
getAnswer
().
replace
(
oldDeptName
,
"全科医疗科"
));
answerVO
.
setDeptName
(
"全科医疗科"
);
}
}
}
return
new
R
<>(
answerVO
);
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpStatisticsController.java
View file @
894db9ad
...
...
@@ -30,7 +30,6 @@ public class HpStatisticsController {
@ApiOperation
(
"统计用户使用情况"
)
@GetMapping
(
"/usage-overview"
)
@SecurityParameter
(
inDecode
=
false
)
public
R
statisticsUsage
(
@RequestParam
(
"startTime"
)
String
startTime
,
@RequestParam
(
"endTime"
)
String
endTime
)
{
log
.
error
(
"统计用户使用情况:startTime = {}, token = {}"
,
startTime
,
endTime
);
...
...
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpStatisticsMapper.java
View file @
894db9ad
...
...
@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author gao
...
...
@@ -42,6 +43,14 @@ public interface HpStatisticsMapper {
* @return
*/
Long
countLoginUser
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"appId"
)
String
appId
);
/**
* 统计卫管中心预约人数
*
* @return
*/
Map
<
String
,
Long
>
countHealthManagementCenter
();
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpStatisticsServiceImpl.java
View file @
894db9ad
...
...
@@ -2,16 +2,14 @@ package cn.sh.stc.sict.theme.hphy.service.impl;
import
cn.sh.stc.sict.theme.hphy.dao.HpAppointmentMapper
;
import
cn.sh.stc.sict.theme.hphy.dao.HpStatisticsMapper
;
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.service.HpStatisticsService
;
import
cn.sh.stc.sict.theme.hphy.vo.StatisticsUsageVO
;
import
lombok.AllArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
/**
* 黄埔医导用户使用情况查询
...
...
@@ -39,10 +37,19 @@ public class HpStatisticsServiceImpl implements HpStatisticsService {
@Override
public
StatisticsUsageVO
getUsageOverviewStatistics
(
String
startTime
,
String
endTime
)
{
Long
loginUserCount
=
hpStatisticsMapper
.
countLoginUser
(
startTime
,
endTime
);
Long
loginUserCount
=
hpStatisticsMapper
.
countLoginUser
(
startTime
,
endTime
,
null
);
Long
newUserCount
=
hpStatisticsMapper
.
countNewUser
(
startTime
,
endTime
);
List
<
StatisticsUsageVO
.
HosUsageStatistics
>
hosUsageStatisticsList
=
hpStatisticsMapper
.
queryAppointmentUserGroupByHos
(
startTime
,
endTime
);
return
StatisticsUsageVO
.
builder
().
newUserCount
(
newUserCount
).
loginUserCount
(
loginUserCount
).
hosAppointmentStatistics
(
hosUsageStatisticsList
).
build
();
// 统计卫管中心数据
Map
<
String
,
Long
>
hmcStatistics
=
hpStatisticsMapper
.
countHealthManagementCenter
();
Long
hmcloginUserCount
=
hpStatisticsMapper
.
countLoginUser
(
startTime
,
endTime
,
"wx24c55f38b535cd96"
);
hmcStatistics
.
put
(
"卫管中心登录人数"
,
hmcloginUserCount
);
return
StatisticsUsageVO
.
builder
()
.
newUserCount
(
newUserCount
)
.
loginUserCount
(
loginUserCount
)
.
hosAppointmentStatistics
(
hosUsageStatisticsList
)
.
healthManagementCenterStatistics
(
hmcStatistics
)
.
build
();
}
}
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/StatisticsUsageVO.java
View file @
894db9ad
...
...
@@ -5,6 +5,7 @@ import lombok.*;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Map
;
/**
* 统计用户使用详情
...
...
@@ -29,6 +30,9 @@ public class StatisticsUsageVO implements Serializable {
@ApiModelProperty
(
value
=
"医院预约人数"
)
private
List
<
HosUsageStatistics
>
hosAppointmentStatistics
;
@ApiModelProperty
(
value
=
"卫管中心入口数据统计"
)
private
Map
<
String
,
Long
>
healthManagementCenterStatistics
;
@Data
public
static
class
HosUsageStatistics
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1088663393589514198L
;
...
...
smart-health-modules/theme-schema/src/main/resources/mapper/hphy/HpStatisticsMapper.xml
View file @
894db9ad
...
...
@@ -53,10 +53,22 @@
</if>
<if
test=
"endTime != null and endTime != '' "
>
AND create_time
<
= #{endTime}
</if>
<if
test=
"appId != null and appId != '' "
>
AND create_by like concat('%',#{appId},'%')
</if>
AND `title` LIKE '%用户登录%'
AND `exception` = ''
</where>
</select>
<select
id=
"countHealthManagementCenter"
resultType=
"java.util.Map"
>
SELECT
COUNT(1) AS '卫管中心总预约次' ,
COUNT(IF(length(exception) = 0 OR exception IS NULL ,TRUE,NULL) ) AS '卫管中心成功预约次' ,
COUNT(IF(length(exception) >0,TRUE,NULL) ) AS '卫管中心失败预约次'
FROM `sys_log`
WHERE title = '预约' AND create_by like '%wx24c55f38b535cd96%'
</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