Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
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
be0b34f5
Commit
be0b34f5
authored
1 year ago
by
gaozhaochen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 向万达提供导诊指标查询接口
parent
dcf1c2c5
hpgp-m
hpgp
No related merge requests found
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
310 additions
and
5 deletions
+310
-5
HpStatisticsController.java
...ict/theme/hphy/controller/web/HpStatisticsController.java
+26
-5
HpStatisticsMapper.java
...ava/cn/sh/stc/sict/theme/hphy/dao/HpStatisticsMapper.java
+10
-0
HpThirdInterfaceStatusMapper.java
...stc/sict/theme/hphy/dao/HpThirdInterfaceStatusMapper.java
+38
-0
HpThirdInterfaceStatus.java
.../sh/stc/sict/theme/hphy/model/HpThirdInterfaceStatus.java
+44
-0
HpStatisticsService.java
...n/sh/stc/sict/theme/hphy/service/HpStatisticsService.java
+13
-0
HpThirdInterfaceStatusService.java
...ict/theme/hphy/service/HpThirdInterfaceStatusService.java
+19
-0
HpStatisticsServiceImpl.java
...sict/theme/hphy/service/impl/HpStatisticsServiceImpl.java
+12
-0
HpThirdInterfaceStatusServiceImpl.java
.../hphy/service/impl/HpThirdInterfaceStatusServiceImpl.java
+23
-0
HealthManagementStatisticVO.java
...h/stc/sict/theme/hphy/vo/HealthManagementStatisticVO.java
+37
-0
HpStatisticsMapper.xml
...ema/src/main/resources/mapper/hphy/HpStatisticsMapper.xml
+39
-0
HpThirdInterfaceStatusMapper.xml
...in/resources/mapper/hphy/HpThirdInterfaceStatusMapper.xml
+49
-0
No files found.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpStatisticsController.java
View file @
be0b34f5
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
controller
.
web
;
import
cn.sh.stc.sict.cloud.common.core.util.R
;
import
cn.sh.stc.sict.theme.annotation.SecurityParameter
;
import
cn.sh.stc.sict.cloud.common.log.annotation.SysLog
;
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.common.crypto.EncryptionUtil
;
import
cn.sh.stc.sict.theme.hphy.service.HpStatisticsService
;
import
cn.sh.stc.sict.theme.hphy.service.HpThirdInterfaceStatusService
;
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
;
import
org.springframework.web.bind.annotation.*
;
/**
* 黄埔医导统计
...
...
@@ -28,6 +28,8 @@ public class HpStatisticsController {
private
final
HpStatisticsService
hpStatisticsService
;
private
final
HpThirdInterfaceStatusService
hpThirdInterfaceStatusService
;
@ApiOperation
(
"统计用户使用情况"
)
@GetMapping
(
"/usage-overview"
)
public
R
statisticsUsage
(
@RequestParam
(
"startTime"
)
String
startTime
,
...
...
@@ -43,4 +45,23 @@ public class HpStatisticsController {
return
new
R
<>(
EncryptionUtil
.
PUBLIC_KEY
);
}
@ApiOperation
(
"第三方提供统计用户使用情况"
)
@GetMapping
(
"/third/usage-overview"
)
@SysLog
public
R
statisticsUsage4Third
(
@RequestParam
(
"startTime"
)
String
startTime
,
@RequestParam
(
"endTime"
)
String
endTime
)
{
CurrentUser
currentUser
=
SecurityUtils
.
getCurrentUser
();
log
.
error
(
"统计用户使用情况:startTime = {}, token = {}, currentUser = {}"
,
startTime
,
endTime
,
currentUser
.
getName
());
return
new
R
(
hpStatisticsService
.
countAll4Third
(
startTime
,
endTime
));
}
@ApiOperation
(
"更新医疗机构对接公众号状态"
)
@PutMapping
(
"/hos-org-mg-status"
)
@SysLog
public
R
updateHosOrgMgStatus
(
@RequestParam
(
"hosOrgCode"
)
String
hosOrgCode
,
@RequestParam
(
"status"
)
Integer
status
)
{
hpThirdInterfaceStatusService
.
updateHosOrgStatus
(
hosOrgCode
,
status
);
return
new
R
();
}
}
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpStatisticsMapper.java
View file @
be0b34f5
...
...
@@ -53,4 +53,14 @@ public interface HpStatisticsMapper {
*/
Map
<
String
,
Long
>
countHealthManagementCenter
();
/**
* 查询预约指标信息
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
List
<
Map
<
String
,
Object
>>
countAll4Third
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
}
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpThirdInterfaceStatusMapper.java
0 → 100644
View file @
be0b34f5
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
dao
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
cn.sh.stc.sict.theme.hphy.model.HpThirdInterfaceStatus
;
/**
* (HpThirdInterfaceStatus)表数据库访问层
*
* @author gao
* @since 2023-07-19 14:17:01
*/
public
interface
HpThirdInterfaceStatusMapper
extends
BaseMapper
<
HpThirdInterfaceStatus
>
{
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<HpThirdInterfaceStatus> 实例对象列表
* @return 影响行数
*/
int
insertBatch
(
@Param
(
"entities"
)
List
<
HpThirdInterfaceStatus
>
entities
);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<HpThirdInterfaceStatus> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
*/
int
insertOrUpdateBatch
(
@Param
(
"entities"
)
List
<
HpThirdInterfaceStatus
>
entities
);
void
updateStatusByHosCode
(
@Param
(
"hosOrgCode"
)
String
hosOrgCode
,
@Param
(
"status"
)
Integer
status
);
}
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpThirdInterfaceStatus.java
0 → 100644
View file @
be0b34f5
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
model
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* (HpThirdInterfaceStatus)表实体类
*
* @author gao
* @since 2023-07-19 14:17:02
*/
@SuppressWarnings
(
"serial"
)
@Data
public
class
HpThirdInterfaceStatus
extends
Model
<
HpThirdInterfaceStatus
>
{
private
Integer
id
;
//机构名称
private
String
hosOrgCode
;
//机构代码
private
String
hosOrgName
;
//对接状态(1-未对接;2-对接中;3-已对接)
private
Integer
interStatus
;
private
String
interDes
;
private
Date
createTime
;
private
Date
updateTime
;
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected
Serializable
pkVal
()
{
return
this
.
id
;
}
}
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpStatisticsService.java
View file @
be0b34f5
...
...
@@ -2,6 +2,9 @@ package cn.sh.stc.sict.theme.hphy.service;
import
cn.sh.stc.sict.theme.hphy.vo.StatisticsUsageVO
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author gao
* @date 2023/01/06 11:03
...
...
@@ -18,5 +21,15 @@ public interface HpStatisticsService {
StatisticsUsageVO
getUsageOverviewStatistics
(
String
startTime
,
String
endTime
);
/**
* 统计时间内的指标信息
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
List
<
Map
<
String
,
Object
>>
countAll4Third
(
String
startTime
,
String
endTime
);
}
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpThirdInterfaceStatusService.java
0 → 100644
View file @
be0b34f5
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
cn.sh.stc.sict.theme.hphy.model.HpThirdInterfaceStatus
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* (HpThirdInterfaceStatus)表服务接口
*
* @author gao
* @since 2023-07-19 14:17:06
*/
public
interface
HpThirdInterfaceStatusService
extends
IService
<
HpThirdInterfaceStatus
>
{
void
updateHosOrgStatus
(
String
hosOrgCode
,
Integer
status
);
}
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpStatisticsServiceImpl.java
View file @
be0b34f5
...
...
@@ -52,4 +52,16 @@ public class HpStatisticsServiceImpl implements HpStatisticsService {
.
healthManagementCenterStatistics
(
hmcStatistics
)
.
build
();
}
/**
* 统计时间内的指标信息
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return
*/
@Override
public
List
<
Map
<
String
,
Object
>>
countAll4Third
(
String
startTime
,
String
endTime
)
{
return
hpStatisticsMapper
.
countAll4Third
(
startTime
,
endTime
);
}
}
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpThirdInterfaceStatusServiceImpl.java
0 → 100644
View file @
be0b34f5
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
service
.
impl
;
import
cn.sh.stc.sict.theme.hphy.dao.HpThirdInterfaceStatusMapper
;
import
cn.sh.stc.sict.theme.hphy.model.HpThirdInterfaceStatus
;
import
cn.sh.stc.sict.theme.hphy.service.HpThirdInterfaceStatusService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
/**
* (HpThirdInterfaceStatus)表服务实现类
*
* @author gao
* @since 2023-07-19 14:17:09
*/
@Service
(
"hpThirdInterfaceStatusService"
)
public
class
HpThirdInterfaceStatusServiceImpl
extends
ServiceImpl
<
HpThirdInterfaceStatusMapper
,
HpThirdInterfaceStatus
>
implements
HpThirdInterfaceStatusService
{
@Override
public
void
updateHosOrgStatus
(
String
hosOrgCode
,
Integer
status
)
{
this
.
baseMapper
.
updateStatusByHosCode
(
hosOrgCode
,
status
);
}
}
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/HealthManagementStatisticVO.java
0 → 100644
View file @
be0b34f5
package
cn
.
sh
.
stc
.
sict
.
theme
.
hphy
.
vo
;
import
lombok.Data
;
/**
* 卫管中心统计结果数据
*
* @author gao
* @date 2023/07/19 10:27
*/
@Data
public
class
HealthManagementStatisticVO
{
/**
* 机构编码
*/
private
String
hospitalCode
;
/**
* 机构名称
*/
private
String
hospitalName
;
/**
* 导诊数
*/
private
String
consultationCount
;
/**
* 对接状态
* 1-未对接
* 2-对接中
* 3-已对接
*/
private
Byte
status
;
}
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/resources/mapper/hphy/HpStatisticsMapper.xml
View file @
be0b34f5
...
...
@@ -71,4 +71,43 @@
WHERE title = '预约' AND create_by like '%wx24c55f38b535cd96%'
</select>
<select
id=
"countAll4Third"
resultType=
"java.util.LinkedHashMap"
>
-- 统计各家医院预约人数
SELECT
IFNULL(c.appointment_count,0) AS '导诊数',
h.hos_org_code AS '医疗机构代码',
h.hos_name AS '医疗机构名称',
t.inter_des AS '对接状态'
FROM (
SELECT count(1) AS appointment_count, hos_org_code
FROM `hp_appointment`
<where>
<if
test=
"startTime != null and startTime != '' "
>
AND create_time >= #{startTime}
</if>
<if
test=
"endTime != null and endTime != '' "
>
AND create_time
<
= #{endTime}
</if>
</where>
GROUP BY hos_org_code
) c
RIGHT JOIN hp_hos_info h ON c.hos_org_code = h.hos_org_code
RIGHT JOIN hp_third_interface_status t ON h.hos_org_code = t.hos_org_code
UNION ALL
-- 统计卫管中心预约人数
SELECT
COUNT(1) AS '导诊数' ,
1 AS '医疗机构代码' ,
'卫管中心' AS '医疗机构名称',
'已对接' AS '对接状态'
FROM `sys_log`
WHERE title = '预约' AND create_by like '%wx24c55f38b535cd96%'
<if
test=
"startTime != null and startTime != '' "
>
AND create_time >= #{startTime}
</if>
<if
test=
"endTime != null and endTime != '' "
>
AND create_time
<
= #{endTime}
</if>
</select>
</mapper>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
smart-health-modules/theme-schema/src/main/resources/mapper/hphy/HpThirdInterfaceStatusMapper.xml
0 → 100644
View file @
be0b34f5
<?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.HpThirdInterfaceStatusMapper"
>
<resultMap
type=
"cn.sh.stc.sict.theme.hphy.model.HpThirdInterfaceStatus"
id=
"HpThirdInterfaceStatusMap"
>
<result
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<result
property=
"hosOrgCode"
column=
"hos_org_code"
jdbcType=
"VARCHAR"
/>
<result
property=
"hosOrgName"
column=
"hos_org_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"interStatus"
column=
"inter_status"
jdbcType=
"INTEGER"
/>
<result
property=
"interDes"
column=
"inter_des"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateTime"
column=
"update_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<!-- 批量插入 -->
<insert
id=
"insertBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into hp_third_interface_status(hos_org_code, hos_org_name, inter_status, inter_des, create_time, update_time)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.hosOrgCode}, #{entity.hosOrgName}, #{entity.interStatus}, #{entity.interDes}, #{entity.createTime}, #{entity.updateTime})
</foreach>
</insert>
<!-- 批量插入或按主键更新 -->
<insert
id=
"insertOrUpdateBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into hp_third_interface_status(hos_org_code, hos_org_name, inter_status, inter_des, create_time, update_time)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.hosOrgCode}, #{entity.hosOrgName}, #{entity.interStatus}, #{entity.interDes}, #{entity.createTime}, #{entity.updateTime})
</foreach>
on duplicate key update
hos_org_code = values(hos_org_code) , hos_org_name = values(hos_org_name) , inter_status = values(inter_status) , inter_des = values(inter_des) , create_time = values(create_time) , update_time = values(update_time)
</insert>
<update
id=
"updateStatusByHosCode"
>
UPDATE hp_third_interface_status set inter_status = #{status}
<choose>
<when
test=
"hosOrgCode == 1"
>
,inter_des = '未对接'
</when>
<when
test=
"hosOrgCode == 2"
>
,inter_des = '正在对接'
</when>
<when
test=
"hosOrgCode == 3"
>
,inter_des = '已对接'
</when>
</choose>
WHERE hos_org_code = #{hosOrgCode}
</update>
</mapper>
This diff is collapsed.
Click to expand it.
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