From a9b851b0f18832cd4171495e37f587d65cb66c75 Mon Sep 17 00:00:00 2001 From: gaozhaochen Date: Fri, 6 Jan 2023 17:04:09 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E7=BB=9F=E8=AE=A1=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E5=AF=BC=E8=AF=8A=E4=BD=BF=E7=94=A8=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sict/cloud/upms/model/SysUserBase.java | 5 ++ .../service/impl/SysUserBaseServiceImpl.java | 2 + .../web/HpStatisticsController.java | 51 +++++++++++++++ .../theme/hphy/dao/HpStatisticsMapper.java | 47 ++++++++++++++ .../hphy/service/HpStatisticsService.java | 22 +++++++ .../service/impl/HpStatisticsServiceImpl.java | 48 ++++++++++++++ .../sict/theme/hphy/vo/StatisticsUsageVO.java | 45 ++++++++++++++ .../mapper/hphy/HpStatisticsMapper.xml | 62 +++++++++++++++++++ 8 files changed, 282 insertions(+) create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/web/HpStatisticsController.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/dao/HpStatisticsMapper.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpStatisticsService.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpStatisticsServiceImpl.java create mode 100644 smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/StatisticsUsageVO.java create mode 100644 smart-health-modules/theme-schema/src/main/resources/mapper/hphy/HpStatisticsMapper.xml diff --git a/smart-health-modules/cloud-upms/cloud-upms-api/src/main/java/cn/sh/stc/sict/cloud/upms/model/SysUserBase.java b/smart-health-modules/cloud-upms/cloud-upms-api/src/main/java/cn/sh/stc/sict/cloud/upms/model/SysUserBase.java index ecd66e2..e04e345 100644 --- a/smart-health-modules/cloud-upms/cloud-upms-api/src/main/java/cn/sh/stc/sict/cloud/upms/model/SysUserBase.java +++ b/smart-health-modules/cloud-upms/cloud-upms-api/src/main/java/cn/sh/stc/sict/cloud/upms/model/SysUserBase.java @@ -32,6 +32,11 @@ public class SysUserBase extends Model { @ApiModelProperty(value = "用户id") private Long id; + /** + * 公众号appId + */ + private String appId; + private String openId; /** diff --git a/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/java/cn/sh/stc/sict/cloud/upms/service/impl/SysUserBaseServiceImpl.java b/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/java/cn/sh/stc/sict/cloud/upms/service/impl/SysUserBaseServiceImpl.java index e7c8ddf..056f84a 100644 --- a/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/java/cn/sh/stc/sict/cloud/upms/service/impl/SysUserBaseServiceImpl.java +++ b/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/java/cn/sh/stc/sict/cloud/upms/service/impl/SysUserBaseServiceImpl.java @@ -108,6 +108,7 @@ public class SysUserBaseServiceImpl extends ServiceImpl queryAppointmentUserGroupByHos(@Param("startTime") String startTime, + @Param("endTime") String endTime); + + /** + * 统计新增用户 + * + * @param startTime + * @param endTime + * @return + */ + Long countNewUser(@Param("startTime") String startTime, + @Param("endTime") String endTime); + + + /** + * 统计登录用户 + * + * @param startTime + * @param endTime + * @return + */ + Long countLoginUser(@Param("startTime") String startTime, + @Param("endTime") String endTime); + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpStatisticsService.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpStatisticsService.java new file mode 100644 index 0000000..111ce17 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/HpStatisticsService.java @@ -0,0 +1,22 @@ +package cn.sh.stc.sict.theme.hphy.service; + +import cn.sh.stc.sict.theme.hphy.vo.StatisticsUsageVO; + +/** + * @author gao + * @date 2023/01/06 11:03 + */ +public interface HpStatisticsService { + + /** + * 获取使用情况概览统计信息 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return + */ + StatisticsUsageVO getUsageOverviewStatistics(String startTime, + String endTime); + + +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpStatisticsServiceImpl.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpStatisticsServiceImpl.java new file mode 100644 index 0000000..da4e1ae --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/service/impl/HpStatisticsServiceImpl.java @@ -0,0 +1,48 @@ +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; + +/** + * 黄埔医导用户使用情况查询 + * + * @author gao + * @date 2023/01/06 11:04 + */ +@Service("hpStatisticsService") +@AllArgsConstructor +public class HpStatisticsServiceImpl implements HpStatisticsService { + + @Autowired + private final HpStatisticsMapper hpStatisticsMapper; + + @Autowired + private final HpAppointmentMapper hpAppointmentMapper; + + /** + * 获取使用情况概览统计信息 + * + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return + */ + @Override + public StatisticsUsageVO getUsageOverviewStatistics(String startTime, String endTime) { + + Long loginUserCount = hpStatisticsMapper.countLoginUser(startTime, endTime); + Long newUserCount = hpStatisticsMapper.countNewUser(startTime, endTime); + List hosUsageStatisticsList = hpStatisticsMapper.queryAppointmentUserGroupByHos(startTime, endTime); + + return StatisticsUsageVO.builder().newUserCount(newUserCount).loginUserCount(loginUserCount).hosAppointmentStatistics(hosUsageStatisticsList).build(); + } +} diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/StatisticsUsageVO.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/StatisticsUsageVO.java new file mode 100644 index 0000000..b34152c --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/vo/StatisticsUsageVO.java @@ -0,0 +1,45 @@ +package cn.sh.stc.sict.theme.hphy.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.*; + +import java.io.Serializable; +import java.util.List; + +/** + * 统计用户使用详情 + * + * @author gao + * @date 2023/01/06 10:58 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor(access = AccessLevel.PRIVATE) +public class StatisticsUsageVO implements Serializable { + + private static final long serialVersionUID = -279866011612238581L; + + @ApiModelProperty(value = "登录总人数") + private Long loginUserCount; + + @ApiModelProperty(value = "新增用户总人数") + private Long newUserCount; + + @ApiModelProperty(value = "医院预约人数") + private List hosAppointmentStatistics; + + @Data + public static class HosUsageStatistics implements Serializable { + private static final long serialVersionUID = -1088663393589514198L; + + @ApiModelProperty(value = "医院编码") + private String hospitalCode; + + @ApiModelProperty(value = "医院名称") + private String hospitalName; + + @ApiModelProperty(value = "医院预约人数") + private Long appointmentUserCount; + } +} diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/hphy/HpStatisticsMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/hphy/HpStatisticsMapper.xml new file mode 100644 index 0000000..f64b341 --- /dev/null +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/hphy/HpStatisticsMapper.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.22.0