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 ecd66e229b3f74b5f42dd519717c7a5e6c7d3064..e04e345a8f4a3afd251600908eb8ec59a75269ef 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 e7c8ddf62e9582f442f9d7a7972a83fa203faef7..056f84a3e022634a15a4d24f28f91a40066c0d6a 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 0000000000000000000000000000000000000000..111ce17b9885c095f86b7eb6fac3c21ce1cd724e --- /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 0000000000000000000000000000000000000000..da4e1ae3180960afba8eba4ca27a8c8e6ab73d90 --- /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 0000000000000000000000000000000000000000..b34152c69d8f1320e3d5aa603baccbb91b4734d1 --- /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 0000000000000000000000000000000000000000..f64b341d9eb6b36d484188e527158c0aeab4d32d --- /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