外呼记录

This commit is contained in:
zhangheng 2024-12-16 14:27:09 +08:00
parent c7a6f5381b
commit a01ee552ec
8 changed files with 316 additions and 32 deletions

View File

@ -5,21 +5,20 @@ import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.UploadRobotPublishRecordDto;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
import com.xinelu.manage.vo.signpatientmanageroutenode.AIDialRecordVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeInfoVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.*;
import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -148,4 +147,20 @@ public class SignPatientManageRouteNodeController extends BaseController {
signNodeService.generateStatistic();
return R.ok();
}
@ApiOperation("外呼记录")
@GetMapping("/uploadRobotPublishRecord")
public TableDataInfo uploadRobotPublishRecord(UploadRobotPublishRecordDto uploadRobotPublishRecordDto) {
startPage();
List<UploadRobotPublishRecordVo> list = signNodeService.uploadRobotPublishRecord(uploadRobotPublishRecordDto);
return getDataTable(list);
}
@ApiOperation("外呼记录导出")
@PostMapping("/export")
public void export(HttpServletResponse response, UploadRobotPublishRecordDto uploadRobotPublishRecordDto) {
List<UploadRobotPublishRecordVo> list = signNodeService.uploadRobotPublishRecord(uploadRobotPublishRecordDto);
ExcelUtil<UploadRobotPublishRecordVo> util = new ExcelUtil<UploadRobotPublishRecordVo>(UploadRobotPublishRecordVo.class);
util.exportExcel(response, list, "外呼记录");
}
}

View File

@ -0,0 +1,47 @@
package com.xinelu.manage.dto.signpatientmanageroutenode;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
/**
* @Description 外呼记录传参实体类
* @Author zh
* @Date 2024-12-13
*/
@Data
public class UploadRobotPublishRecordDto {
/**
* 时间区间开始
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate startTime;
/**
* 时间区间结束
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate endTime;
/**
* 问卷名称
*/
private String questionnaireName;
/**
* 任务节点类型,PHONE_OUTBOUND电话外呼;QUESTIONNAIRE_SCALE问卷量表
*/
private String taskNodeType;
/**
* 患者姓名
*/
private String patientName;
/**
* 医院信息
*/
private String hospitalAgencyId;
}

View File

@ -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.dto.signpatientmanageroutenode.UploadRobotPublishRecordDto;
import com.xinelu.manage.dto.statistics.FollowUpRateDto;
import com.xinelu.manage.vo.homepage.PatientAndNode;
import com.xinelu.manage.vo.signpatientmanageroutenode.*;
@ -195,4 +196,12 @@ public interface SignPatientManageRouteNodeMapper {
List<PatientAndNode> selectNodeExecuteStatus();
List<PatientFollowUpPlanVo> getFollowUpPlan(FollowUpRateDto queryDto);
/**
* 外呼记录查询
*
* @param uploadRobotPublishRecordDto 时间信息
* @return UploadRobotPublishRecordVo
*/
List<UploadRobotPublishRecordVo> selectTaskContented(UploadRobotPublishRecordDto uploadRobotPublishRecordDto);
}

View File

@ -478,10 +478,12 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
public AjaxResult selectFollowPatientInfo(Long id) {
ManualFollowPatientVO patientVO = signPatientManageRouteMapper.selectFollowPatientInfo(id);
// 设置年龄
patientVO.setAge(AgeUtil.getAgeMonth(patientVO.getBirthDate().toString()));
if (ObjectUtils.isEmpty(patientVO)) {
return AjaxResult.error("患者信息不存在!");
}
if (Objects.nonNull(patientVO.getBirthDate())) {
patientVO.setAge(AgeUtil.getAgeMonth(patientVO.getBirthDate().toString()));
}
return AjaxResult.success(patientVO);
}

View File

