管理端首页修改
This commit is contained in:
parent
9817ecf55e
commit
f2879346f8
@ -37,4 +37,9 @@ public class SystemHomePageController extends BaseController {
|
||||
public AjaxResult serviceModeStatistics() {
|
||||
return AjaxResult.success(systemHomePageService.serviceModeStatistics());
|
||||
}
|
||||
|
||||
@GetMapping("taskSituation")
|
||||
public AjaxResult taskSituation(){
|
||||
return AjaxResult.success(systemHomePageService.taskSituation());
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.xinelu.manage.mapper.signpatientmanageroutenode;
|
||||
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
|
||||
import com.xinelu.manage.vo.homepage.PatientAndNode;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.*;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -155,4 +156,6 @@ public interface SignPatientManageRouteNodeMapper {
|
||||
int selectNodeCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
|
||||
|
||||
BigDecimal selectNodeCount(@Param("phoneDialMethod") String phoneDialMethod, @Param("messagePushSign") Long messagePushSign, @Param("appletPushSign") Long appletPushSign);
|
||||
|
||||
List<PatientAndNode> selectNodeExecuteStatus();
|
||||
}
|
||||
|
||||
@ -4,8 +4,10 @@ import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord;
|
||||
import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto;
|
||||
import com.xinelu.manage.vo.signpatientrecord.IntentionalSignVo;
|
||||
import com.xinelu.manage.vo.signpatientrecord.SignPatientInfoVo;
|
||||
import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo;
|
||||
import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo;
|
||||
import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -42,4 +44,6 @@ public interface SignPatientRecordMapper {
|
||||
* @Date 2024-08-08 11:00
|
||||
*/
|
||||
IntentionalSignVo getIntentionalSign(Long id);
|
||||
|
||||
int selectCheckStatus(@Param("routeCheckStatus") String routeCheckStatus, @Param("serviceStatus") String serviceStatus);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ 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;
|
||||
import com.xinelu.manage.vo.homepage.TopStatisticsVO;
|
||||
|
||||
import java.util.List;
|
||||
@ -19,5 +20,7 @@ public interface SystemHomePageService {
|
||||
|
||||
List<SignPatientCount> signPatientCount();
|
||||
|
||||
ServiceModeStatistics serviceModeStatistics();
|
||||
List<ServiceModeStatistics> serviceModeStatistics();
|
||||
|
||||
List<TaskSituation> taskSituation();
|
||||
}
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
package com.xinelu.manage.service.homepage.impl;
|
||||
|
||||
import com.xinelu.common.enums.NodeExecuteStatusEnum;
|
||||
import com.xinelu.common.enums.PhoneDialMethodEnum;
|
||||
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
||||
import com.xinelu.manage.mapper.patientprehospitalization.PatientPreHospitalizationMapper;
|
||||
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
|
||||
import com.xinelu.manage.service.homepage.SystemHomePageService;
|
||||
import com.xinelu.manage.vo.homepage.ServiceModeStatistics;
|
||||
import com.xinelu.manage.vo.homepage.SignPatientCount;
|
||||
import com.xinelu.manage.vo.homepage.TopStatisticsVO;
|
||||
import com.xinelu.manage.vo.homepage.*;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -17,6 +18,7 @@ import java.time.LocalDate;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 首页信息Service业务层处理
|
||||
@ -32,6 +34,8 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
|
||||
private PatientPreHospitalizationMapper patientPreHospitalizationMapper;
|
||||
@Resource
|
||||
private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper;
|
||||
@Resource
|
||||
private SignPatientRecordMapper signPatientRecordMapper;
|
||||
|
||||
@Override
|
||||
public TopStatisticsVO topStatistics() {
|
||||
@ -72,17 +76,55 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceModeStatistics serviceModeStatistics() {
|
||||
ServiceModeStatistics serviceModeStatistics = new ServiceModeStatistics();
|
||||
BigDecimal all = signPatientManageRouteNodeMapper.selectNodeCount(null, null, null);
|
||||
public List<ServiceModeStatistics> serviceModeStatistics() {
|
||||
ArrayList<ServiceModeStatistics> serviceModeStatisticsList = new ArrayList<>();
|
||||
BigDecimal common = signPatientManageRouteNodeMapper.selectNodeCount(PhoneDialMethodEnum.COMMON.getInfo(), null, null);
|
||||
BigDecimal AI = signPatientManageRouteNodeMapper.selectNodeCount(PhoneDialMethodEnum.AI.getInfo(), null, null);
|
||||
BigDecimal messagePushSign = signPatientManageRouteNodeMapper.selectNodeCount(null, 0L, null);
|
||||
BigDecimal appletPushSign = signPatientManageRouteNodeMapper.selectNodeCount(null, null, 0L);
|
||||
serviceModeStatistics.setAI(AI.divide(all, 2, RoundingMode.HALF_UP));
|
||||
serviceModeStatistics.setMessage(messagePushSign.divide(all, 2, RoundingMode.HALF_UP));
|
||||
serviceModeStatistics.setCommon(common.divide(all, 2, RoundingMode.HALF_UP));
|
||||
serviceModeStatistics.setWeChat(appletPushSign.divide(all, 2, RoundingMode.HALF_UP));
|
||||
return serviceModeStatistics;
|
||||
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));
|
||||
serviceModeStatisticsList.add(new ServiceModeStatistics("微信", appletPushSign.divide(all, 2, RoundingMode.HALF_UP), appletPushSign));
|
||||
serviceModeStatisticsList.add(new ServiceModeStatistics("人工随访", common.divide(all, 2, RoundingMode.HALF_UP), common));
|
||||
return serviceModeStatisticsList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskSituation> taskSituation() {
|
||||
LocalDate now = LocalDate.now();
|
||||
List<TaskSituation> taskSituations = new ArrayList<>();
|
||||
//未审核
|
||||
int checkStatusCount = signPatientRecordMapper.selectCheckStatus("UNAUDITED", "SERVICE_CENTER");
|
||||
//全部
|
||||
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();
|
||||
for (PatientAndNode patientAndNode : patientAndNodes) {
|
||||
LocalDate localDate = null;
|
||||
if (Objects.nonNull(patientAndNode.getDischargeTime())) {
|
||||
localDate = patientAndNode.getDischargeTime().plusDays(patientAndNode.getRouteNodeDay());
|
||||
}
|
||||
if (Objects.isNull(patientAndNode.getDischargeTime()) && Objects.nonNull(patientAndNode.getVisitDate())) {
|
||||
localDate = patientAndNode.getVisitDate().plusDays(patientAndNode.getRouteNodeDay());
|
||||
}
|
||||
if (Objects.isNull(localDate)) {
|
||||
continue;
|
||||
}
|
||||
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
||||
if (before) {
|
||||
if (!NodeExecuteStatusEnum.EXECUTED.getInfo().equals(patientAndNode.getNodeExecuteStatus())) {
|
||||
unExecutedCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
taskSituations.add(new TaskSituation("人工审核", checkStatusCount, signTimeCount));
|
||||
taskSituations.add(new TaskSituation("人工随访", unExecutedCount, allCount));
|
||||
return taskSituations;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.xinelu.manage.vo.homepage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class PatientAndNode {
|
||||
|
||||
private Long signPatientManageRouteNodeIds;
|
||||
|
||||
@ApiModelProperty(value = "出院时间(出院患者)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate dischargeTime;
|
||||
|
||||
@ApiModelProperty(value = "就诊时间,格式:yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate visitDate;
|
||||
|
||||
@ApiModelProperty(value = "管理路径节点时间,时间单位为:天")
|
||||
private Integer routeNodeDay;
|
||||
|
||||
private String nodeExecuteStatus;
|
||||
}
|
||||
@ -8,22 +8,24 @@ import java.math.BigDecimal;
|
||||
public class ServiceModeStatistics {
|
||||
|
||||
/**
|
||||
* 短信
|
||||
* 名称
|
||||
*/
|
||||
private BigDecimal message;
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* ai
|
||||
* 比例
|
||||
*/
|
||||
private BigDecimal AI;
|
||||
private BigDecimal proportion;
|
||||
|
||||
/**
|
||||
* 人工随访
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal common;
|
||||
private BigDecimal count;
|
||||
|
||||
/**
|
||||
* 微信
|
||||
*/
|
||||
private BigDecimal weChat;
|
||||
public ServiceModeStatistics(String name, BigDecimal proportion, BigDecimal count) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.proportion = proportion;
|
||||
this.count = count;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
package com.xinelu.manage.vo.homepage;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TaskSituation {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 分子
|
||||
*/
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 分母
|
||||
*/
|
||||
private Integer allCount;
|
||||
|
||||
public TaskSituation(String name, Integer count, Integer allCount) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.count = count;
|
||||
this.allCount = allCount;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -345,9 +345,9 @@
|
||||
LEFT JOIN patient_visit_record pvr ON pi.patient_visit_record_id = pvr.id
|
||||
<where>
|
||||
pi.del_flag = 0
|
||||
and spmrn.phone_push_sign = 1
|
||||
AND spmrn.route_check_status = 'AGREE'
|
||||
AND spmrn.task_node_type in ('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE')
|
||||
AND spmrn.phone_dial_method = 'COMMON'
|
||||
<if test="patientName != null and patientName != ''">
|
||||
AND pi.patient_name LIKE concat('%', #{patientName}, '%')
|
||||
</if>
|
||||
|
||||
@ -943,7 +943,7 @@
|
||||
select count(1)
|
||||
from sign_patient_manage_route_node
|
||||
where del_flag = 0
|
||||
and phone_push_sign = 0
|
||||
and phone_push_sign = 1
|
||||
and create_time >= #{firstDay}
|
||||
and create_time <= #{now}
|
||||
</select>
|
||||
@ -963,4 +963,19 @@
|
||||
OR official_push_sign =#{appletPushSign})
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectNodeExecuteStatus" resultType="com.xinelu.manage.vo.homepage.PatientAndNode">
|
||||
SELECT spmrn.id signPatientManageRouteNodeIds,
|
||||
spmrn.node_execute_status,
|
||||
pi.discharge_time,
|
||||
pi.visit_date,
|
||||
spmrn.route_node_day
|
||||
from sign_patient_manage_route_node spmrn
|
||||
LEFT JOIN sign_patient_manage_route spmr on spmr.id = spmrn.manage_route_id
|
||||
LEFT JOIN patient_info pi ON pi.id = spmr.patient_id
|
||||
where pi.del_flag = 0
|
||||
and spmrn.phone_push_sign = 1
|
||||
AND spmrn.route_check_status = 'AGREE'
|
||||
AND spmrn.task_node_type in ('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE')
|
||||
</select>
|
||||
</mapper>
|
||||
@ -523,4 +523,29 @@
|
||||
select id, patient_id, intentional_source ,intentional_time, billing_doctor_id, billing_doctor_name
|
||||
from sign_patient_record where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectCheckStatus" resultType="java.lang.Integer">
|
||||
SELECT COUNT(1)
|
||||
from sign_patient_record spr
|
||||
left join patient_info pi on pi.sign_patient_record_id = spr.id
|
||||
<where>
|
||||
spr.del_flag = 0 and pi.del_flag = 0
|
||||
<if test="serviceStatus != null">
|
||||
and pi.service_status = #{serviceStatus}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'UNAUDITED'.toString()">
|
||||
and (spr.route_check_status is null or spr.portait_check_status is null)
|
||||
</when>
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'AGREE'.toString()">
|
||||
and spr.route_check_status = #{routeCheckStatus} and spr.portait_check_status =
|
||||
#{routeCheckStatus}
|
||||
</when>
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'DISAGREE'.toString()">
|
||||
and (spr.route_check_status = #{routeCheckStatus} or spr.portait_check_status =
|
||||
#{routeCheckStatus})
|
||||
</when>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user