修改患者详情页面接口。

This commit is contained in:
haown 2024-04-16 14:23:10 +08:00
parent 93ae87e107
commit 09c3317f19
8 changed files with 92 additions and 85 deletions

View File

@ -3,7 +3,6 @@ package com.xinelu.manage.controller.signpatientmanageroute;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
@ -13,6 +12,7 @@ import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitRe
import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteService;
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO;
import io.swagger.annotations.Api;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
@ -27,11 +27,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 签约患者管理任务路径Controller
* 签约患者管理任务路径控制器
*
* @author haown
* @date 2024-03-18
*/
@Api(tags = "签约患者管理任务路径控制器")
@RestController
@RequestMapping("/manage/signroute")
public class SignPatientManageRouteController extends BaseController {
@ -126,11 +127,4 @@ public class SignPatientManageRouteController extends BaseController {
return signPatientManageRouteService.addPatientQuestionResult(dto);
}
/**
* 患者详情--康复计划及记录
*/
@GetMapping("/getRouteList")
public R<List<SignPatientManageRoute>> getRouteList(SignPatientManageRoute signPatientManageRoute) {
return R.ok(signPatientManageRouteService.getRouteList(signPatientManageRoute));
}
}

View File

@ -3,7 +3,8 @@ package com.xinelu.manage.controller.signpatientmanageroutenode;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
@ -44,12 +45,12 @@ public class SignPatientManageRouteNodeController extends BaseController {
}
/**
* 查询患者任务节点列表
* 患者详情--查询患者手动创建的任务节点列表
*/
@ApiOperation("查询患者任务节点列表")
@ApiOperation("患者详情--查询患者手动创建的任务节点列表")
@GetMapping("/getNodeList")
public R<List<SignPatientManageRouteNode>> getNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNode> list = signNodeService.getNodeList(patientTaskDto);
public R<List<SignPatientManageRouteNodeVo>> getNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNodeVo> list = signNodeService.getNodeList(patientTaskDto);
return R.ok(list);
}
@ -59,6 +60,15 @@ public class SignPatientManageRouteNodeController extends BaseController {
@ApiOperation("任务审核--查询患者任务路径及节点")
@GetMapping("/getRouteNodeList")
public R<List<SignPatientManageRouteNodeVo>> getRouteNodeList(PatientTaskDto patientTaskDto) {
if (patientTaskDto.getPatientId() == null) {
throw new ServiceException("请选择患者!");
}
if (StringUtils.isBlank(patientTaskDto.getRouteCheckStatus())) {
throw new ServiceException("请选择审核状态!");
}
if (StringUtils.isBlank(patientTaskDto.getTaskCreateType())) {
throw new ServiceException("请选择任务创建类型!");
}
List<SignPatientManageRouteNodeVo> list = signNodeService.getRouteNodeList(patientTaskDto);
return R.ok(list);
}

View File

@ -84,10 +84,4 @@ public interface ISignPatientManageRouteService {
*/
AjaxResult addPatientQuestionResult(PatientQuestionSubmitResultDTO dto);
/**
* 根据患者主键查询患者任务列表
* @param signPatientManageRoute 签约患者管理任务路径
* @return 任务列表
*/
List<SignPatientManageRoute> getRouteList(SignPatientManageRoute signPatientManageRoute);
}

View File

@ -9,7 +9,6 @@ import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.AgeUtil;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.patientquestionoptionresult.PatientQuestionOptionResult;
import com.xinelu.manage.domain.patientquestionsubjectresult.PatientQuestionSubjectResult;
import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult;
@ -34,16 +33,15 @@ import com.xinelu.manage.vo.manualfollowup.ManualFollowPatientVO;
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO;
import com.xinelu.manage.vo.signroutetriggercondition.SignRouteTriggerConditionVO;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.annotation.Resource;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
@ -308,20 +306,6 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
return AjaxResult.success();
}
@Override public List<SignPatientManageRoute> getRouteList(SignPatientManageRoute signPatientManageRoute) {
// 查询患者最新一条签约记录
if (signPatientManageRoute.getPatientId() == null) {
throw new ServiceException("请选择正确的患者");
}
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(signPatientManageRoute.getPatientId());
if (ObjectUtils.isEmpty(patientInfo)) {
throw new ServiceException("请选择正确的患者");
}
SignPatientManageRoute routeQuery = new SignPatientManageRoute();
routeQuery.setSignPatientRecordId(patientInfo.getSignPatientRecordId());
return signPatientManageRouteMapper.selectSignPatientManageRouteList(routeQuery);
}
/**
* 新增患者管理任务执行记录
*/

View File

