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

This commit is contained in:
haown 2024-07-10 18:09:04 +08:00
commit d50e0cb37f
15 changed files with 221 additions and 92 deletions

View File

@ -87,14 +87,14 @@ public class PatientQuestionSubjectResult extends BaseEntity {
* 回答填空题 * 回答填空题
*/ */
@ApiModelProperty(value = "回答") @ApiModelProperty(value = "回答")
@Excel(name = "回答", readConverterExp = "=空题") @Excel(name = "回答", readConverterExp = "空题")
private String fillBlanksAnswer; private String fillBlanksAnswer;
/** /**
* 选项个数打分题 * 选项个数打分题
*/ */
@ApiModelProperty(value = "选项个数") @ApiModelProperty(value = "选项个数")
@Excel(name = "选项个数", readConverterExp = "=分题") @Excel(name = "选项个数", readConverterExp = "分题")
private Integer optionCount; private Integer optionCount;
/** /**

View File

@ -78,4 +78,11 @@ public interface ResidentInfoMapper {
* @return 居民基本信息 * @return 居民基本信息
*/ */
List<ResidentInfo> getResidentInfoByPhoneAndName(@Param("phone") String phone, @Param("patientName") String patientName); List<ResidentInfo> getResidentInfoByPhoneAndName(@Param("phone") String phone, @Param("patientName") String patientName);
/**
* 更新用户openid
* @param residentInfo 用户信息
* @return 结果
*/
int updateResidentInfoOpenid(ResidentInfo residentInfo);
} }

View File

