Merge branch '0418_小程序开发' of http://182.92.166.109:3000/zhuangyuanke/PostDischargePatientManage into 0418_小程序开发

This commit is contained in:
haown 2024-08-15 15:30:39 +08:00
commit a55c23ef3f
11 changed files with 150 additions and 7 deletions

View File

@ -22,24 +22,35 @@ public class SystemHomePageController extends BaseController {
@Resource
private SystemHomePageService systemHomePageService;
/**
* 顶部统计
*/
@GetMapping("topStatistics")
public AjaxResult topStatistics() {
return AjaxResult.success(systemHomePageService.topStatistics());
}
/**
* 患者签约情况
*/
@GetMapping("signPatientCount")
public AjaxResult signPatientCount() {
return AjaxResult.success(systemHomePageService.signPatientCount());
}
/**
* 服务方式
*/
@GetMapping("serviceModeStatistics")
public AjaxResult serviceModeStatistics() {
return AjaxResult.success(systemHomePageService.serviceModeStatistics());
}
/**
* 代办任务
*/
@GetMapping("taskSituation")
public AjaxResult taskSituation(){
public AjaxResult taskSituation() {
return AjaxResult.success(systemHomePageService.taskSituation());
}
}

View File

@ -117,9 +117,26 @@ public interface PatientInfoMapper {
*/
int getPatientInfoCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
int selectPatientInfoCountBySignTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
/**
* 根据签约时间查询患者数量
*
* @param firstDay 本月第一天
* @param now 当前时间
* @return int
*/
int selectPatientInfoCountBySignTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
int selectPatientSignTotalCount();
/**
* 已签约总数
*
* @return int
*/
int selectPatientSignTotalCount();
int selectPatientSignServiceCount();
/**
* 服务中患者总数
*
* @return int
*/
int selectPatientSignServiceCount();
}

View File

@ -153,9 +153,29 @@ public interface SignPatientManageRouteNodeMapper {
*/
int updateNodeExecuteStatusByIds(@Param("manageRouteNodeIds") List<Long> manageRouteNodeIds, @Param("nodeExecuteStatus") String nodeExecuteStatus, @Param("appletStatus") String appletStatus, @Param("messageStatus") String messageStatus, @Param("officialStatus") String officialStatus);
/**
* 根据创建时间查询任务数量
*
* @param firstDay 本月第一天
* @param now 当前时间
* @return int
*/
int selectNodeCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
/**
* 推送方式
*
* @param phoneDialMethod 人工或ai
* @param messagePushSign 短信标识
* @param appletPushSign 微信标识
* @return BigDecimal
*/
BigDecimal selectNodeCount(@Param("phoneDialMethod") String phoneDialMethod, @Param("messagePushSign") Long messagePushSign, @Param("appletPushSign") Long appletPushSign);
/**
* 节点信息
*
* @return PatientAndNode
*/
List<PatientAndNode> selectNodeExecuteStatus();
}

View File

@ -45,5 +45,12 @@ public interface SignPatientRecordMapper {
*/
IntentionalSignVo getIntentionalSign(Long id);
/**
* 未审核
*
* @param routeCheckStatus 审核状态
* @param serviceStatus 患者庄国泰
* @return int
*/
int selectCheckStatus(@Param("routeCheckStatus") String routeCheckStatus, @Param("serviceStatus") String serviceStatus);
}

View File

@ -1,6 +1,5 @@
package com.xinelu.manage.service.homepage;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.vo.homepage.ServiceModeStatistics;
import com.xinelu.manage.vo.homepage.SignPatientCount;
import com.xinelu.manage.vo.homepage.TaskSituation;
@ -16,11 +15,31 @@ import java.util.List;
*/
public interface SystemHomePageService {
/**
* 顶部统计
*
* @return TopStatisticsVO
*/
TopStatisticsVO topStatistics();
/**
* 患者签约情况
*
* @return SignPatientCount
*/
List<SignPatientCount> signPatientCount();
/**
* 服务方式
*
* @return ServiceModeStatistics
*/
List<ServiceModeStatistics> serviceModeStatistics();
/**
* 代办任务
*
* @return TaskSituation
*/
List<TaskSituation> taskSituation();
}

View File

@ -37,23 +37,42 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
@Resource
private SignPatientRecordMapper signPatientRecordMapper;
/**
* 顶部统计
*
* @return TopStatisticsVO
*/
@Override
public TopStatisticsVO topStatistics() {
LocalDate now = LocalDate.now();
TopStatisticsVO topStatisticsVO = new TopStatisticsVO();
//本月第一天
LocalDate firstDay = now.with(TemporalAdjusters.firstDayOfMonth());
//本月患者数量
int createPatientCount = patientInfoMapper.getPatientInfoCountByCreateTime(firstDay, now);
//本月预住院数量
int patientPreHospitalizationCount = patientPreHospitalizationMapper.getPatientPreHospitalizationCountByCreateTime(firstDay, now);
//本月患者数
topStatisticsVO.setThisMonthPatient(createPatientCount + patientPreHospitalizationCount);
//本月签约数
topStatisticsVO.setSignPatientCount(patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, now));
//本月任务数
topStatisticsVO.setNodeCount(signPatientManageRouteNodeMapper.selectNodeCountByCreateTime(firstDay, now));
//已签约总数
topStatisticsVO.setPatientSignCount(patientInfoMapper.selectPatientSignTotalCount());
//服务中患者数
topStatisticsVO.setPatientSignServiceCount(patientInfoMapper.selectPatientSignServiceCount());
return topStatisticsVO;
}
/**
* 患者签约情况
*
* @return SignPatientCount
*/
@Override
public List<SignPatientCount> signPatientCount() {
//时间集合
List<LocalDate> localDates = new ArrayList<>();
List<SignPatientCount> signPatientCounts = new ArrayList<>();
LocalDate now = LocalDate.now();
@ -61,10 +80,12 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
LocalDate localDate = now.minusMonths(i);
localDates.add(localDate);
}
//数据
for (LocalDate localDate : localDates) {
SignPatientCount signPatientCount = new SignPatientCount();
LocalDate firstDay = localDate.with(TemporalAdjusters.firstDayOfMonth());
LocalDate lastDay = localDate.with(TemporalAdjusters.lastDayOfMonth());
//患者数量
int createPatientCount = patientInfoMapper.getPatientInfoCountByCreateTime(firstDay, lastDay);
int i = patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, lastDay);
signPatientCount.setTime(localDate);
@ -75,13 +96,23 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
return signPatientCounts;
}
/**
* 服务方式
*
* @return ServiceModeStatistics
*/
@Override
public List<ServiceModeStatistics> serviceModeStatistics() {
ArrayList<ServiceModeStatistics> serviceModeStatisticsList = new ArrayList<>();
//人工随访
BigDecimal common = signPatientManageRouteNodeMapper.selectNodeCount(PhoneDialMethodEnum.COMMON.getInfo(), null, null);
//ai
BigDecimal AI = signPatientManageRouteNodeMapper.selectNodeCount(PhoneDialMethodEnum.AI.getInfo(), null, null);
//短信
BigDecimal messagePushSign = signPatientManageRouteNodeMapper.selectNodeCount(null, 0L, null);
//微信
BigDecimal appletPushSign = signPatientManageRouteNodeMapper.selectNodeCount(null, null, 0L);
//全部
BigDecimal all = common.add(AI).add(messagePushSign).add(appletPushSign);
serviceModeStatisticsList.add(new ServiceModeStatistics("AI", AI.divide(all, 2, RoundingMode.HALF_UP), AI));
serviceModeStatisticsList.add(new ServiceModeStatistics("短信", messagePushSign.divide(all, 2, RoundingMode.HALF_UP), messagePushSign));
@ -90,6 +121,11 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
return serviceModeStatisticsList;
}
/**
* 代办任务
*
* @return TaskSituation
*/
@Override
public List<TaskSituation> taskSituation() {
LocalDate now = LocalDate.now();
@ -100,10 +136,12 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
int signTimeCount = signPatientRecordMapper.selectCheckStatus(null, "SERVICE_CENTER");
//任务
List<PatientAndNode> patientAndNodes = signPatientManageRouteNodeMapper.selectNodeExecuteStatus();
//未审核
int unExecutedCount = 0;
//全部
int allCount = 0;
if (CollectionUtils.isNotEmpty(patientAndNodes)) {
allCount = patientAndNodes.size();
allCount = patientAndNodes.size();
for (PatientAndNode patientAndNode : patientAndNodes) {
LocalDate localDate = null;
if (Objects.nonNull(patientAndNode.getDischargeTime())) {
@ -117,6 +155,7 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
}
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
if (before) {
//未执行
if (!NodeExecuteStatusEnum.EXECUTED.getInfo().equals(patientAndNode.getNodeExecuteStatus())) {
unExecutedCount++;
}

View File

@ -6,6 +6,12 @@ import lombok.Data;
import java.time.LocalDate;
/**
* 患者节点任务参数对象
*
* @author zh
* @date 2024-08-14
*/
@Data
public class PatientAndNode {

View File

@ -4,6 +4,12 @@ import lombok.Data;
import java.math.BigDecimal;
/**
* 服务方式
*
* @author zh
* @date 2024-08-14
*/
@Data
public class ServiceModeStatistics {

View File

@ -5,6 +5,12 @@ import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 患者签约率
*
* @author zh
* @date 2024-08-14
*/
@Data
public class SignPatientCount {

View File

@ -2,6 +2,12 @@ package com.xinelu.manage.vo.homepage;
import lombok.Data;
/**
* 任务代办
*
* @author zh
* @date 2024-08-14
*/
@Data
public class TaskSituation {

View File

@ -2,6 +2,12 @@ package com.xinelu.manage.vo.homepage;
import lombok.Data;
/**
* 顶部统计
*
* @author zh
* @date 2024-08-14
*/
@Data
public class TopStatisticsVO {