fix: 健康管理系统,统计页面接口开发及功能完善。
This commit is contained in:
@@ -41,10 +41,24 @@ public class StatisticAnalysisController extends BaseController {
|
||||
|
||||
@ApiOperation("健康总览-健康总览信息")
|
||||
@GetMapping("/healthAnalysis")
|
||||
public Map<String,Object> getDebitAccountsInfo(){
|
||||
public Map<String,Object> getHealthAnalysis(){
|
||||
Map<String, Object> resultMap = iStatisticAnalysisService.getHealthAnalysisInfo();
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
@ApiOperation("档案统计分析")
|
||||
@GetMapping("/recordAnalysis")
|
||||
public Map<String,Object> getRecordAnalysis(AnalysisDto analysisDto){
|
||||
Map<String, Object> resultMap = iStatisticAnalysisService.getRecordAnalysis(analysisDto);
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
@ApiOperation("就医统计分析")
|
||||
@GetMapping("/doctorAnalysis")
|
||||
public Map<String,Object> getDoctorAnalysis(AnalysisDto analysisDto){
|
||||
Map<String, Object> resultMap = iStatisticAnalysisService.getDoctorAnalysis(analysisDto);
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class HealthDoctorRecordDto extends BaseEntity implements Serializable
|
||||
|
||||
/** 健康档案 */
|
||||
@ApiModelProperty(value="健康档案")
|
||||
private String healthRecordId;
|
||||
private Long healthRecordId;
|
||||
|
||||
/** 就诊时间 */
|
||||
@ApiModelProperty(value="就诊时间")
|
||||
|
||||
@@ -46,4 +46,8 @@ public class HealthRecordDto extends BaseEntity implements Serializable
|
||||
@ApiModelProperty(value="结束日期")
|
||||
private String endTime;
|
||||
|
||||
/** 主表ID */
|
||||
@ApiModelProperty(value="主表ID")
|
||||
private Long healthRecordId;
|
||||
|
||||
}
|
||||
|
||||
@@ -25,4 +25,6 @@ public class HealthDoctorRecordVo extends HealthDoctorRecord
|
||||
@Excel(name = "健康档案")
|
||||
private String healthRecordName;
|
||||
|
||||
private Integer count;
|
||||
|
||||
}
|
||||
|
||||
@@ -24,4 +24,16 @@ public class HealthRecordVo extends HealthRecord
|
||||
@ApiModelProperty(value="持续时间")
|
||||
private String duration;
|
||||
|
||||
private String doctorCount;
|
||||
|
||||
private String doctorCost;
|
||||
|
||||
private String marDayCount;
|
||||
|
||||
private String marCount;
|
||||
|
||||
private String feverDayCount;
|
||||
|
||||
private String processCount;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ruoyi.health.mapper;
|
||||
|
||||
import com.ruoyi.common.datascope.annotation.DataScope;
|
||||
import com.ruoyi.health.domain.dto.HealthDoctorRecordDto;
|
||||
import com.ruoyi.health.domain.dto.HealthMarRecordDto;
|
||||
import com.ruoyi.health.domain.dto.HealthRecordDto;
|
||||
import com.ruoyi.health.domain.vo.HealthDoctorRecordVo;
|
||||
import com.ruoyi.health.domain.vo.HealthMarRecordVo;
|
||||
import com.ruoyi.health.domain.vo.HealthRecordVo;
|
||||
import com.ruoyi.health.domain.vo.HealthStaticPersonVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -27,7 +30,7 @@ public interface StatisticAnalysisMapper {
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public int selectHospitalCount(HealthRecordDto dto);
|
||||
public int selectHospitalCount(HealthMarRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
@@ -35,7 +38,7 @@ public interface StatisticAnalysisMapper {
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public int selectDoctorCount(HealthRecordDto dto);
|
||||
public int selectDoctorCount(HealthMarRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
@@ -43,7 +46,7 @@ public interface StatisticAnalysisMapper {
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public int selectDistinctMedicalCount(HealthRecordDto dto);
|
||||
public int selectDistinctMedicalCount(HealthMarRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
@@ -70,7 +73,7 @@ public interface StatisticAnalysisMapper {
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public int selectMarDayCount(HealthRecordDto dto);
|
||||
public int selectMarDayCount(HealthMarRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
@@ -80,6 +83,15 @@ public interface StatisticAnalysisMapper {
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public int selectFeverDayCount(HealthRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
*
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hr")
|
||||
public List<HealthRecordVo> selectHealthRecordCostList (HealthRecordDto dto);
|
||||
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
*
|
||||
@@ -89,4 +101,64 @@ public interface StatisticAnalysisMapper {
|
||||
public List<HealthStaticPersonVo> selectStaticPersonList (HealthRecordDto dto);
|
||||
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
*
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hr")
|
||||
public List<HealthRecordVo> selectHealthRecordList (HealthRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
*
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public List<HealthDoctorRecordVo> selectDoctorRecordList(HealthDoctorRecordDto dto);
|
||||
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
*
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public int selectMarCount(HealthMarRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
*
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public int selectProcessCount(HealthMarRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
*
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public List<HealthDoctorRecordVo> selectDoctorStaticList(HealthDoctorRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
*
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public List<HealthDoctorRecordVo> selectHospitalStaticList(HealthDoctorRecordDto dto);
|
||||
|
||||
/**
|
||||
* 查询用药记录
|
||||
*
|
||||
* @return 收支集合
|
||||
*/
|
||||
@DataScope(businessAlias = "hmr")
|
||||
public List<HealthDoctorRecordVo> selectDepartStaticList(HealthDoctorRecordDto dto);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,4 +17,10 @@ public interface IStatisticAnalysisService {
|
||||
|
||||
public Map<String, Object> getHealthAnalysisInfo();
|
||||
|
||||
|
||||
public Map<String, Object> getRecordAnalysis(AnalysisDto analysisDto);
|
||||
|
||||
public Map<String, Object> getDoctorAnalysis(AnalysisDto analysisDto);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.ruoyi.health.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.MillisecondsConverter;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.security.utils.DictUtils;
|
||||
import com.ruoyi.health.domain.dto.*;
|
||||
@@ -37,14 +39,13 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService {
|
||||
@Resource
|
||||
private HealthRecordMapper healthRecordMapper;
|
||||
|
||||
@Resource
|
||||
private HealthProcessRecordMapper healthProcessRecordMapper;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getMarAnalysis(AnalysisDto analysisDto) {
|
||||
//返回数据
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#.###");
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat dateFormatSecond = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat formatterMonth = new SimpleDateFormat("yyyy-MM");
|
||||
//月查询
|
||||
if(analysisDto.getType().equals("2")){
|
||||
@@ -382,22 +383,26 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService {
|
||||
//活动总数
|
||||
List<HealthActivityVo> activityVoList= healthActivityMapper.selectHealthActivityList(new HealthActivityDto());
|
||||
map.put("activityCount",activityVoList.size());
|
||||
map.put("activityCost",activityVoList.stream().mapToDouble(HealthActivityVo::getTotalCost).sum());
|
||||
//活动费用
|
||||
String activityCost=decimalFormat.format(activityVoList.stream().mapToDouble(HealthActivityVo::getTotalCost).sum());
|
||||
map.put("activityCost",activityCost);
|
||||
//就医总数
|
||||
List<HealthDoctorRecordVo> healthDoctorRecordList=healthDoctorRecordMapper.selectHealthDoctorRecordList(new HealthDoctorRecordDto());
|
||||
map.put("doctorCount",healthDoctorRecordList.size());
|
||||
map.put("doctorCost",healthDoctorRecordList.stream().mapToDouble(HealthDoctorRecordVo::getTotalCost).sum());
|
||||
//就医费用
|
||||
String doctorCost=decimalFormat.format(healthDoctorRecordList.stream().mapToDouble(HealthDoctorRecordVo::getTotalCost).sum());
|
||||
map.put("doctorCost",doctorCost);
|
||||
//医院总数
|
||||
map.put("hospitalCount",statisticAnalysisMapper.selectHospitalCount(new HealthRecordDto()));
|
||||
map.put("hospitalCount",statisticAnalysisMapper.selectHospitalCount(new HealthMarRecordDto()));
|
||||
|
||||
//医生总数
|
||||
map.put("doctorTotalCount",statisticAnalysisMapper.selectDoctorCount(new HealthRecordDto()));
|
||||
map.put("doctorTotalCount",statisticAnalysisMapper.selectDoctorCount(new HealthMarRecordDto()));
|
||||
//用药天数
|
||||
map.put("marDayCount",statisticAnalysisMapper.selectMarDayCount(new HealthRecordDto()));
|
||||
map.put("marDayCount",statisticAnalysisMapper.selectMarDayCount(new HealthMarRecordDto()));
|
||||
//用药次数
|
||||
map.put("marCount",marRecordMapper.selectHealthMarRecordList(new HealthMarRecordDto()).size());
|
||||
//用药类别
|
||||
map.put("medicalTypeCount",statisticAnalysisMapper.selectDistinctMedicalCount(new HealthRecordDto()));
|
||||
map.put("medicalTypeCount",statisticAnalysisMapper.selectDistinctMedicalCount(new HealthMarRecordDto()));
|
||||
|
||||
List<HealthTemperatureRecordVo> temperatureRecordVoList=temperatureRecordMapper.selectHealthTemperatureRecordList(new HealthTemperatureRecordDto());
|
||||
//测量体温次数
|
||||
@@ -429,5 +434,302 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService {
|
||||
|
||||
return map;
|
||||
}
|
||||
@Override
|
||||
public Map<String, Object> getRecordAnalysis(AnalysisDto analysisDto) {
|
||||
//返回数据
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#.##");
|
||||
SimpleDateFormat formatterMonth = new SimpleDateFormat("yyyy-MM");
|
||||
//月查询
|
||||
if(analysisDto.getType().equals("2")){
|
||||
if(StringUtils.isEmpty(analysisDto.getStartTime())&&StringUtils.isEmpty(analysisDto.getEndTime())){
|
||||
// String endTime=dateFormat.format(DateUtils.addMonths(DateUtils.getNowDate(),0));
|
||||
// String startTime=dateFormat.format(DateUtils.addMonths(DateUtils.getNowDate(),-24));
|
||||
// analysisDto.setStartTime(startTime);
|
||||
// analysisDto.setEndTime(endTime);
|
||||
}else {
|
||||
analysisDto.setStartTime(analysisDto.getStartTime()+"-01");
|
||||
if(analysisDto.getEndTime().equals(formatterMonth.format(new Date()))){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd");
|
||||
analysisDto.setEndTime(analysisDto.getEndTime()+"-"+sdf.format(new Date()));
|
||||
}else {
|
||||
analysisDto.setEndTime(analysisDto.getEndTime()+"-31");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//年查询
|
||||
}else if(analysisDto.getType().equals("3")){
|
||||
if(StringUtils.isEmpty(analysisDto.getStartTime())&&StringUtils.isEmpty(analysisDto.getEndTime())){
|
||||
// String endTime=dateFormat.format(DateUtils.getNowDate());
|
||||
// String startTime=dateFormat.format(DateUtils.addYears(DateUtils.getNowDate(),-5));
|
||||
// analysisDto.setStartTime(startTime);
|
||||
// analysisDto.setEndTime(endTime);
|
||||
}else {
|
||||
analysisDto.setStartTime(analysisDto.getStartTime()+"-01-01");
|
||||
SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
|
||||
if(analysisDto.getEndTime().equals(sdfYear.format(new Date()))){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd");
|
||||
analysisDto.setEndTime(analysisDto.getEndTime()+"-"+sdf.format(new Date()));
|
||||
}else {
|
||||
analysisDto.setEndTime(analysisDto.getEndTime()+"-12-31");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HealthRecordDto recordDto=new HealthRecordDto();
|
||||
recordDto.setEndTime(analysisDto.getEndTime());
|
||||
recordDto.setStartTime(analysisDto.getStartTime());
|
||||
recordDto.setPersonId(analysisDto.getId());
|
||||
recordDto.setHealthRecordId(analysisDto.getRecordId());
|
||||
//健康档案总数
|
||||
List<HealthRecordVo> recordVoList=healthRecordMapper.selectHealthRecordList(recordDto);
|
||||
long duration=0L;
|
||||
int healthRecordCount=recordVoList.size();
|
||||
for (HealthRecordVo recordVo : recordVoList) {
|
||||
Date startDate=recordVo.getOccurTime();
|
||||
Date endDate=new Date();
|
||||
if(recordVo.getRehabilitationTime()!=null){
|
||||
endDate=recordVo.getRehabilitationTime();
|
||||
}
|
||||
duration+=(endDate.getTime()-startDate.getTime());
|
||||
}
|
||||
//平均康复周期
|
||||
if(healthRecordCount>0){
|
||||
MillisecondsConverter converter = new MillisecondsConverter(duration/healthRecordCount);
|
||||
map.put("perDuration",converter.getConvertDayHourResult());
|
||||
}else {
|
||||
map.put("perDuration","0,0");
|
||||
}
|
||||
//建档次数
|
||||
map.put("healthRecordCount",healthRecordCount);
|
||||
|
||||
HealthMarRecordDto marDto=new HealthMarRecordDto();
|
||||
//获取数据
|
||||
marDto.setEndTime(analysisDto.getEndTime());
|
||||
marDto.setStartTime(analysisDto.getStartTime());
|
||||
marDto.setPersonId(analysisDto.getId());
|
||||
marDto.setHealthRecordId(analysisDto.getRecordId());
|
||||
|
||||
//过程记录次数
|
||||
map.put("processRecordCount",statisticAnalysisMapper.selectProcessCount(marDto));
|
||||
|
||||
//用药总次数
|
||||
int marCount=0;
|
||||
List<HealthMarRecordVo> marTypeList=statisticAnalysisMapper.selectMarTypeList(marDto);
|
||||
for (HealthMarRecordVo vo:marTypeList
|
||||
){
|
||||
if (null != vo.getType()) {
|
||||
vo.setName(DictUtils.getDictLabel("mar_type", vo.getType().toString()));
|
||||
}else{
|
||||
vo.setName("未分类");
|
||||
}
|
||||
marCount+=vo.getCount();
|
||||
}
|
||||
//用药总次数
|
||||
map.put("marCount",marCount);
|
||||
|
||||
|
||||
//医院总数
|
||||
map.put("hospitalCount",statisticAnalysisMapper.selectHospitalCount(marDto));
|
||||
|
||||
//医生总数
|
||||
map.put("doctorTotalCount",statisticAnalysisMapper.selectDoctorCount(marDto));
|
||||
|
||||
|
||||
HealthDoctorRecordDto doctorDto=new HealthDoctorRecordDto();
|
||||
//获取数据
|
||||
doctorDto.setEndTime(analysisDto.getEndTime());
|
||||
doctorDto.setStartTime(analysisDto.getStartTime());
|
||||
doctorDto.setPersonId(analysisDto.getId());
|
||||
doctorDto.setHealthRecordId(analysisDto.getRecordId());
|
||||
List<HealthDoctorRecordVo> healthDoctorRecordList=statisticAnalysisMapper.selectDoctorRecordList(doctorDto);
|
||||
//就医次数
|
||||
map.put("doctorCount",healthDoctorRecordList.size());
|
||||
//就医费用
|
||||
String doctorCost=decimalFormat.format(healthDoctorRecordList.stream().mapToDouble(HealthDoctorRecordVo::getTotalCost).sum());
|
||||
map.put("doctorCost",doctorCost);
|
||||
|
||||
//用药天数
|
||||
map.put("marDayCount",statisticAnalysisMapper.selectMarDayCount(marDto));
|
||||
//用药次数
|
||||
map.put("marCount",statisticAnalysisMapper.selectMarCount(marDto));
|
||||
|
||||
//发烧天数
|
||||
map.put("feverDayCount",statisticAnalysisMapper.selectFeverDayCount(recordDto));
|
||||
|
||||
|
||||
//按档案统计
|
||||
List<HealthRecordVo> recordList=statisticAnalysisMapper.selectHealthRecordList(recordDto);
|
||||
for (HealthRecordVo recordVo : recordList) {
|
||||
String daysBetween="";
|
||||
if(recordVo.getRehabilitationTime()!=null){
|
||||
daysBetween = DateUtils.timeDistance(recordVo.getRehabilitationTime(),recordVo.getOccurTime());
|
||||
}else {
|
||||
daysBetween = DateUtils.timeDistance(new Date(),recordVo.getOccurTime());
|
||||
}
|
||||
recordVo.setDuration(daysBetween);
|
||||
}
|
||||
//列表
|
||||
map.put("recordList",recordList);
|
||||
//
|
||||
List<HealthRecordVo> recordCostList=statisticAnalysisMapper.selectHealthRecordCostList(recordDto);
|
||||
ArrayList<Map<String, Object>> recordCost = new ArrayList<>();
|
||||
for (HealthRecordVo vo:recordCostList
|
||||
) {
|
||||
Map<String, Object> datamap = new HashMap<>();
|
||||
datamap.put("time", vo.getName());
|
||||
datamap.put("value", vo.getDoctorCost());
|
||||
recordCost.add(datamap);
|
||||
}
|
||||
//列表
|
||||
map.put("recordCostList",recordCost);
|
||||
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getDoctorAnalysis(AnalysisDto analysisDto) {
|
||||
//返回数据
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#.##");
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat formatterMonth = new SimpleDateFormat("yyyy-MM");
|
||||
//月查询
|
||||
if(analysisDto.getType().equals("2")){
|
||||
if(StringUtils.isEmpty(analysisDto.getStartTime())&&StringUtils.isEmpty(analysisDto.getEndTime())){
|
||||
// String endTime=dateFormat.format(DateUtils.addMonths(DateUtils.getNowDate(),0));
|
||||
// String startTime=dateFormat.format(DateUtils.addMonths(DateUtils.getNowDate(),-24));
|
||||
// analysisDto.setStartTime(startTime);
|
||||
// analysisDto.setEndTime(endTime);
|
||||
}else {
|
||||
analysisDto.setStartTime(analysisDto.getStartTime()+"-01");
|
||||
if(analysisDto.getEndTime().equals(formatterMonth.format(new Date()))){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd");
|
||||
analysisDto.setEndTime(analysisDto.getEndTime()+"-"+sdf.format(new Date()));
|
||||
}else {
|
||||
analysisDto.setEndTime(analysisDto.getEndTime()+"-31");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//年查询
|
||||
}else if(analysisDto.getType().equals("3")){
|
||||
if(StringUtils.isEmpty(analysisDto.getStartTime())&&StringUtils.isEmpty(analysisDto.getEndTime())){
|
||||
// String endTime=dateFormat.format(DateUtils.getNowDate());
|
||||
// String startTime=dateFormat.format(DateUtils.addYears(DateUtils.getNowDate(),-5));
|
||||
// analysisDto.setStartTime(startTime);
|
||||
// analysisDto.setEndTime(endTime);
|
||||
}else {
|
||||
analysisDto.setStartTime(analysisDto.getStartTime()+"-01-01");
|
||||
SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
|
||||
if(analysisDto.getEndTime().equals(sdfYear.format(new Date()))){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd");
|
||||
analysisDto.setEndTime(analysisDto.getEndTime()+"-"+sdf.format(new Date()));
|
||||
}else {
|
||||
analysisDto.setEndTime(analysisDto.getEndTime()+"-12-31");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
HealthMarRecordDto marDto=new HealthMarRecordDto();
|
||||
//获取数据
|
||||
marDto.setEndTime(analysisDto.getEndTime());
|
||||
marDto.setStartTime(analysisDto.getStartTime());
|
||||
marDto.setPersonId(analysisDto.getId());
|
||||
marDto.setHealthRecordId(analysisDto.getRecordId());
|
||||
|
||||
//过程记录次数
|
||||
map.put("processRecordCount",statisticAnalysisMapper.selectProcessCount(marDto));
|
||||
|
||||
|
||||
HealthDoctorRecordDto doctorDto=new HealthDoctorRecordDto();
|
||||
//获取数据
|
||||
doctorDto.setEndTime(analysisDto.getEndTime());
|
||||
doctorDto.setStartTime(analysisDto.getStartTime());
|
||||
doctorDto.setPersonId(analysisDto.getId());
|
||||
doctorDto.setHealthRecordId(analysisDto.getRecordId());
|
||||
List<HealthDoctorRecordVo> healthDoctorRecordList=healthDoctorRecordMapper.selectHealthDoctorRecordList(doctorDto);
|
||||
//就医次数
|
||||
map.put("doctorCount",healthDoctorRecordList.size());
|
||||
//就医费用
|
||||
String doctorCost=decimalFormat.format(healthDoctorRecordList.stream().mapToDouble(HealthDoctorRecordVo::getTotalCost).sum());
|
||||
map.put("doctorCost",doctorCost);
|
||||
//门诊次数
|
||||
map.put("clinicCount",healthDoctorRecordList.stream().filter((doctor->doctor.getType().equals("1"))).count());
|
||||
//急诊次数
|
||||
map.put("emergencyCount",healthDoctorRecordList.stream().filter((doctor->doctor.getType().equals("2"))).count());
|
||||
//住院次数
|
||||
map.put("hospitalizedCount",healthDoctorRecordList.stream().filter((doctor->doctor.getType().equals("3"))).count());
|
||||
//输液次数
|
||||
map.put("infusionCount",healthDoctorRecordList.stream().filter((doctor->doctor.getType().equals("4"))).count());
|
||||
//线上门诊
|
||||
map.put("onlineCount",healthDoctorRecordList.stream().filter((doctor->doctor.getType().equals("5"))).count());
|
||||
|
||||
|
||||
//按档案统计
|
||||
List<HealthRecordVo> recordList=statisticAnalysisMapper.selectHealthRecordList(new HealthRecordDto());
|
||||
for (HealthRecordVo recordVo : recordList) {
|
||||
String daysBetween="";
|
||||
if(recordVo.getRehabilitationTime()!=null){
|
||||
daysBetween = DateUtils.timeDistance(recordVo.getRehabilitationTime(),recordVo.getOccurTime());
|
||||
}else {
|
||||
daysBetween = DateUtils.timeDistance(new Date(),recordVo.getOccurTime());
|
||||
}
|
||||
recordVo.setDuration(daysBetween);
|
||||
}
|
||||
//列表
|
||||
map.put("recordList",recordList);
|
||||
//
|
||||
|
||||
List<HealthDoctorRecordVo> hospitalStaticList=statisticAnalysisMapper.selectHospitalStaticList(doctorDto);
|
||||
//列表
|
||||
if(hospitalStaticList.size()>0) {
|
||||
map.put("commonHospital", hospitalStaticList.get(0).getHospitalName());
|
||||
}
|
||||
else {
|
||||
map.put("commonHospital", "--");
|
||||
}
|
||||
List<HealthDoctorRecordVo> doctorStaticList=statisticAnalysisMapper.selectDoctorStaticList(doctorDto);
|
||||
//列表
|
||||
map.put("doctorStaticList",doctorStaticList);
|
||||
if(doctorStaticList.size()>0) {
|
||||
//列表
|
||||
map.put("commonDoctor",doctorStaticList.get(0).getDoctor());
|
||||
}else {
|
||||
map.put("commonDoctor","--");
|
||||
}
|
||||
List<HealthDoctorRecordVo> departStaticList=statisticAnalysisMapper.selectDepartStaticList(doctorDto);
|
||||
|
||||
if(departStaticList.size()>0) {
|
||||
//列表
|
||||
map.put("commonDepartments",departStaticList.get(0).getDepartments());
|
||||
}else {
|
||||
map.put("commonDepartments","--");
|
||||
}
|
||||
//列表
|
||||
map.put("departStaticList",departStaticList);
|
||||
//列表
|
||||
map.put("hospitalStaticList",hospitalStaticList);
|
||||
ArrayList<Map<String, Object>> recordCost = new ArrayList<>();
|
||||
//列表
|
||||
map.put("doctorTableList",healthDoctorRecordList);
|
||||
Collections.reverse(healthDoctorRecordList);
|
||||
for (HealthDoctorRecordVo vo:healthDoctorRecordList
|
||||
) {
|
||||
Map<String, Object> datamap = new HashMap<>();
|
||||
datamap.put("time", dateFormat.format(vo.getVisitingTime()));
|
||||
datamap.put("value", vo.getTotalCost());
|
||||
recordCost.add(datamap);
|
||||
}
|
||||
//列表
|
||||
map.put("doctorCostList",recordCost);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user