diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientquestionsubjectresult/PatientQuestionSubjectResult.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientquestionsubjectresult/PatientQuestionSubjectResult.java index 4f498b01..46f7429a 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientquestionsubjectresult/PatientQuestionSubjectResult.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientquestionsubjectresult/PatientQuestionSubjectResult.java @@ -87,14 +87,14 @@ public class PatientQuestionSubjectResult extends BaseEntity { * 回答(填空题) */ @ApiModelProperty(value = "回答") - @Excel(name = "回答", readConverterExp = "填=空题") + @Excel(name = "回答", readConverterExp = "填空题") private String fillBlanksAnswer; /** * 选项个数(打分题) */ @ApiModelProperty(value = "选项个数") - @Excel(name = "选项个数", readConverterExp = "打=分题") + @Excel(name = "选项个数", readConverterExp = "打分题") private Integer optionCount; /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java index fa2b0598..70ed372c 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java @@ -78,4 +78,11 @@ public interface ResidentInfoMapper { * @return 居民基本信息 */ List getResidentInfoByPhoneAndName(@Param("phone") String phone, @Param("patientName") String patientName); + + /** + * 更新用户openid + * @param residentInfo 用户信息 + * @return 结果 + */ + int updateResidentInfoOpenid(ResidentInfo residentInfo); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java index f69764aa..7cd40a42 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java @@ -94,15 +94,6 @@ public interface SignPatientManageRouteNodeMapper { */ List selectPatientTaskList(PatientTaskDto patientTaskDto); - /** - * 查询个人任务消息 - * - * @param residentId 用户id - * @param nodeExecuteStatus 状态 - * @return SignPatientManageRouteNode - */ - List selectManageRouteByResidentId(@Param("residentId") Long residentId, @Param("nodeExecuteStatus") String nodeExecuteStatus); - /** * 修改消息状态 * diff --git a/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml index e3d682b6..762c29e6 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml @@ -173,7 +173,11 @@ where id = #{id} - + + UPDATE resident_info SET open_id = #{openId} WHERE id = #{id} + + + delete from resident_info where id = #{id} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml index 06f81705..a798333c 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml @@ -345,7 +345,7 @@ 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 - pi.del_flag = '0' AND spmr.task_create_type = 'MANUAL_CREATE' + pi.del_flag = '0' AND spmrn.route_check_status = 'AGREE' AND spmrn.task_type in ('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE','ARTIFICIAL_FOLLOW_UP') diff --git a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml index 52618356..0a699656 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml @@ -764,25 +764,6 @@ group by patient.hospital_agency_id, patient.id - - update sign_patient_manage_route_node set message_status = #{messageStatus} diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/homepage/HomePageController.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/homepage/HomePageController.java index 974c2dbe..e4abca75 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/homepage/HomePageController.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/homepage/HomePageController.java @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; +import java.util.Objects; /** * 小程序首页Controller @@ -35,11 +36,11 @@ public class HomePageController extends BaseController { } /** - * 获取话术信息详细信息 + * 获取话术信息详细信息(随访) */ @GetMapping("/selectScriptInfo") - public AjaxResult selectScriptInfo(Long templateId) { - return AjaxResult.success(homePageService.selectScriptInfo(templateId)); + public AjaxResult selectScriptInfo(Long patientTaskExecuteRecordId) { + return AjaxResult.success(homePageService.selectScriptInfo(patientTaskExecuteRecordId)); } /** @@ -51,15 +52,18 @@ public class HomePageController extends BaseController { } /** - * 问卷记录信息 + * 问卷记录信息(消息记录) */ @GetMapping("/selectQuestionSubmit") public AjaxResult selectQuestionSubmit(Long patientQuestionSubmitResultId, Long patientTaskExecuteRecordId) { + if (Objects.isNull(patientQuestionSubmitResultId) && Objects.isNull(patientTaskExecuteRecordId)) { + return AjaxResult.error("请选择记录信息!"); + } return homePageService.selectQuestionSubmit(patientQuestionSubmitResultId, patientTaskExecuteRecordId); } /** - * 问卷提交 + * 问卷提交(消息记录) */ @PostMapping("/updateTaskExecuteRecord") 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") public AjaxResult selectSignPatientManageRouteNode(Long residentId) { @@ -101,7 +97,7 @@ public class HomePageController extends BaseController { } /** - * 消息推送内容 + * 消息推送内容(消息记录) */ @GetMapping("/selectMessageContent") public AjaxResult selectMessageContent(Long manageRouteNodeId) { @@ -109,7 +105,7 @@ public class HomePageController extends BaseController { } /** - * 修改消息状态 + * 修改消息状态(消息记录) */ @PostMapping("/updateMessageStatus") public AjaxResult updateMessageStatus(@RequestBody SignPatientManageRouteNode signPatientManageRouteNode) { diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/mapper/homepage/HomePageMapper.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/mapper/homepage/HomePageMapper.java index cc22e2d7..28063a5a 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/mapper/homepage/HomePageMapper.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/mapper/homepage/HomePageMapper.java @@ -1,6 +1,8 @@ package com.xinelu.mobile.mapper.homepage; 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.satisfactionquestionnaire.SatisfactionQuestionnaire; import com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO; @@ -61,8 +63,30 @@ public interface HomePageMapper { /** * 修改执行状态 * - * @param signPatientManageRouteNodeIds + * @param signPatientManageRouteNodeIds 节点id * @return int */ int updateNodeExecuteStatusByIds(@Param("signPatientManageRouteNodeIds") List signPatientManageRouteNodeIds); + + /** + * 查询个人任务消息 + * + * @param residentId 用户id + * @param nodeExecuteStatus 状态 + * @return SignPatientManageRouteNode + */ + List selectManageRouteByResidentId(@Param("residentId") Long residentId, @Param("nodeExecuteStatus") String nodeExecuteStatus); + + /** + * 查询患者管理任务执行记录表 + * + * @param manageRouteNodeId id + * @return PatientTaskExecuteRecord + */ + PatientTaskExecuteRecord selectPatientManageRouteByManageRouteNodeId(Long manageRouteNodeId); + + /** + * 话术类型代办处理详情 + */ + PhonePush selectPhoneNodeContent(Long patientTaskExecuteRecordId); } \ No newline at end of file diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/Impl/AppletPersonCenterServiceImpl.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/Impl/AppletPersonCenterServiceImpl.java index 0d220c7d..16d1156f 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/Impl/AppletPersonCenterServiceImpl.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/Impl/AppletPersonCenterServiceImpl.java @@ -279,6 +279,8 @@ public class AppletPersonCenterServiceImpl implements AppletPersonCenterService // 更新用户的openid ResidentInfo residentInfo = residentInfos.get(0); residentInfo.setOpenId(openId); + residentInfo.setUpdateBy(residentInfo.getPatientName()); + residentInfo.setUpdateTime(LocalDateTime.now()); residentInfoMapper.updateResidentInfo(residentInfo); log.info("用户注册成功,姓名:{},手机号:{},openid:{}", verifySmsCodeDTO.getPatientName(), verifySmsCodeDTO.getPhoneNum(), openId); return AjaxResult.success("注册成功!", residentInfo); @@ -310,7 +312,9 @@ public class AppletPersonCenterServiceImpl implements AppletPersonCenterService // 清空openid字段,更新用户信息 residentInfo.setOpenId(null); - residentInfoMapper.updateResidentInfo(residentInfo); + residentInfo.setUpdateBy(residentInfo.getPatientName()); + residentInfo.setUpdateTime(LocalDateTime.now()); + residentInfoMapper.updateResidentInfoOpenid(residentInfo); log.info("解绑成功,手机号:{},openId:{}", phoneNum, openId); return AjaxResult.success("解绑成功!"); } catch (Exception e) { diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/HomePageService.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/HomePageService.java index c464d150..838c5772 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/HomePageService.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/HomePageService.java @@ -3,9 +3,9 @@ package com.xinelu.mobile.service.homepage; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.page.TableDataInfo; 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.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO; +import com.xinelu.manage.vo.signpatientmanageroute.PhonePush; import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO; import java.util.List; @@ -23,10 +23,10 @@ public interface HomePageService { /** * 查询话术信息 * - * @param templateId 话术信息主键 + * @param patientTaskExecuteRecordId 话术信息主键 * @return 话术信息 */ - ScriptInfo selectScriptInfo(Long templateId); + PhonePush selectScriptInfo(Long patientTaskExecuteRecordId); /** * 问卷信息 @@ -68,14 +68,6 @@ public interface HomePageService { */ TableDataInfo satisfactionQuestionnaire(Long residentId); - /** - * 微信小程序消息通知跳转页面 - * - * @param id 节点 - * @return AjaxResult - */ - AjaxResult subscriptionMessage(Long id); - /** * 消息通知列表 * diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/Impl/HomePageServiceImpl.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/Impl/HomePageServiceImpl.java index c7019ea4..16541e50 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/Impl/HomePageServiceImpl.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/homepage/Impl/HomePageServiceImpl.java @@ -13,7 +13,6 @@ import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmi import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord; import com.xinelu.manage.domain.questioninfo.QuestionInfo; 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.dto.patientquestionoptionresult.PatientQuestionOptionResultDTO; 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.patientquestionsubjectresult.PatientQuestionSubjectResultMapper; 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.questionsubject.QuestionSubjectMapper; 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.questionsubject.QuestionSubjectVO; 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.service.homepage.HomePageService; 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.satisfactionquestionnaire.SatisfactionQuestionnaire; import lombok.extern.slf4j.Slf4j; @@ -78,6 +80,8 @@ public class HomePageServiceImpl implements HomePageService { private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper; @Resource private IPropagandaInfoService propagandaInfoService; + @Resource + private PatientTaskExecuteRecordMapper patientTaskExecuteRecordMapper; /** * 我的随访列表 @@ -87,7 +91,7 @@ public class HomePageServiceImpl implements HomePageService { */ @Override public TableDataInfo myFollowUp(MyFollowUpVO myFollowUp) { - myFollowUp.setRouteNodeName(RouteNodeNameEnum.AFTER_DISCHARGE.getInfo()); + myFollowUp.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTED.getInfo()); List myFollowUpList = homePageMapper.selectManageRouteNode(myFollowUp); int total = myFollowUpList.size(); if (CollectionUtils.isEmpty(myFollowUpList)) { @@ -97,7 +101,7 @@ public class HomePageServiceImpl implements HomePageService { if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) { myFollowUpVO.setFollowDate(myFollowUpVO.getDischargeTime().plusDays(myFollowUpVO.getRouteNodeDay())); } - myFollowUpVO.setFollowName("出院后第" + myFollowUpVO.getRouteNodeDay() + "天"); + myFollowUpVO.setFollowName(myFollowUpVO.getManageRouteNodeName() + myFollowUpVO.getRouteNodeDay() + "天"); } myFollowUpList.sort(Comparator.comparing(MyFollowUpVO::getFollowDate).reversed()); //处理上面查询的list集合 @@ -114,12 +118,12 @@ public class HomePageServiceImpl implements HomePageService { /** * 查询话术信息 * - * @param templateId 话术信息主键 + * @param patientTaskExecuteRecordId 话术信息主键 * @return 话术信息 */ @Override - public ScriptInfo selectScriptInfo(Long templateId) { - return scriptInfoMapper.selectScriptInfoById(templateId); + public PhonePush selectScriptInfo(Long patientTaskExecuteRecordId) { + return homePageMapper.selectPhoneNodeContent(patientTaskExecuteRecordId); } /** @@ -174,8 +178,20 @@ public class HomePageServiceImpl implements HomePageService { @Transactional(rollbackFor = Exception.class) public AjaxResult updatePatientTaskExecuteRecord(PatientQuestionSubmitResultDTO dto) { LocalDateTime time = LocalDateTime.now(); + //新增患者管理任务执行记录表 + PatientTaskExecuteRecord patientTaskExecuteRecord = homePageMapper.selectPatientManageRouteByManageRouteNodeId(dto.getManageRouteNodeId()); + patientTaskExecuteRecord.setExecuteTime(time); + patientTaskExecuteRecord.setCreateTime(time); + patientTaskExecuteRecordMapper.insertPatientTaskExecuteRecord(patientTaskExecuteRecord); + //患者问卷提交结果信息表 PatientQuestionSubmitResult patientQuestionSubmitResult = new PatientQuestionSubmitResult(); 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); // 新增患者问卷提交结果 if (patientQuestionSubmitResultMapper.insertPatientQuestionSubmitResult(patientQuestionSubmitResult) <= 0) { @@ -253,20 +269,6 @@ public class HomePageServiceImpl implements HomePageService { 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 public AjaxResult selectSignPatientManageRouteNode(Long residentId) { - List signPatientManageRouteNodes = signPatientManageRouteNodeMapper.selectManageRouteByResidentId(residentId, NodeExecuteStatusEnum.EXECUTED.getInfo()); + List signPatientManageRouteNodes = homePageMapper.selectManageRouteByResidentId(residentId, NodeExecuteStatusEnum.EXECUTED.getInfo()); if (CollectionUtils.isEmpty(signPatientManageRouteNodes)) { return AjaxResult.success(new ArrayList<>()); } - for (SignPatientManageRouteNode manageRouteNode : signPatientManageRouteNodes) { + for (MessageTabulationVO manageRouteNode : signPatientManageRouteNodes) { if (Objects.isNull(manageRouteNode) || TaskContentEnum.PHONE_OUTBOUND.getInfo().equals(manageRouteNode.getTaskType())) { signPatientManageRouteNodes.remove(manageRouteNode); } @@ -333,13 +335,18 @@ public class HomePageServiceImpl implements HomePageService { if (TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(signPatientManageRouteNode.getTaskType())) { //查询宣教信息 PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(signPatientManageRouteNode.getPropagandaInfoId()); - messageContentVO.setTaskType(messageContentVO.getTaskType()); + messageContentVO.setTaskType(TaskContentEnum.PROPAGANDA_ARTICLE.getInfo()); 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())) { 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); } diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/homepage/MessageContentVO.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/homepage/MessageContentVO.java index 6a0af36e..19f93260 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/homepage/MessageContentVO.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/homepage/MessageContentVO.java @@ -10,6 +10,16 @@ import lombok.Data; @Data public class MessageContentVO { + /** + * 签约患者管理任务路径节点表 + */ + private Long manageRouteNodeId; + + /** + * 患者id + */ + private Long patientId; + /** * 任务类型 */ diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/homepage/MessageTabulationVO.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/homepage/MessageTabulationVO.java new file mode 100644 index 00000000..85fbe55b --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/homepage/MessageTabulationVO.java @@ -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; +} diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/myfollowup/MyFollowUpVO.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/myfollowup/MyFollowUpVO.java index f77f780b..b7671386 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/myfollowup/MyFollowUpVO.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/myfollowup/MyFollowUpVO.java @@ -24,6 +24,8 @@ public class MyFollowUpVO { private String manageRouteNodeName; + private String nodeExecuteStatus; + /** * 用户id */ diff --git a/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml b/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml index 61ad6e1a..f699daee 100644 --- a/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml +++ b/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml @@ -20,21 +20,23 @@ IF(pter.id is NULL,0,1) sign, CASE 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 END AS templateId - FROM patient_info pi - LEFT JOIN sign_patient_manage_route spmr ON spmr.patient_id = pi.id - LEFT JOIN sign_patient_manage_route_node spmrn ON spmrn.manage_route_id = spmr.id + FROM sign_patient_manage_route_node spmrn + LEFT JOIN sign_patient_manage_route spmr 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 - spmrn.task_type in('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE','ARTIFICIAL_FOLLOW_UP') + spmrn.task_type in('PHONE_OUTBOUND','ARTIFICIAL_FOLLOW_UP') and pi.resident_id = #{residentId} and spmrn.route_node_name = #{routeNodeName} + + and spmrn.node_execute_status = #{nodeExecuteStatus} + @@ -67,13 +69,13 @@ + 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 + + + + + \ No newline at end of file