platform
							parent
							
								
									45d3d8389f
								
							
						
					
					
						commit
						63f89de96a
					
				@ -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<String, Integer> 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<PlatformDayPlanResp> 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<WeekMonthPersonCountResp> 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<TPatient> tPatients = platformService.ageCount(hospitalId,doctorId);
 | 
			
		||||
        return AjaxResult.success(tPatients);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -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<String, Integer> 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<String, Integer> map = new HashMap<String, Integer>(){{
 | 
			
		||||
            put("all",all);
 | 
			
		||||
            put("month",month);
 | 
			
		||||
            put("week",week);
 | 
			
		||||
            put("day",day);
 | 
			
		||||
        }};
 | 
			
		||||
        return map;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 今日就诊计划
 | 
			
		||||
     * @param hospitalId
 | 
			
		||||
     * @param doctorId
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public List<PlatformDayPlanResp> dayPlan(Long hospitalId, Long doctorId) {
 | 
			
		||||
        return tRecordMapper.dayPlan(hospitalId, doctorId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 周/月就诊人数统计
 | 
			
		||||
     * @param hospitalId
 | 
			
		||||
     * @param doctorId
 | 
			
		||||
     * @param weekMonth
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public List<WeekMonthPersonCountResp> weekMonthPersonCount(Long hospitalId, Long doctorId,Long weekMonth) {
 | 
			
		||||
        return tRecordMapper.weekMonthPersonCount(hospitalId, doctorId,weekMonth);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public List<TPatient> ageCount(Long hospitalId, Long doctorId) {
 | 
			
		||||
        return tRecordMapper.ageCount(hospitalId, doctorId);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue