|
@ -3,9 +3,12 @@ package com.acupuncture.system.service.impl; |
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import com.acupuncture.common.constant.DiseaseMapping; |
|
|
import com.acupuncture.common.constant.DiseaseMapping; |
|
|
|
|
|
import com.acupuncture.common.core.redis.RedisCache; |
|
|
import com.acupuncture.common.utils.SecurityUtils; |
|
|
import com.acupuncture.common.utils.SecurityUtils; |
|
|
import com.acupuncture.system.domain.dto.StatisticsDto; |
|
|
import com.acupuncture.system.domain.dto.StatisticsDto; |
|
|
|
|
|
import com.acupuncture.system.domain.vo.FmsFollowupVo; |
|
|
import com.acupuncture.system.domain.vo.StatisticsVo; |
|
|
import com.acupuncture.system.domain.vo.StatisticsVo; |
|
|
import com.acupuncture.system.persist.dao.StatisticsDao; |
|
|
import com.acupuncture.system.persist.dao.StatisticsDao; |
|
|
import com.acupuncture.system.service.StatisticsService; |
|
|
import com.acupuncture.system.service.StatisticsService; |
|
@ -13,6 +16,7 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
import java.util.function.Function; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -25,6 +29,9 @@ import java.util.stream.Collectors; |
|
|
public class StatisticsServiceImpl implements StatisticsService { |
|
|
public class StatisticsServiceImpl implements StatisticsService { |
|
|
@Resource |
|
|
@Resource |
|
|
private StatisticsDao statisticsDao; |
|
|
private StatisticsDao statisticsDao; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private RedisCache redisCache; |
|
|
|
|
|
public static String COMMON_FOLLOWUP_QUEUE = "common_followup_queue"; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public StatisticsVo.PatientVo queryPatientStatistics(StatisticsDto.Query dto) { |
|
|
public StatisticsVo.PatientVo queryPatientStatistics(StatisticsDto.Query dto) { |
|
@ -137,8 +144,24 @@ public class StatisticsServiceImpl implements StatisticsService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<StatisticsVo.SffbVo.DlVo> querySfStatistics(StatisticsDto.Query dto) { |
|
|
public List<StatisticsVo.SffbVo.DlVo> querySfStatistics(StatisticsDto.Query dto) { |
|
|
StatisticsVo.SffbVo sffbVo = new StatisticsVo.SffbVo(); |
|
|
List<Object> cacheList = redisCache.getCacheList(COMMON_FOLLOWUP_QUEUE); |
|
|
return statisticsDao.querySfStatistics(dto, SecurityUtils.getTenantId()); |
|
|
Map<Long, FmsFollowupVo.FollowupQueueVO> map = new HashMap<>(); |
|
|
|
|
|
if (CollUtil.isNotEmpty(cacheList)) { |
|
|
|
|
|
List<FmsFollowupVo.FollowupQueueVO> followupQueueVOS = BeanUtil.copyToList(cacheList, FmsFollowupVo.FollowupQueueVO.class); |
|
|
|
|
|
map = followupQueueVOS.stream().collect(Collectors.toMap(FmsFollowupVo.FollowupQueueVO::getId, Function.identity())); |
|
|
|
|
|
} |
|
|
|
|
|
List<StatisticsVo.SffbVo.DlVo> dlVos = statisticsDao.querySfStatistics(dto, SecurityUtils.getTenantId()); |
|
|
|
|
|
if (CollUtil.isNotEmpty(dlVos)) { |
|
|
|
|
|
for (StatisticsVo.SffbVo.DlVo dlVo : dlVos) { |
|
|
|
|
|
if (StrUtil.isEmpty(dlVo.getQueueName())) { |
|
|
|
|
|
FmsFollowupVo.FollowupQueueVO followupQueueVO = map.get(dlVo.getQueueId()); |
|
|
|
|
|
if (followupQueueVO != null) { |
|
|
|
|
|
dlVo.setQueueName(followupQueueVO.getName()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return dlVos; |
|
|
// if (CollUtil.isNotEmpty(dlVos)) {
|
|
|
// if (CollUtil.isNotEmpty(dlVos)) {
|
|
|
// for (StatisticsVo.SffbVo.DlVo dlVo : dlVos) {
|
|
|
// for (StatisticsVo.SffbVo.DlVo dlVo : dlVos) {
|
|
|
// if (dlVo.getQueueId() == 10L) {
|
|
|
// if (dlVo.getQueueId() == 10L) {
|
|
|