From 63f89de96a1d2e8ad8d7972ccf594377cf23fcfe Mon Sep 17 00:00:00 2001 From: zhuqing Date: Tue, 9 Aug 2022 16:33:51 +0800 Subject: [PATCH] platform --- .../web/controller/pc/PlatformController.java | 68 ++++++++++++++++++ .../domain/resp/PlatformDayPlanResp.java | 52 ++++++++++++++ .../domain/resp/WeekMonthPersonCountResp.java | 40 +++++++++++ .../ruoyi/system/mapper/TRecordMapper.java | 45 ++++++++++++ .../system/service/impl/PlatformService.java | 72 +++++++++++++++++++ .../resources/mapper/system/TRecordMapper.xml | 54 ++++++++++++++ 6 files changed, 331 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java new file mode 100644 index 0000000..92696ff --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java @@ -0,0 +1,68 @@ +package com.ruoyi.web.controller.pc; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain.TPatient; +import com.ruoyi.system.domain.resp.PlatformDayPlanResp; +import com.ruoyi.system.domain.resp.WeekMonthPersonCountResp; +import com.ruoyi.system.service.ITRecordService; +import com.ruoyi.system.service.impl.PlatformService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * @Author zhuqing + * @Date 2022/8/9 + * 工作台 + */ +@RestController +@RequestMapping("/platform") +@Api("工作台") +public class PlatformController { + + @Autowired + private PlatformService platformService; + + @ApiOperation("工作台-设备统计") + @PostMapping("/equCount") + public AjaxResult equCount( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId){ + Map stringIntegerMap = platformService.equCount(hospitalId, doctorId); + return AjaxResult.success(stringIntegerMap); + } + + @ApiOperation("工作台-今日就诊计划") + @PostMapping("/dayPlan") + public AjaxResult dayPlan( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId){ + List platformDayPlanResps = platformService.dayPlan(hospitalId, doctorId); + return AjaxResult.success(platformDayPlanResps); + } + + @ApiOperation("工作台-就诊人数统计") + @PostMapping("/weekMonthPersonCount") + public AjaxResult weekMonthPersonCount( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId, + @ApiParam(name = "weekMonth",value = "周月的区分 1-周 2-月",required = false) @RequestParam(required = false) Long weekMonth){ + List weekMonthPersonCountResps = platformService.weekMonthPersonCount(hospitalId, doctorId,weekMonth); + return AjaxResult.success(weekMonthPersonCountResps); + } + + @ApiOperation("工作台-患者年龄统计") + @PostMapping("/ageCount") + public AjaxResult ageCount( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId){ + List tPatients = platformService.ageCount(hospitalId,doctorId); + return AjaxResult.success(tPatients); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java new file mode 100644 index 0000000..bcc88f4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java @@ -0,0 +1,52 @@ +package com.ruoyi.system.domain.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @Author zhuqing + * @Date 2022/8/9 + */ +@ApiModel(value = "PlatformDayPlanResp", description = "工作台今日就诊计划反参实体") +public class PlatformDayPlanResp { + + /** 医院 */ + @ApiModelProperty("name") + private String name; + + /** 状态(0预约 1就诊) */ + @ApiModelProperty("状态(0预约 1就诊)") + private String status; + + /** 创建时间 */ + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("创建时间") + private Date createTime; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java new file mode 100644 index 0000000..1ec0fc8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java @@ -0,0 +1,40 @@ +package com.ruoyi.system.domain.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @Author zhuqing + * @Date 2022/8/9 + */ +@ApiModel(value = "WeekMonthPersonCountResp", description = "工作台今日就诊计划反参实体") +public class WeekMonthPersonCountResp { + + /** 医院 */ + @ApiModelProperty("count") + private int count; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("创建时间") + private Date createTime; + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java index 79fa024..20b4152 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java @@ -3,10 +3,15 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.TPatientHospitalDoctor; + +import com.ruoyi.system.domain.TPatient; import com.ruoyi.system.domain.TRecord; import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.domain.resp.PlatformDayPlanResp; import com.ruoyi.system.domain.resp.TRecordResp; +import com.ruoyi.system.domain.resp.WeekMonthPersonCountResp; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 诊断记录信息Mapper接口 @@ -17,6 +22,46 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface TRecordMapper { + /** + * --------------------------工作台相关接口------------------------------------------ + */ + /** + * 设备统计各个个数查询 + * @param hospitalId + * @param doctorId + * @return + */ + int selectEquCount(@Param("hospitalId") Long hospitalId, + @Param("doctorId")Long doctorId, + @Param("status")String status, + @Param("month")Long month, + @Param("week")Long week, + @Param("day")Long day); + + /** + * 今日就诊计划 + * @param hospitalId + * @param doctorId + * @return + */ + List dayPlan(@Param("hospitalId") Long hospitalId, + @Param("doctorId")Long doctorId); + + /** + * 就诊人数统计 1-周 2-月 + * @param hospitalId + * @param doctorId + * @param weekMonth + * @return + */ + List weekMonthPersonCount(@Param("hospitalId")Long hospitalId, + @Param("doctorId")Long doctorId, + @Param("weekMonth")Long weekMonth); + + + List ageCount(@Param("hospitalId")Long hospitalId, + @Param("doctorId")Long doctorId); + /** * 查询诊断记录信息 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java new file mode 100644 index 0000000..e01cc65 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java @@ -0,0 +1,72 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.system.domain.TPatient; +import com.ruoyi.system.domain.resp.PlatformDayPlanResp; +import com.ruoyi.system.domain.resp.WeekMonthPersonCountResp; +import com.ruoyi.system.mapper.TRecordMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author zhuqing + * @Date 2022/8/9 + */ +@Component +public class PlatformService { + + @Autowired + private TRecordMapper tRecordMapper; + + /** + * 设备统计各个个数查询 + * @param hospitalId + * @param doctorId + * @return + */ + public Map equCount(Long hospitalId, Long doctorId) { + //就诊总数 + int all = tRecordMapper.selectEquCount(hospitalId, doctorId, "1", null, null,null); + //本月总数 + int month = tRecordMapper.selectEquCount(hospitalId, doctorId, "1", 1L, null,null); + //本周总数 + int week = tRecordMapper.selectEquCount(hospitalId, doctorId, "1", null, 1L,null); + //今日预约 + int day = tRecordMapper.selectEquCount(hospitalId, doctorId, "0", null, null,1L); + Map map = new HashMap(){{ + put("all",all); + put("month",month); + put("week",week); + put("day",day); + }}; + return map; + } + + /** + * 今日就诊计划 + * @param hospitalId + * @param doctorId + * @return + */ + public List dayPlan(Long hospitalId, Long doctorId) { + return tRecordMapper.dayPlan(hospitalId, doctorId); + } + + /** + * 周/月就诊人数统计 + * @param hospitalId + * @param doctorId + * @param weekMonth + * @return + */ + public List weekMonthPersonCount(Long hospitalId, Long doctorId,Long weekMonth) { + return tRecordMapper.weekMonthPersonCount(hospitalId, doctorId,weekMonth); + } + + public List ageCount(Long hospitalId, Long doctorId) { + return tRecordMapper.ageCount(hospitalId, doctorId); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index b23843f..a27682c 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -85,6 +85,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN t_patient tp ON tr.patient_id = tp.id + + + + + + + + + + +