Merge branch '0418_小程序开发' of http://182.92.166.109:3000/zhuangyuanke/PostDischargePatientManage into 0418_小程序开发
This commit is contained in:
commit
767b2004af
@ -7,9 +7,10 @@ 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.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 签约患者管理任务路径节点Mapper接口
|
||||
*
|
||||
@ -102,8 +103,12 @@ public interface SignPatientManageRouteNodeMapper {
|
||||
*/
|
||||
List<SignPatientManageRouteNode> selectManageRouteByResidentId(@Param("residentId") Long residentId, @Param("nodeExecuteStatus") String nodeExecuteStatus);
|
||||
|
||||
String selectNodeContent(Long manageRouteNodeId);
|
||||
|
||||
/**
|
||||
* 修改消息状态
|
||||
*
|
||||
* @param signPatientManageRouteNode 节点信息
|
||||
* @return int
|
||||
*/
|
||||
int updateMessageStatus(SignPatientManageRouteNode signPatientManageRouteNode);
|
||||
|
||||
List<SpecialDiseaseNodeAuditVo> selectByRouteId(Long manageRouteId);
|
||||
|
||||
@ -777,17 +777,12 @@
|
||||
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>
|
||||
|
||||
<select id="selectNodeContent" resultType="java.lang.String">
|
||||
select node_content
|
||||
from sign_patient_manage_route_node
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<update id="updateMessageStatus">
|
||||
update sign_patient_manage_route_node
|
||||
set message_status = #{messageStatus}
|
||||
|
||||
@ -100,11 +100,17 @@ public class HomePageController extends BaseController {
|
||||
return homePageService.selectSignPatientManageRouteNode(residentId);
|
||||
}
|
||||
|
||||
@GetMapping("/selectNodeContent")
|
||||
public AjaxResult selectNodeContent(Long manageRouteNodeId) {
|
||||
return homePageService.selectNodeContent(manageRouteNodeId);
|
||||
/**
|
||||
* 消息推送内容
|
||||
*/
|
||||
@GetMapping("/selectMessageContent")
|
||||
public AjaxResult selectMessageContent(Long manageRouteNodeId) {
|
||||
return homePageService.selectMessageContent(manageRouteNodeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息状态
|
||||
*/
|
||||
@PostMapping("/updateMessageStatus")
|
||||
public AjaxResult updateMessageStatus(@RequestBody SignPatientManageRouteNode signPatientManageRouteNode) {
|
||||
return homePageService.updateMessageStatus(signPatientManageRouteNode);
|
||||
|
||||
@ -84,7 +84,19 @@ public interface HomePageService {
|
||||
*/
|
||||
AjaxResult selectSignPatientManageRouteNode(Long residentId);
|
||||
|
||||
AjaxResult selectNodeContent(Long manageRouteNodeId);
|
||||
/**
|
||||
* 消息推送内容
|
||||
*
|
||||
* @param manageRouteNodeId 节点id
|
||||
* @return AjaxResult
|
||||
*/
|
||||
AjaxResult selectMessageContent(Long manageRouteNodeId);
|
||||
|
||||
/**
|
||||
* 修改消息状态
|
||||
*
|
||||
* @param signPatientManageRouteNode 节点信息
|
||||
* @return int
|
||||
*/
|
||||
AjaxResult updateMessageStatus(SignPatientManageRouteNode signPatientManageRouteNode);
|
||||
}
|
||||
@ -1,11 +1,9 @@
|
||||
package com.xinelu.mobile.service.homepage.Impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.NodeExecuteStatusEnum;
|
||||
import com.xinelu.common.enums.QuestionTypeEnum;
|
||||
import com.xinelu.common.enums.QuestionnaireStatusEnum;
|
||||
import com.xinelu.common.enums.RouteNodeNameEnum;
|
||||
import com.xinelu.common.enums.*;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.PageServiceUtil;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
@ -28,11 +26,14 @@ import com.xinelu.manage.mapper.questionsubject.QuestionSubjectMapper;
|
||||
import com.xinelu.manage.mapper.questionsubjectoption.QuestionSubjectOptionMapper;
|
||||
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
|
||||
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
|
||||
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.mobile.mapper.homepage.HomePageMapper;
|
||||
import com.xinelu.mobile.service.homepage.HomePageService;
|
||||
import com.xinelu.mobile.vo.homepage.MessageContentVO;
|
||||
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
||||
import com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -75,6 +76,8 @@ public class HomePageServiceImpl implements HomePageService {
|
||||
private PatientQuestionOptionResultMapper patientQuestionOptionResultMapper;
|
||||
@Resource
|
||||
private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper;
|
||||
@Resource
|
||||
private IPropagandaInfoService propagandaInfoService;
|
||||
|
||||
/**
|
||||
* 我的随访列表
|
||||
@ -277,18 +280,74 @@ public class HomePageServiceImpl implements HomePageService {
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
for (SignPatientManageRouteNode manageRouteNode : signPatientManageRouteNodes) {
|
||||
if (Objects.isNull(manageRouteNode) || TaskContentEnum.PHONE_OUTBOUND.getInfo().equals(manageRouteNode.getTaskType())) {
|
||||
signPatientManageRouteNodes.remove(manageRouteNode);
|
||||
}
|
||||
if (Objects.nonNull(manageRouteNode) && StringUtils.isNotBlank(manageRouteNode.getManageRouteName()) && StringUtils.isNotBlank(manageRouteNode.getRouteNodeName()) && Objects.nonNull(manageRouteNode.getRouteNodeDay())) {
|
||||
manageRouteNode.setRouteNodeName(manageRouteNode.getManageRouteName() + manageRouteNode.getRouteNodeName() + manageRouteNode.getRouteNodeDay() + "天");
|
||||
if (StringUtils.isNotBlank(manageRouteNode.getRouteNodeName())) {
|
||||
manageRouteNode.setRouteNodeName(RouteNodeNameEnum.getNameByInfo(manageRouteNode.getRouteNodeName()).getName());
|
||||
}
|
||||
manageRouteNode.setRouteNodeName(manageRouteNode.getManageRouteName() + manageRouteNode.getRouteNodeName() + "第" + manageRouteNode.getRouteNodeDay() + "天");
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(signPatientManageRouteNodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息推送内容
|
||||
*
|
||||
* @param manageRouteNodeId 节点id
|
||||
* @return AjaxResult
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectNodeContent(Long manageRouteNodeId) {
|
||||
return AjaxResult.success(signPatientManageRouteNodeMapper.selectNodeContent(manageRouteNodeId));
|
||||
public AjaxResult selectMessageContent(Long manageRouteNodeId) {
|
||||
SignPatientManageRouteNode signPatientManageRouteNode = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(manageRouteNodeId);
|
||||
if (Objects.isNull(signPatientManageRouteNode)) {
|
||||
return AjaxResult.error("该节点已删除!");
|
||||
}
|
||||
MessageContentVO messageContentVO = new MessageContentVO();
|
||||
//问卷或人工随访塞值
|
||||
if (TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo().equals(signPatientManageRouteNode.getTaskType()) || TaskContentEnum.ARTIFICIAL_FOLLOW_UP.getInfo().equals(signPatientManageRouteNode.getTaskType())) {
|
||||
messageContentVO.setTaskType(signPatientManageRouteNode.getTaskType());
|
||||
//查询问卷
|
||||
QuestionInfo questionInfo = questionInfoMapper.selectQuestionInfoById(signPatientManageRouteNode.getQuestionInfoId());
|
||||
// 查询题目表
|
||||
if (Objects.nonNull(questionInfo)) {
|
||||
BeanUtils.copyBeanProp(messageContentVO.getQuestion(), questionInfo);
|
||||
List<QuestionSubjectVO> questionSubjects = questionSubjectMapper.selectQuestionSubjectBy(signPatientManageRouteNode.getQuestionInfoId());
|
||||
if (CollectionUtils.isNotEmpty(questionSubjects)) {
|
||||
List<Long> questionSubjectIds = questionSubjects.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getId())).map(QuestionSubject::getId).collect(Collectors.toList());
|
||||
// 选项表
|
||||
List<QuestionSubjectOptionVO> questionSubjectOptions = questionSubjectOptionMapper.selectQuestionSubjectOptions(questionSubjectIds);
|
||||
for (QuestionSubjectVO questionSubject : questionSubjects) {
|
||||
List<QuestionSubjectOptionVO> collect = questionSubjectOptions.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getQuestionnaireSubjectId()) && questionSubject.getId().equals(item.getQuestionnaireSubjectId())).collect(Collectors.toList());
|
||||
questionSubject.setQuestionSubjectOptionList(collect);
|
||||
}
|
||||
messageContentVO.getQuestion().setQuestionSubjectList(questionSubjects);
|
||||
}
|
||||
}
|
||||
}
|
||||
//宣教塞值
|
||||
if (TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(signPatientManageRouteNode.getTaskType())) {
|
||||
//查询宣教信息
|
||||
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(signPatientManageRouteNode.getPropagandaInfoId());
|
||||
messageContentVO.setTaskType(messageContentVO.getTaskType());
|
||||
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());
|
||||
}
|
||||
return AjaxResult.success(messageContentVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息状态
|
||||
*
|
||||
* @param signPatientManageRouteNode 节点信息
|
||||
* @return int
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateMessageStatus(SignPatientManageRouteNode signPatientManageRouteNode) {
|
||||
return AjaxResult.success(signPatientManageRouteNodeMapper.updateMessageStatus(signPatientManageRouteNode));
|
||||
|
||||
@ -209,7 +209,7 @@ public class WeChatOfficialAccountUtils {
|
||||
paramsMap.put("touser", patientVO.getOpenId());
|
||||
paramsMap.put("template_id", weChatAppletChatConfig.getHealthyPropagandaId());
|
||||
paramsMap.put("miniprogram_state", "developer");//todo
|
||||
paramsMap.put("page", "pages/homepage/homepage");
|
||||
paramsMap.put("page", "/postDischarge/homePage/selectMessageContent?"+patientVO.getSignPatientManageRouteNodeId());
|
||||
Map<String, Object> dataMap = new LinkedHashMap<>();
|
||||
dataMap.put("thing5", new MessageValueEntity(thing5));
|
||||
dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalAgencyName()));
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package com.xinelu.mobile.vo.homepage;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 消息内容返回实体类
|
||||
*/
|
||||
@Data
|
||||
public class MessageContentVO {
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private String taskType;
|
||||
|
||||
/**
|
||||
* 宣教信息
|
||||
*/
|
||||
private JSONObject propagandaContent;
|
||||
|
||||
/**
|
||||
* 富文本
|
||||
*/
|
||||
private String nodeContent;
|
||||
|
||||
/**
|
||||
* 问卷信息
|
||||
*/
|
||||
private QuestionVO question;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user