@ -28,7 +28,7 @@ public interface ISignPatientManageRouteNodeService {
* @param patientTaskDto 任务查询传输对象
* @return 患者管理任务路径节点
*/
List<SignPatientManageRouteNode> getNodeList(PatientTaskDto patientTaskDto);
List<SignPatientManageRouteNodeVo> getNodeList(PatientTaskDto patientTaskDto);
/**
* 查询患者管理路径节点

View File

@ -2,8 +2,8 @@ package com.xinelu.manage.service.signpatientmanageroutenode.impl;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.constant.TaskContentConstants;
import com.xinelu.common.constant.TaskCreateTypeConstant;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
@ -18,11 +18,13 @@ import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRout
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo;
import com.xinelu.manage.vo.questionInfo.QuestionVO;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeInfoVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@ -54,6 +56,8 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
private IQuestionInfoService questionInfoService;
@Resource
private IPropagandaInfoService propagandaInfoService;
@Resource
private ISpecialDiseaseRouteService specialDiseaseRouteService;
/**
* 查询签约患者管理任务路径节点
@ -66,63 +70,74 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
return signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id);
}
@Override public List<SignPatientManageRouteNode> getNodeList(PatientTaskDto patientTaskDto) {
@Override public List<SignPatientManageRouteNodeVo> getNodeList(PatientTaskDto patientTaskDto) {
if (patientTaskDto.getPatientId() == null) {
throw new ServiceException("患者信息有误");
}
return signPatientManageRouteNodeMapper.getNodeList(patientTaskDto);
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId());
if (ObjectUtils.isEmpty(patientInfo)) {
throw new ServiceException("患者信息有误!");
}
patientTaskDto.setSignPatientRecordId(patientInfo.getSignPatientRecordId());
return getRouteNodeList(patientTaskDto);
}
@Override public List<SignPatientManageRouteNodeVo> getRouteNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNodeVo> retList = new ArrayList<>();
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId());
if (patientTaskDto.getPatientId() == null || ObjectUtils.isEmpty(patientInfo)) {
if (ObjectUtils.isEmpty(patientInfo)) {
throw new ServiceException("请选择患者!");
}
if (StringUtils.isBlank(patientTaskDto.getRouteCheckStatus())) {
throw new ServiceException("请选择审核状态!");
}
if (StringUtils.isBlank(patientTaskDto.getTaskCreateType())) {
throw new ServiceException("请选择任务创建类型!");
}
// 根据任务创建类型审核状态查询节点列表
List<SignPatientManageRouteNode> allNodeList = signPatientManageRouteNodeMapper.getNodeList(patientTaskDto);
// 根据任务id进行分组
Map<Long, List<SignPatientManageRouteNode>> groupByRoute = allNodeList.stream().collect(Collectors.groupingBy(SignPatientManageRouteNode::getManageRouteId));
List<SignPatientManageRouteNodeInfoVo> nodeInfoVoList = new ArrayList<>();
SpecialDiseaseRouteVO specialDiseaseRoute = null;
for (Long manageRouteId : groupByRoute.keySet()) {
List<SignPatientManageRouteNode> nodeList = groupByRoute.get(manageRouteId);
SignPatientManageRoute manageRoute = signRouteMapper.selectSignPatientManageRouteById(manageRouteId);
// 查询模板内容
for (SignPatientManageRouteNode node : nodeList) {
SignPatientManageRouteNodeInfoVo signNodeInfo = new SignPatientManageRouteNodeInfoVo();
BeanUtils.copyBeanProp(signNodeInfo, node);
JSONObject detailInfo = new JSONObject();
switch (node.getTaskType()) {
case TaskContentConstants.PHONE_OUTBOUND: // 电话外呼-查询话术表
if (node.getPhoneId() != null) {
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneId());
detailInfo = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo));
// 判断手动创建或自动生成
switch (manageRoute.getTaskCreateType()) {
case TaskCreateTypeConstant.MANUAL_CREATE:
// 查询模板内容
for (SignPatientManageRouteNode node : nodeList) {
SignPatientManageRouteNodeInfoVo signNodeInfo = new SignPatientManageRouteNodeInfoVo();
BeanUtils.copyBeanProp(signNodeInfo, node);
JSONObject detailInfo = new JSONObject();
switch (node.getTaskType()) {
case TaskContentConstants.PHONE_OUTBOUND: // 电话外呼-查询话术表
if (node.getPhoneId() != null) {
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneId());
detailInfo = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo));
}
break;
case (TaskContentConstants.QUESTIONNAIRE_SCALE): // 问卷量表-返回问卷信息
case (TaskContentConstants.ARTIFICIAL_FOLLOW_UP): // 人工随访-返回问卷信息
if (node.getQuestionInfoId() != null) {
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getQuestionInfoId());
detailInfo = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
}
break;
case (TaskContentConstants.PROPAGANDA_ARTICLE): // 宣教文章-返回宣教库信息
if (node.getPropagandaInfoId() != null) {
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getPropagandaInfoId());
detailInfo = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
}
break;
}
break;
case (TaskContentConstants.QUESTIONNAIRE_SCALE): // 问卷量表-返回问卷信息
case (TaskContentConstants.ARTIFICIAL_FOLLOW_UP): // 人工随访-返回问卷信息
if (node.getQuestionInfoId() != null) {
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getQuestionInfoId());
detailInfo = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
}
break;
case (TaskContentConstants.PROPAGANDA_ARTICLE): // 宣教文章-返回宣教库信息
if (node.getPropagandaInfoId() != null) {
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getPropagandaInfoId());
detailInfo = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
}
break;
}
signNodeInfo.setDetailInfo(detailInfo);
nodeInfoVoList.add(signNodeInfo);
signNodeInfo.setDetailInfo(detailInfo);
nodeInfoVoList.add(signNodeInfo);
}
break;
case TaskCreateTypeConstant.MANUAL_MATCHE:
// 查询专病路径
specialDiseaseRoute = specialDiseaseRouteService.selectSpecialDiseaseRouteById(manageRoute.getRouteId());
break;
}
retList.add(SignPatientManageRouteNodeVo.builder().manageRouteId(manageRouteId)
retList.add(SignPatientManageRouteNodeVo.builder().specialDiseaseRoute(specialDiseaseRoute)
.manageRouteId(manageRouteId)
.routeName(manageRoute.getRouteName())
.taskCreateType(manageRoute.getTaskCreateType())
.suitRange(manageRoute.getSuitRange())

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.vo.signpatientmanageroutenode;
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
@ -20,6 +21,12 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class SignPatientManageRouteNodeVo {
/**
* 专病管理路径信息
* */
@ApiModelProperty(value = "签约患者管理任务表id")
private SpecialDiseaseRouteVO specialDiseaseRoute;
/** 签约患者管理任务表id */
@ApiModelProperty(value = "签约患者管理任务表id")
private Long manageRouteId;

View File

@ -33,7 +33,7 @@
<result property="propagandaTitle" column="propaganda_title"/>
<result property="propagandaContent" column="propaganda_content"/>
<result property="messagePushSign" column="message_push_sign"/>
<result property="messageTemplateId" column="message_template__id"/>
<result property="messageTemplateId" column="message_template_id"/>
<result property="messageTemplateName" column="message_template_name"/>
<result property="messagePreview" column="message_preview"/>
<result property="messageNodeContent" column="message_node_content"/>
@ -69,7 +69,7 @@
</resultMap>
<sql id="selectSignPatientManageRouteNodeVo">
select id, manage_route_id, manage_route_name, route_node_name, route_node_day, task_type, task_status, task_subdivision, second_classify_describe, execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id, phone_message_template_name, question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign, message_template__id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content, official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, follow_template_id, follow_template_name, follow_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark, route_handle_id, route_handle_person, route_link,text_remind_content, create_by, create_time, update_by, update_time from sign_patient_manage_route_node
select id, manage_route_id, manage_route_name, route_node_name, route_node_day, task_type, task_status, task_subdivision, second_classify_describe, execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id, phone_message_template_name, question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign, message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content, official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, follow_template_id, follow_template_name, follow_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark, route_handle_id, route_handle_person, route_link,text_remind_content, create_by, create_time, update_by, update_time from sign_patient_manage_route_node
</sql>
<select id="selectSignPatientManageRouteNodeList" parameterType="SignPatientManageRouteNode" resultMap="SignPatientManageRouteNodeResult">
@ -138,6 +138,9 @@
and node.route_check_status = #{routeCheckStatus}
</when>
</choose>
<if test="signPatientRecordId != null">
and route.sign_patient_record_id = #{signPatientRecordId}
</if>
</where>
</select>
@ -199,7 +202,7 @@
</if>
<if test="messagePushSign != null">message_push_sign,
</if>
<if test="messageTemplateId != null">message_template__id,
<if test="messageTemplateId != null">message_template_id,
</if>
<if test="messageTemplateName != null">message_template_name,
</if>
@ -393,7 +396,7 @@
insert into sign_patient_manage_route_node(manage_route_id, manage_route_name, route_node_name, route_node_day, task_type, task_status, task_subdivision, second_classify_describe,
execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id,
phone_message_template_name, question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign,
message_template__id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content,
message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content,
official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, follow_template_id,
follow_template_name, follow_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark,
route_handle_id, route_handle_person, route_link, text_remind_content,create_by, create_time, update_by, update_time)
@ -492,7 +495,7 @@
<if test="messagePushSign != null">message_push_sign =
#{messagePushSign},
</if>
<if test="messageTemplateId != null">message_template__id =
<if test="messageTemplateId != null">message_template_id =
#{messageTemplateId},
</if>
<if test="messageTemplateName != null">message_template_name =