@ -3,19 +3,9 @@ package com.xinelu.manage.service.signpatientmanageroutenode;
import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent;
import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.*;
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeInfoVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.AIDialRecordVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.*;
import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo;
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO;
import java.time.LocalDateTime;
@ -235,4 +225,12 @@ public interface ISignPatientManageRouteNodeService {
* @Date 2024-11-15 10:52
*/
void updateBySpecialDiseaseRoute(List<Long> delDiseaseNodeIds, List<SpecialDiseaseNodeVO> updateList, List<SpecialDiseaseNodeVO> addDiseaseNodeList);
/**
* 外呼记录
*
* @param uploadRobotPublishRecordDto 时间信息
* @return UploadRobotPublishRecordVo
*/
List<UploadRobotPublishRecordVo> uploadRobotPublishRecord(UploadRobotPublishRecordDto uploadRobotPublishRecordDto);
}

View File

@ -43,10 +43,7 @@ import com.xinelu.manage.domain.specialdiseasetriggercondition.SpecialDiseaseTri
import com.xinelu.manage.domain.textmessage.TextMessage;
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.*;
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
@ -76,15 +73,7 @@ import com.xinelu.manage.vo.patientinfo.PatientNextTaskVo;
import com.xinelu.manage.vo.patientquestionsubmitresult.PatientQuestionSubmitResultVO;
import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo;
import com.xinelu.manage.vo.questionInfo.QuestionVO;
import com.xinelu.manage.vo.signpatientmanageroutenode.AIDialRecordVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeInfoVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeInfoVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.*;
import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo;
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO;
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
@ -1413,6 +1402,17 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
}
}
/**
* 外呼记录
*
* @param uploadRobotPublishRecordDto 时间信息
* @return UploadRobotPublishRecordVo
*/
@Override
public List<UploadRobotPublishRecordVo> uploadRobotPublishRecord(UploadRobotPublishRecordDto uploadRobotPublishRecordDto) {
return signPatientManageRouteNodeMapper.selectTaskContented(uploadRobotPublishRecordDto);
}
/**
* 根据管理路径生成任务
* @param signPatientManageRoute 签约管理路径

View File

@ -0,0 +1,162 @@
package com.xinelu.manage.vo.signpatientmanageroutenode;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Description 外呼记录返回实体类
* @Author zh
* @Date 2024-12-13
*/
@Data
public class UploadRobotPublishRecordVo {
/**
* 所属机构id
*/
@ApiModelProperty(value = "所属机构id")
private Long hospitalAgencyId;
/**
* 所属机构名称
*/
@ApiModelProperty(value = "所属机构名称")
@Excel(name = "医院")
private String hospitalAgencyName;
/**
* 所属科室id
*/
@ApiModelProperty(value = "所属科室id")
private Long departmentId;
/**
* 所属科室名称
*/
@ApiModelProperty(value = "所属科室名称")
@Excel(name = "科室名称")
private String departmentName;
/**
* 就诊时间格式yyyy-MM-dd HH:mm:ss
*/
@ApiModelProperty(value = "就诊时间格式yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "就诊时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime visitDate;
/**
* 路径名称任务名称
*/
@ApiModelProperty(value = "路径名称")
private String manageRouteName;
/**
* 患者表id
*/
@ApiModelProperty(value = "患者表id")
private Long patientId;
/**
* 患者姓名
*/
@ApiModelProperty(value = "患者姓名")
@Excel(name = "姓名")
private String patientName;
/**
* 患者电话
*/
@ApiModelProperty(value = "患者电话")
@Excel(name = "联系电话")
private String patientPhone;
@ApiModelProperty(value = "年龄")
@Excel(name = "年龄")
private Integer age;
/**
* 主要诊断
*/
@ApiModelProperty(value = "主要诊断")
@Excel(name = "诊断")
private String mainDiagnosis;
/**
* 冗余:整个问卷中是否包含不满意项;DISCONTENTED:不满意;CONTENTED:满意;默认CONTENTED;
* 2024/12/2
*/
@Excel(name = "调查结果")
private String contentedFlag;
/**
* 冗余:整个问卷中是否包含异常项;REMARKABLE:异常的;ROUTINE:正常的;默认ROUTINE
* 2024/12/2
*/
@ApiModelProperty(name = "异常项")
private String remarkableFlag;
/**
* 执行时间格式HH:mm
*/
@ApiModelProperty(value = "执行时间格式HH:mm")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "随访时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime nodePlanTime;
/**
* 话术表 ID
*/
@ApiModelProperty(value = "话术表 ID")
private Long scriptInfoId;
/**
* 问卷表id
*/
@ApiModelProperty(value = "问卷表id")
private Long questionInfoId;
/**
* 问卷模板名称
*/
@ApiModelProperty(value = "问卷模板名称")
private String questionnaireName;
/**
* 节点任务执行状态已执行EXECUTED未执行UNEXECUTED
*/
@ApiModelProperty(value = "节点任务执行状态已执行EXECUTED未执行UNEXECUTED")
private String nodeExecuteStatus;
@ApiModelProperty(value = "默认已接通CONNECTED未接通:NOTCONNECTED")
private String phoneConnectStatus;
/**
* 任务节点类型PHONE_OUTBOUND电话外呼(默认自动人工或自动)QUESTIONNAIRE_SCALE问卷量表消息推送或人工随访PROPAGANDA_ARTICLE宣教文章TEXT_REMIND文字提醒微信短信公众号
*/
@ApiModelProperty(value = "任务节点类型")
private String taskNodeType;
/**
* 电话拨通情况SUCCESS成功FAILURE失败EXPIRED超期自动作废如超期一周NULL或空字符串缺省值表示未执行
*/
@ApiModelProperty(value = "电话拨通情况")
private String phoneNodeExecuteResultStatus;
@ApiModelProperty(value = "拨打状态DIALED,已拨打NODIALED:未拨打默认NULL表示未拨打")
private String dialStatus;
/**
* 问卷关联话术id
*/
private Long scriptTemplateId;
/**
* 问卷关联话术名称 (展示 话术名称
*/
private String scriptTemplateName;
}

View File

@ -1083,4 +1083,55 @@
</if>
</where>
</select>
<select id="selectTaskContented"
resultType="com.xinelu.manage.vo.signpatientmanageroutenode.UploadRobotPublishRecordVo">
SELECT
spmrn.manage_route_name,
spmrn.task_node_type,
spmrn.dial_status,
spmrn.question_info_id,
spmrn.questionnaire_name,
spmrn.node_execute_status,
spmrn.node_plan_time,
pqsr.contented_flag,
pqsr.remarkable_flag,
pi.patient_phone,
pi.patient_name,
pi.id AS patientId,
pi.department_name,
pi.department_id,
pi.hospital_agency_id,
pi.hospital_agency_name,
pi.visit_date,
pi.age,
pi.patient_visit_record_id,
pvr.main_diagnosis,
CASE
WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN spmrn.script_info_id
WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN qi.script_info_id
END AS scriptTemplateId,
CASE
WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN si.script_name
WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN qi.script_name
END AS scriptTemplateName
FROM sign_patient_manage_route_node spmrn
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
LEFT JOIN patient_question_submit_result pqsr ON pqsr.manage_route_node_id = spmrn.id
LEFT JOIN patient_info pi ON spmr.patient_id = pi.id
LEFT JOIN patient_visit_record pvr ON pi.id = pvr.patient_id
LEFT JOIN question_info qi on spmrn.question_info_id = qi.id
LEFT JOIN script_info si on si.id = spmrn.script_info_id
WHERE spmrn.task_node_type = #{taskNodeType}
<if test="questionnaireName != null and questionnaireName != ''">
AND spmrn.questionnaire_name = #{questionnaireName}
</if>
AND spmrn.del_flag = 0
<if test="startTime != null"><!-- 开始时间检索 -->
AND date_format(spmrn.node_plan_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null"><!-- 结束时间检索 -->
AND date_format(spmrn.node_plan_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</select>
</mapper>