@ -94,15 +94,6 @@ public interface SignPatientManageRouteNodeMapper {
*/ */
List<PatientTaskVo> selectPatientTaskList(PatientTaskDto patientTaskDto); List<PatientTaskVo> selectPatientTaskList(PatientTaskDto patientTaskDto);
/**
* 查询个人任务消息
*
* @param residentId 用户id
* @param nodeExecuteStatus 状态
* @return SignPatientManageRouteNode
*/
List<SignPatientManageRouteNode> selectManageRouteByResidentId(@Param("residentId") Long residentId, @Param("nodeExecuteStatus") String nodeExecuteStatus);
/** /**
* 修改消息状态 * 修改消息状态
* *

View File

@ -173,7 +173,11 @@
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteResidentInfoById" parameterType="Long"> <update id="updateResidentInfoOpenid" parameterType="com.xinelu.manage.domain.residentinfo.ResidentInfo">
UPDATE resident_info SET open_id = #{openId} WHERE id = #{id}
</update>
<delete id="deleteResidentInfoById" parameterType="Long">
delete from resident_info where id = #{id} delete from resident_info where id = #{id}
</delete> </delete>

View File

@ -345,7 +345,7 @@
LEFT JOIN patient_info pi ON spmr.patient_id = pi.id LEFT JOIN patient_info pi ON spmr.patient_id = pi.id
LEFT JOIN patient_visit_record pvr ON pi.patient_visit_record_id = pvr.id LEFT JOIN patient_visit_record pvr ON pi.patient_visit_record_id = pvr.id
<where> <where>
pi.del_flag = '0' AND spmr.task_create_type = 'MANUAL_CREATE' pi.del_flag = '0'
AND spmrn.route_check_status = 'AGREE' AND spmrn.route_check_status = 'AGREE'
AND spmrn.task_type in ('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE','ARTIFICIAL_FOLLOW_UP') AND spmrn.task_type in ('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE','ARTIFICIAL_FOLLOW_UP')
<if test="patientName != null and patientName != ''"> <if test="patientName != null and patientName != ''">

View File

@ -764,25 +764,6 @@
group by patient.hospital_agency_id, patient.id group by patient.hospital_agency_id, patient.id
</select> </select>
<select id="selectManageRouteByResidentId"
resultType="com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode">
select spmrn.id,
spmrn.manage_route_name,
spmrn.route_node_name,
spmrn.route_node_day,
spmrn.update_time,
spmrn.message_status
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.resident_id = #{residentId}
and spmrn.node_execute_status = #{nodeExecuteStatus}
and (spmrn.applet_push_sign = 1 or spmrn.official_push_sign = 1)
and spmrn.del_flag = 0
and pi.del_flag = 0
Order BY spmrn.update_time DESC
</select>
<update id="updateMessageStatus"> <update id="updateMessageStatus">
update sign_patient_manage_route_node update sign_patient_manage_route_node
set message_status = #{messageStatus} set message_status = #{messageStatus}

View File

@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* 小程序首页Controller * 小程序首页Controller
@ -35,11 +36,11 @@ public class HomePageController extends BaseController {
} }
/** /**
* 获取话术信息详细信息 * 获取话术信息详细信息(随访)
*/ */
@GetMapping("/selectScriptInfo") @GetMapping("/selectScriptInfo")
public AjaxResult selectScriptInfo(Long templateId) { public AjaxResult selectScriptInfo(Long patientTaskExecuteRecordId) {
return AjaxResult.success(homePageService.selectScriptInfo(templateId)); return AjaxResult.success(homePageService.selectScriptInfo(patientTaskExecuteRecordId));
} }
/** /**
@ -51,15 +52,18 @@ public class HomePageController extends BaseController {
} }
/** /**
* 问卷记录信息 * 问卷记录信息消息记录
*/ */
@GetMapping("/selectQuestionSubmit") @GetMapping("/selectQuestionSubmit")
public AjaxResult selectQuestionSubmit(Long patientQuestionSubmitResultId, Long patientTaskExecuteRecordId) { public AjaxResult selectQuestionSubmit(Long patientQuestionSubmitResultId, Long patientTaskExecuteRecordId) {
if (Objects.isNull(patientQuestionSubmitResultId) && Objects.isNull(patientTaskExecuteRecordId)) {
return AjaxResult.error("请选择记录信息!");
}
return homePageService.selectQuestionSubmit(patientQuestionSubmitResultId, patientTaskExecuteRecordId); return homePageService.selectQuestionSubmit(patientQuestionSubmitResultId, patientTaskExecuteRecordId);
} }
/** /**
* 问卷提交 * 问卷提交消息记录
*/ */
@PostMapping("/updateTaskExecuteRecord") @PostMapping("/updateTaskExecuteRecord")
public AjaxResult updatePatientTaskExecuteRecord(@RequestBody PatientQuestionSubmitResultDTO dto) { public AjaxResult updatePatientTaskExecuteRecord(@RequestBody PatientQuestionSubmitResultDTO dto) {
@ -85,15 +89,7 @@ public class HomePageController extends BaseController {
} }
/** /**
* 微信小程序消息通知跳转页面 * 消息通知列表消息记录
*/
@GetMapping("/subscriptionMessage")
public AjaxResult subscriptionMessage(Long id) {
return homePageService.subscriptionMessage(id);
}
/**
* 消息通知列表
*/ */
@GetMapping("/messageNotification") @GetMapping("/messageNotification")
public AjaxResult selectSignPatientManageRouteNode(Long residentId) { public AjaxResult selectSignPatientManageRouteNode(Long residentId) {
@ -101,7 +97,7 @@ public class HomePageController extends BaseController {
} }
/** /**
* 消息推送内容 * 消息推送内容消息记录
*/ */
@GetMapping("/selectMessageContent") @GetMapping("/selectMessageContent")
public AjaxResult selectMessageContent(Long manageRouteNodeId) { public AjaxResult selectMessageContent(Long manageRouteNodeId) {
@ -109,7 +105,7 @@ public class HomePageController extends BaseController {
} }
/** /**
* 修改消息状态 * 修改消息状态消息记录
*/ */
@PostMapping("/updateMessageStatus") @PostMapping("/updateMessageStatus")
public AjaxResult updateMessageStatus(@RequestBody SignPatientManageRouteNode signPatientManageRouteNode) { public AjaxResult updateMessageStatus(@RequestBody SignPatientManageRouteNode signPatientManageRouteNode) {

View File

@ -1,6 +1,8 @@
package com.xinelu.mobile.mapper.homepage; package com.xinelu.mobile.mapper.homepage;
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord; import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
import com.xinelu.manage.vo.signpatientmanageroute.PhonePush;
import com.xinelu.mobile.vo.homepage.MessageTabulationVO;
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO; import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
import com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire; import com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire;
import com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO; import com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO;
@ -61,8 +63,30 @@ public interface HomePageMapper {
/** /**
* 修改执行状态 * 修改执行状态
* *
* @param signPatientManageRouteNodeIds * @param signPatientManageRouteNodeIds 节点id
* @return int * @return int
*/ */
int updateNodeExecuteStatusByIds(@Param("signPatientManageRouteNodeIds") List<Long> signPatientManageRouteNodeIds); int updateNodeExecuteStatusByIds(@Param("signPatientManageRouteNodeIds") List<Long> signPatientManageRouteNodeIds);
/**
* 查询个人任务消息
*
* @param residentId 用户id
* @param nodeExecuteStatus 状态
* @return SignPatientManageRouteNode
*/
List<MessageTabulationVO> selectManageRouteByResidentId(@Param("residentId") Long residentId, @Param("nodeExecuteStatus") String nodeExecuteStatus);
/**
* 查询患者管理任务执行记录表
*
* @param manageRouteNodeId id
* @return PatientTaskExecuteRecord
*/
PatientTaskExecuteRecord selectPatientManageRouteByManageRouteNodeId(Long manageRouteNodeId);
/**
* 话术类型代办处理详情
*/
PhonePush selectPhoneNodeContent(Long patientTaskExecuteRecordId);
} }

View File

@ -279,6 +279,8 @@ public class AppletPersonCenterServiceImpl implements AppletPersonCenterService
// 更新用户的openid // 更新用户的openid
ResidentInfo residentInfo = residentInfos.get(0); ResidentInfo residentInfo = residentInfos.get(0);
residentInfo.setOpenId(openId); residentInfo.setOpenId(openId);
residentInfo.setUpdateBy(residentInfo.getPatientName());
residentInfo.setUpdateTime(LocalDateTime.now());
residentInfoMapper.updateResidentInfo(residentInfo); residentInfoMapper.updateResidentInfo(residentInfo);
log.info("用户注册成功,姓名:{},手机号:{}openid{}", verifySmsCodeDTO.getPatientName(), verifySmsCodeDTO.getPhoneNum(), openId); log.info("用户注册成功,姓名:{},手机号:{}openid{}", verifySmsCodeDTO.getPatientName(), verifySmsCodeDTO.getPhoneNum(), openId);
return AjaxResult.success("注册成功!", residentInfo); return AjaxResult.success("注册成功!", residentInfo);
@ -310,7 +312,9 @@ public class AppletPersonCenterServiceImpl implements AppletPersonCenterService
// 清空openid字段更新用户信息 // 清空openid字段更新用户信息
residentInfo.setOpenId(null); residentInfo.setOpenId(null);
residentInfoMapper.updateResidentInfo(residentInfo); residentInfo.setUpdateBy(residentInfo.getPatientName());
residentInfo.setUpdateTime(LocalDateTime.now());
residentInfoMapper.updateResidentInfoOpenid(residentInfo);
log.info("解绑成功,手机号:{}openId{}", phoneNum, openId); log.info("解绑成功,手机号:{}openId{}", phoneNum, openId);
return AjaxResult.success("解绑成功!"); return AjaxResult.success("解绑成功!");
} catch (Exception e) { } catch (Exception e) {

View File

@ -3,9 +3,9 @@ package com.xinelu.mobile.service.homepage;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord; import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO; import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
import com.xinelu.manage.vo.signpatientmanageroute.PhonePush;
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO; import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
import java.util.List; import java.util.List;
@ -23,10 +23,10 @@ public interface HomePageService {
/** /**
* 查询话术信息 * 查询话术信息
* *
* @param templateId 话术信息主键 * @param patientTaskExecuteRecordId 话术信息主键
* @return 话术信息 * @return 话术信息
*/ */
ScriptInfo selectScriptInfo(Long templateId); PhonePush selectScriptInfo(Long patientTaskExecuteRecordId);
/** /**
* 问卷信息 * 问卷信息
@ -68,14 +68,6 @@ public interface HomePageService {
*/ */
TableDataInfo satisfactionQuestionnaire(Long residentId); TableDataInfo satisfactionQuestionnaire(Long residentId);
/**
* 微信小程序消息通知跳转页面
*
* @param id 节点
* @return AjaxResult
*/
AjaxResult subscriptionMessage(Long id);
/** /**
* 消息通知列表 * 消息通知列表
* *

View File

@ -13,7 +13,6 @@ import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmi
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord; import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
import com.xinelu.manage.domain.questioninfo.QuestionInfo; import com.xinelu.manage.domain.questioninfo.QuestionInfo;
import com.xinelu.manage.domain.questionsubject.QuestionSubject; import com.xinelu.manage.domain.questionsubject.QuestionSubject;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.dto.patientquestionoptionresult.PatientQuestionOptionResultDTO; import com.xinelu.manage.dto.patientquestionoptionresult.PatientQuestionOptionResultDTO;
import com.xinelu.manage.dto.patientquestionsubjectresult.PatientQuestionSubjectResultDTO; import com.xinelu.manage.dto.patientquestionsubjectresult.PatientQuestionSubjectResultDTO;
@ -21,6 +20,7 @@ import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitRe
import com.xinelu.manage.mapper.patientquestionoptionresult.PatientQuestionOptionResultMapper; import com.xinelu.manage.mapper.patientquestionoptionresult.PatientQuestionOptionResultMapper;
import com.xinelu.manage.mapper.patientquestionsubjectresult.PatientQuestionSubjectResultMapper; import com.xinelu.manage.mapper.patientquestionsubjectresult.PatientQuestionSubjectResultMapper;
import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper; import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper;
import com.xinelu.manage.mapper.patienttaskexecuterecord.PatientTaskExecuteRecordMapper;
import com.xinelu.manage.mapper.questioninfo.QuestionInfoMapper; import com.xinelu.manage.mapper.questioninfo.QuestionInfoMapper;
import com.xinelu.manage.mapper.questionsubject.QuestionSubjectMapper; import com.xinelu.manage.mapper.questionsubject.QuestionSubjectMapper;
import com.xinelu.manage.mapper.questionsubjectoption.QuestionSubjectOptionMapper; import com.xinelu.manage.mapper.questionsubjectoption.QuestionSubjectOptionMapper;
@ -31,9 +31,11 @@ import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo;
import com.xinelu.manage.vo.questionInfo.QuestionVO; import com.xinelu.manage.vo.questionInfo.QuestionVO;
import com.xinelu.manage.vo.questionsubject.QuestionSubjectVO; import com.xinelu.manage.vo.questionsubject.QuestionSubjectVO;
import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO; import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO;
import com.xinelu.manage.vo.signpatientmanageroute.PhonePush;
import com.xinelu.mobile.mapper.homepage.HomePageMapper; import com.xinelu.mobile.mapper.homepage.HomePageMapper;
import com.xinelu.mobile.service.homepage.HomePageService; import com.xinelu.mobile.service.homepage.HomePageService;
import com.xinelu.mobile.vo.homepage.MessageContentVO; import com.xinelu.mobile.vo.homepage.MessageContentVO;
import com.xinelu.mobile.vo.homepage.MessageTabulationVO;
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO; import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
import com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire; import com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -78,6 +80,8 @@ public class HomePageServiceImpl implements HomePageService {
private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper; private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper;
@Resource @Resource
private IPropagandaInfoService propagandaInfoService; private IPropagandaInfoService propagandaInfoService;
@Resource
private PatientTaskExecuteRecordMapper patientTaskExecuteRecordMapper;
/** /**
* 我的随访列表 * 我的随访列表
@ -87,7 +91,7 @@ public class HomePageServiceImpl implements HomePageService {
*/ */
@Override @Override
public TableDataInfo myFollowUp(MyFollowUpVO myFollowUp) { public TableDataInfo myFollowUp(MyFollowUpVO myFollowUp) {
myFollowUp.setRouteNodeName(RouteNodeNameEnum.AFTER_DISCHARGE.getInfo()); myFollowUp.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTED.getInfo());
List<MyFollowUpVO> myFollowUpList = homePageMapper.selectManageRouteNode(myFollowUp); List<MyFollowUpVO> myFollowUpList = homePageMapper.selectManageRouteNode(myFollowUp);
int total = myFollowUpList.size(); int total = myFollowUpList.size();
if (CollectionUtils.isEmpty(myFollowUpList)) { if (CollectionUtils.isEmpty(myFollowUpList)) {
@ -97,7 +101,7 @@ public class HomePageServiceImpl implements HomePageService {
if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) { if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) {
myFollowUpVO.setFollowDate(myFollowUpVO.getDischargeTime().plusDays(myFollowUpVO.getRouteNodeDay())); myFollowUpVO.setFollowDate(myFollowUpVO.getDischargeTime().plusDays(myFollowUpVO.getRouteNodeDay()));
} }
myFollowUpVO.setFollowName("出院后第" + myFollowUpVO.getRouteNodeDay() + ""); myFollowUpVO.setFollowName(myFollowUpVO.getManageRouteNodeName() + myFollowUpVO.getRouteNodeDay() + "");
} }
myFollowUpList.sort(Comparator.comparing(MyFollowUpVO::getFollowDate).reversed()); myFollowUpList.sort(Comparator.comparing(MyFollowUpVO::getFollowDate).reversed());
//处理上面查询的list集合 //处理上面查询的list集合
@ -114,12 +118,12 @@ public class HomePageServiceImpl implements HomePageService {
/** /**
* 查询话术信息 * 查询话术信息
* *
* @param templateId 话术信息主键 * @param patientTaskExecuteRecordId 话术信息主键
* @return 话术信息 * @return 话术信息
*/ */
@Override @Override
public ScriptInfo selectScriptInfo(Long templateId) { public PhonePush selectScriptInfo(Long patientTaskExecuteRecordId) {
return scriptInfoMapper.selectScriptInfoById(templateId); return homePageMapper.selectPhoneNodeContent(patientTaskExecuteRecordId);
} }
/** /**
@ -174,8 +178,20 @@ public class HomePageServiceImpl implements HomePageService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult updatePatientTaskExecuteRecord(PatientQuestionSubmitResultDTO dto) { public AjaxResult updatePatientTaskExecuteRecord(PatientQuestionSubmitResultDTO dto) {
LocalDateTime time = LocalDateTime.now(); LocalDateTime time = LocalDateTime.now();
//新增患者管理任务执行记录表
PatientTaskExecuteRecord patientTaskExecuteRecord = homePageMapper.selectPatientManageRouteByManageRouteNodeId(dto.getManageRouteNodeId());
patientTaskExecuteRecord.setExecuteTime(time);
patientTaskExecuteRecord.setCreateTime(time);
patientTaskExecuteRecordMapper.insertPatientTaskExecuteRecord(patientTaskExecuteRecord);
//患者问卷提交结果信息表
PatientQuestionSubmitResult patientQuestionSubmitResult = new PatientQuestionSubmitResult(); PatientQuestionSubmitResult patientQuestionSubmitResult = new PatientQuestionSubmitResult();
BeanUtils.copyBeanProp(patientQuestionSubmitResult, dto); BeanUtils.copyBeanProp(patientQuestionSubmitResult, dto);
patientQuestionSubmitResult.setTaskExecuteRecordId(patientTaskExecuteRecord.getId());
patientQuestionSubmitResult.setQuestionInfoId(dto.getQuestionInfoId());
patientQuestionSubmitResult.setPatientId(patientTaskExecuteRecord.getPatientId());
patientQuestionSubmitResult.setPatientName(patientTaskExecuteRecord.getPatientName());
patientQuestionSubmitResult.setManageRouteId(patientTaskExecuteRecord.getManageRouteId());
patientQuestionSubmitResult.setManageRouteName(patientTaskExecuteRecord.getManageRouteName());
patientQuestionSubmitResult.setCreateTime(time); patientQuestionSubmitResult.setCreateTime(time);
// 新增患者问卷提交结果 // 新增患者问卷提交结果
if (patientQuestionSubmitResultMapper.insertPatientQuestionSubmitResult(patientQuestionSubmitResult) <= 0) { if (patientQuestionSubmitResultMapper.insertPatientQuestionSubmitResult(patientQuestionSubmitResult) <= 0) {
@ -253,20 +269,6 @@ public class HomePageServiceImpl implements HomePageService {
return pageServiceUtil.getDataTable(satisfactionQuestionnaires); return pageServiceUtil.getDataTable(satisfactionQuestionnaires);
} }
/**
* 微信小程序消息通知跳转页面
*
* @param id 节点
* @return AjaxResult
*/
@Override
public AjaxResult subscriptionMessage(Long id) {
if (Objects.isNull(id)) {
return AjaxResult.error("该节点以清空!");
}
return AjaxResult.success(signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id));
}
/** /**
* 消息通知列表 * 消息通知列表
* *
@ -275,11 +277,11 @@ public class HomePageServiceImpl implements HomePageService {
*/ */
@Override @Override
public AjaxResult selectSignPatientManageRouteNode(Long residentId) { public AjaxResult selectSignPatientManageRouteNode(Long residentId) {
List<SignPatientManageRouteNode> signPatientManageRouteNodes = signPatientManageRouteNodeMapper.selectManageRouteByResidentId(residentId, NodeExecuteStatusEnum.EXECUTED.getInfo()); List<MessageTabulationVO> signPatientManageRouteNodes = homePageMapper.selectManageRouteByResidentId(residentId, NodeExecuteStatusEnum.EXECUTED.getInfo());
if (CollectionUtils.isEmpty(signPatientManageRouteNodes)) { if (CollectionUtils.isEmpty(signPatientManageRouteNodes)) {
return AjaxResult.success(new ArrayList<>()); return AjaxResult.success(new ArrayList<>());
} }
for (SignPatientManageRouteNode manageRouteNode : signPatientManageRouteNodes) { for (MessageTabulationVO manageRouteNode : signPatientManageRouteNodes) {
if (Objects.isNull(manageRouteNode) || TaskContentEnum.PHONE_OUTBOUND.getInfo().equals(manageRouteNode.getTaskType())) { if (Objects.isNull(manageRouteNode) || TaskContentEnum.PHONE_OUTBOUND.getInfo().equals(manageRouteNode.getTaskType())) {
signPatientManageRouteNodes.remove(manageRouteNode); signPatientManageRouteNodes.remove(manageRouteNode);
} }
@ -333,13 +335,18 @@ public class HomePageServiceImpl implements HomePageService {
if (TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(signPatientManageRouteNode.getTaskType())) { if (TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(signPatientManageRouteNode.getTaskType())) {
//查询宣教信息 //查询宣教信息
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(signPatientManageRouteNode.getPropagandaInfoId()); PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(signPatientManageRouteNode.getPropagandaInfoId());
messageContentVO.setTaskType(messageContentVO.getTaskType()); messageContentVO.setTaskType(TaskContentEnum.PROPAGANDA_ARTICLE.getInfo());
messageContentVO.setPropagandaContent(JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo))); messageContentVO.setPropagandaContent(JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)));
} }
//副文本塞值 //副文本塞值
if (!TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(signPatientManageRouteNode.getTaskType()) && !TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo().equals(signPatientManageRouteNode.getTaskType()) && !TaskContentEnum.ARTIFICIAL_FOLLOW_UP.getInfo().equals(signPatientManageRouteNode.getTaskType())) { if (!TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(signPatientManageRouteNode.getTaskType()) && !TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo().equals(signPatientManageRouteNode.getTaskType()) && !TaskContentEnum.ARTIFICIAL_FOLLOW_UP.getInfo().equals(signPatientManageRouteNode.getTaskType())) {
messageContentVO.setTaskType(TaskContentEnum.TEXT_REMIND.getInfo()); messageContentVO.setTaskType(TaskContentEnum.TEXT_REMIND.getInfo());
messageContentVO.setNodeContent(signPatientManageRouteNode.getNodeContent()); if (StringUtils.isNotBlank(signPatientManageRouteNode.getNodeContent())) {
messageContentVO.setNodeContent(signPatientManageRouteNode.getNodeContent());
}
if (StringUtils.isNotBlank(signPatientManageRouteNode.getTextRemindContent())) {
messageContentVO.setNodeContent(signPatientManageRouteNode.getTextRemindContent());
}
} }
return AjaxResult.success(messageContentVO); return AjaxResult.success(messageContentVO);
} }

View File

@ -10,6 +10,16 @@ import lombok.Data;
@Data @Data
public class MessageContentVO { public class MessageContentVO {
/**
* 签约患者管理任务路径节点表
*/
private Long manageRouteNodeId;
/**
* 患者id
*/
private Long patientId;
/** /**
* 任务类型 * 任务类型
*/ */

View File

@ -0,0 +1,50 @@
package com.xinelu.mobile.vo.homepage;
import lombok.Data;
/**
* 消息列表返回VO
*/
@Data
public class MessageTabulationVO {
/**
* 用户id
*/
private Long residentId;
/**
* 执行记录表id
*/
private Long patientTaskExecuteRecordId;
/**
* 路径名称任务名称
*/
private String manageRouteName;
/**
* 节点id
*/
private Long manageRouteNodeId;
/**
* 管理路径节点名称
*/
private String routeNodeName;
/**
* 管理路径节点时间时间单位为
*/
private Integer routeNodeDay;
/**
* 任务类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP短信提醒SMS_REMIND
*/
private String taskType;
/**
* 是否随访标记 0: 1:
*/
private Integer sign;
}

View File

@ -24,6 +24,8 @@ public class MyFollowUpVO {
private String manageRouteNodeName; private String manageRouteNodeName;
private String nodeExecuteStatus;
/** /**
* 用户id * 用户id
*/ */

View File

@ -20,21 +20,23 @@
IF(pter.id is NULL,0,1) sign, IF(pter.id is NULL,0,1) sign,
CASE CASE
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_id WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_id
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.question_info_id
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id
END AS templateId END AS templateId
FROM patient_info pi FROM sign_patient_manage_route_node spmrn
LEFT JOIN sign_patient_manage_route spmr ON spmr.patient_id = pi.id LEFT JOIN sign_patient_manage_route spmr ON spmrn.manage_route_id = spmr.id
LEFT JOIN sign_patient_manage_route_node spmrn ON spmrn.manage_route_id = spmr.id LEFT JOIN patient_info pi ON spmr.id = pi.id
LEFT JOIN patient_task_execute_record pter ON pter.manage_route_node_id = spmrn.id LEFT JOIN patient_task_execute_record pter ON pter.manage_route_node_id = spmrn.id
<where> <where>
spmrn.task_type in('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE','ARTIFICIAL_FOLLOW_UP') spmrn.task_type in('PHONE_OUTBOUND','ARTIFICIAL_FOLLOW_UP')
<if test="residentId != null "> <if test="residentId != null ">
and pi.resident_id = #{residentId} and pi.resident_id = #{residentId}
</if> </if>
<if test="routeNodeName != null and routeNodeName != ''"> <if test="routeNodeName != null and routeNodeName != ''">
and spmrn.route_node_name = #{routeNodeName} and spmrn.route_node_name = #{routeNodeName}
</if> </if>
<if test="nodeExecuteStatus != null and nodeExecuteStatus != ''">
and spmrn.node_execute_status = #{nodeExecuteStatus}
</if>
</where> </where>
</select> </select>
@ -67,13 +69,13 @@
<select id="satisfactionQuestionnaireByResidentId" <select id="satisfactionQuestionnaireByResidentId"
resultType="com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire"> resultType="com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire">
SELECT spmrn.question_info_id templateId, SELECT spmrn.question_info_id templateId,
spmrn.questionnaire_name, spmrn.questionnaire_name,
spmrn.execute_time, spmrn.execute_time,
(SELECT id (SELECT id
FROM patient_question_submit_result FROM patient_question_submit_result
WHERE resident_id = #{residentId} WHERE resident_id = #{residentId}
AND question_info_id = spmrn.question_info_id) patientQuestionSubmitResultId AND question_info_id = spmrn.question_info_id) patientQuestionSubmitResultId
from sign_patient_manage_route_node spmrn from sign_patient_manage_route_node spmrn
LEFT JOIN sign_patient_manage_route spmr on spmr.id = spmrn.manage_route_id 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 LEFT JOIN patient_info pi ON pi.id = spmr.patient_id
@ -148,4 +150,63 @@
#{signPatientManageRouteNodeIds} #{signPatientManageRouteNodeIds}
</foreach> </foreach>
</update> </update>
<select id="selectManageRouteByResidentId"
resultType="com.xinelu.mobile.vo.homepage.MessageTabulationVO">
select spmrn.id manageRouteNodeId,
spmrn.manage_route_name,
spmrn.route_node_name,
spmrn.route_node_day,
spmrn.update_time,
spmrn.message_status,
IF(pter.id is NULL, 0, 1) sign,
pter.id patientTaskExecuteRecordId,
spmrn.task_type
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
LEFT JOIN patient_task_execute_record pter ON pter.manage_route_node_id = spmrn.id
where pi.resident_id = #{residentId}
and spmrn.node_execute_status = #{nodeExecuteStatus}
and (spmrn.applet_push_sign = 1 or spmrn.official_push_sign = 1)
and spmrn.del_flag = 0
and pi.del_flag = 0
Order BY spmrn.update_time DESC
</select>
<select id="selectPatientManageRouteByManageRouteNodeId"
resultType="com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord">
select spmr.patient_id,
spmr.patient_name,
spmr.id manageRouteId,
spmrn.id manageRouteNodeId,
spmrn.manage_route_name manageRouteName,
spmrn.route_node_name manageRouteNodeName,
spmrn.task_type taskContent
from sign_patient_manage_route_node spmrn
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
where spmrn.id = #{manageRouteNodeId}
</select>
<select id="selectPhoneNodeContent"
resultType="com.xinelu.manage.vo.signpatientmanageroute.PhonePush">
select spmrn.route_node_name,
spmrn.phone_push_sign,
spmrn.route_node_day,
spmrn.phone_id,
spmrn.phone_template_id,
spmrn.phone_template_name,
spmrn.phone_redial_times,
spmrn.phone_time_interval,
spmrn.phone_message_remind,
spmrn.phone_connect_status,
spmrn.route_handle_remark,
spmrn.phone_message_template_id,
spmrn.phone_message_template_name,
spmrn.phone_node_content
from patient_task_execute_record pter
LEFT JOIN sign_patient_manage_route_node spmrn ON pter.manage_route_node_id = spmrn.id
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = pter.manage_route_id
where pter.id = #{patientTaskExecuteRecordId}
</select>
</mapper> </mapper>