小程序我的随访,健康日志,

This commit is contained in:
zhangheng 2024-07-17 16:40:06 +08:00
parent 84d10b3572
commit c6c6db2c86
16 changed files with 200 additions and 36 deletions

View File

@ -242,3 +242,28 @@ aliyun-sms:
# 阿里云登录确认验证模板-模板内容 # 阿里云登录确认验证模板-模板内容
templateContent: 验证码${code},您正在登录,若非本人操作,请勿泄露。 templateContent: 验证码${code},您正在登录,若非本人操作,请勿泄露。
# 阿里云参数配置
aliyun-sms2:
# AccessKey ID
accessKeyId: LTAIo6vpMk2441nc
# AccessKey Secret
accessKeySecret: JxPKD3Vx404QsZ3SvYSai1wuOlyRtR
# 产品名称:云通信短信API产品,开发者无需替换
product: Dysmsapi
# 产品域名,开发者无需替换
domain: dysmsapi.aliyuncs.com
# 地域ID
regionId: cn-qingdao
# 阿里云登录确认验证模板-短信签名
signName: 新医路
# 阿里云登录确认验证模板-模板CODE
templateCode: SMS_469020649
# 阿里云登录确认验证模板-模板内容
templateContent: 尊敬的用户,馨医健康致电您未成功接通,请放心接听。也可通过馨医健康小程序消息中心查看相关信息;
# 小程序首页路径
applet-page-config:
# 首页跳转路径
page-url: pages/startup/startup
# 个人中心-优惠券页面跳转路径
propaganda-page-url: pages/propaganda/propaganda

View File

@ -0,0 +1,52 @@
package com.xinelu.common.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @program: PostDischargePatientManage
* @description: 阿里云参数配置
* @author: ZH
* @create: 2024-07-17
**/
@Data
@Component
@ConfigurationProperties(prefix = "aliyun-sms2")
public class AliYunSmsTwoConfig {
/**
* AccessKey ID
*/
private String accessKeyId;
/**
* AccessKey Secret
*/
private String accessKeySecret;
/**
* 产品名称:云通信短信API产品,开发者无需替换
*/
private String product;
/**
* 产品域名,开发者无需替换
*/
private String domain;
/**
* 地域ID
*/
private String regionId;
/**
* 阿里云登录确认验证模板-模板签名
*/
private String signName;
/**
* 阿里云登录确认验证模板-模板CODE
*/
private String templateCode;
}

View File

@ -30,6 +30,12 @@
<artifactId>swagger-models</artifactId> <artifactId>swagger-models</artifactId>
<version>1.6.2</version> <version>1.6.2</version>
</dependency> </dependency>
<!--阿里云发送短信-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alicloud-sms</artifactId>
<version>2.2.0.RELEASE</version>
</dependency>
<!-- 系统公共模块 --> <!-- 系统公共模块 -->
<dependency> <dependency>
<groupId>com.xinelu</groupId> <groupId>com.xinelu</groupId>

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.controller.signpatientmanageroute; package com.xinelu.manage.controller.signpatientmanageroute;
import com.aliyuncs.exceptions.ClientException;
import com.xinelu.common.annotation.Log; import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
@ -124,7 +125,7 @@ public class SignPatientManageRouteController extends BaseController {
* 人工随访代办处理 * 人工随访代办处理
*/ */
@PostMapping("/addPatientQuestionResult") @PostMapping("/addPatientQuestionResult")
public AjaxResult addPatientQuestionResult(@RequestBody PatientQuestionSubmitResultDTO dto) { public AjaxResult addPatientQuestionResult(@RequestBody PatientQuestionSubmitResultDTO dto) throws ClientException {
return signPatientManageRouteService.addPatientQuestionResult(dto); return signPatientManageRouteService.addPatientQuestionResult(dto);
} }

View File

@ -1,4 +1,4 @@
package com.xinelu.mobile.dto.smssend; package com.xinelu.manage.dto.smssend;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import lombok.Data; import lombok.Data;

View File

@ -91,4 +91,12 @@ public interface SignPatientManageRouteMapper {
* 话术类型代办处理详情 * 话术类型代办处理详情
*/ */
PhonePush selectSignPatientManageRouteNode(Long manageRouteNodeId); PhonePush selectSignPatientManageRouteNode(Long manageRouteNodeId);
/**
* 查询患者电话
*
* @param patientId
* @return
*/
String selectPatientPhone(Long patientId);
} }

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.signpatientmanageroute; package com.xinelu.manage.service.signpatientmanageroute;
import com.aliyuncs.exceptions.ClientException;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO; import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO;
@ -84,7 +85,7 @@ public interface ISignPatientManageRouteService {
* @param dto 患者问卷提交结果信息表DTO * @param dto 患者问卷提交结果信息表DTO
* @return 结果 * @return 结果
*/ */
AjaxResult addPatientQuestionResult(PatientQuestionSubmitResultDTO dto); AjaxResult addPatientQuestionResult(PatientQuestionSubmitResultDTO dto) throws ClientException;
/** /**
* 话术类型代办处理详情 * 话术类型代办处理详情
@ -104,5 +105,4 @@ public interface ISignPatientManageRouteService {
* @return 节点详细信息列表 * @return 节点详细信息列表
*/ */
List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long signRecordId); List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long signRecordId);
} }

View File

@ -1,19 +1,21 @@
package com.xinelu.manage.service.signpatientmanageroute.impl; package com.xinelu.manage.service.signpatientmanageroute.impl;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import com.xinelu.common.annotation.DataScope; import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.config.AliYunSmsTwoConfig;
import com.xinelu.common.constant.TaskContentConstants; import com.xinelu.common.constant.TaskContentConstants;
import com.xinelu.common.constant.TaskCreateTypeConstant; import com.xinelu.common.constant.TaskCreateTypeConstant;
import com.xinelu.common.constant.TaskNodeTypeConstants; import com.xinelu.common.constant.TaskNodeTypeConstants;
import com.xinelu.common.constant.TemplateTypeConstants; import com.xinelu.common.constant.TemplateTypeConstants;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.NodeExecuteStatusEnum; import com.xinelu.common.enums.*;
import com.xinelu.common.enums.PhoneConnectStatusEnum;
import com.xinelu.common.enums.PhoneMessageRemindEnum;
import com.xinelu.common.enums.RouteNodeNameEnum;
import com.xinelu.common.enums.TaskContentEnum;
import com.xinelu.common.enums.TaskCreateTypeEnum;
import com.xinelu.common.enums.TaskNodeTypeEnum;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.AgeUtil; import com.xinelu.common.utils.AgeUtil;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
@ -32,6 +34,7 @@ import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO;
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;
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO; import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
import com.xinelu.manage.dto.smssend.SmsInfoDTO;
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper; import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
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;
@ -61,20 +64,18 @@ import com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo;
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo; import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo;
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
import java.time.LocalDateTime; import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/** /**
* 签约患者管理任务路径Service业务层处理 * 签约患者管理任务路径Service业务层处理
@ -82,6 +83,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author haown * @author haown
* @date 2024-03-18 * @date 2024-03-18
*/ */
@Slf4j
@Service @Service
public class SignPatientManageRouteServiceImpl implements ISignPatientManageRouteService { public class SignPatientManageRouteServiceImpl implements ISignPatientManageRouteService {
@Resource @Resource
@ -118,6 +120,10 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
private LabelFieldContentMapper labelFieldContentMapper; private LabelFieldContentMapper labelFieldContentMapper;
@Resource @Resource
private ISignPatientManageRouteNodeService signPatientManageRouteNodeService; private ISignPatientManageRouteNodeService signPatientManageRouteNodeService;
@Resource
private AliYunSmsTwoConfig aliYunSmsTwoConfig;
private static final String SUCCESS = "OK";
/** /**
* 查询签约患者管理任务路径 * 查询签约患者管理任务路径
@ -302,7 +308,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult addPatientQuestionResult(PatientQuestionSubmitResultDTO dto) { public AjaxResult addPatientQuestionResult(PatientQuestionSubmitResultDTO dto) throws ClientException {
String routeHandlePerson = dto.getRouteHandlePerson(); String routeHandlePerson = dto.getRouteHandlePerson();
LocalDateTime time = LocalDateTime.now(); LocalDateTime time = LocalDateTime.now();
// 如果任务类型是电话外呼更新节点任务表新增患者管理任务执行记录 // 如果任务类型是电话外呼更新节点任务表新增患者管理任务执行记录
@ -316,7 +322,16 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
insertPatientTaskExecuteRecord(dto, routeHandlePerson, time); insertPatientTaskExecuteRecord(dto, routeHandlePerson, time);
// 发送短信 // 发送短信
if (StringUtils.isNotBlank(dto.getPhoneMessageRemind()) && (PhoneMessageRemindEnum.EVERYONE_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind()) || (PhoneConnectStatusEnum.CONNECTED.getInfo().equals(dto.getPhoneConnectStatus()) && PhoneMessageRemindEnum.CONNECTED_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind())) || (PhoneConnectStatusEnum.NOTCONNECTED.getInfo().equals(dto.getPhoneConnectStatus()) && PhoneMessageRemindEnum.NOT_CONNECTED_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind())))) { if (StringUtils.isNotBlank(dto.getPhoneMessageRemind()) && (PhoneMessageRemindEnum.EVERYONE_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind()) || (PhoneConnectStatusEnum.CONNECTED.getInfo().equals(dto.getPhoneConnectStatus()) && PhoneMessageRemindEnum.CONNECTED_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind())) || (PhoneConnectStatusEnum.NOTCONNECTED.getInfo().equals(dto.getPhoneConnectStatus()) && PhoneMessageRemindEnum.NOT_CONNECTED_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind())))) {
SmsInfoDTO smsInfoDTO = new SmsInfoDTO();
String patientPhone = signPatientManageRouteMapper.selectPatientPhone(dto.getPatientId());
smsInfoDTO.setPhoneNumbers(patientPhone);
smsInfoDTO.setSignName(aliYunSmsTwoConfig.getSignName());
smsInfoDTO.setTemplateCode(aliYunSmsTwoConfig.getTemplateCode());
Boolean b = sendSms(smsInfoDTO);
if (!b) {
log.info("短信发送失败");
}
log.info("短信发送成功");
} }
} else { } else {
// 如果任务类型不是电话外呼,更新节点任务表,新增患者管理任务执行记录,新增问卷提交结果表题目表选项表 // 如果任务类型不是电话外呼,更新节点任务表,新增患者管理任务执行记录,新增问卷提交结果表题目表选项表
@ -783,4 +798,52 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
} }
} }
/**
* 发送短信
*/
public Boolean sendSms(SmsInfoDTO smsInfoDTO) throws ClientException, ServiceException {
try {
// 短信发送参数非空性判断
if (ObjectUtils.isEmpty(smsInfoDTO)) {
throw new ServiceException("短信发送参数不能为空!");
}
if (StringUtils.isBlank(smsInfoDTO.getPhoneNumbers())) {
throw new ServiceException("待发送手机号不能为空!");
}
if (StringUtils.isBlank(smsInfoDTO.getSignName())) {
throw new ServiceException("短信签名不能为空!");
}
if (StringUtils.isBlank(smsInfoDTO.getTemplateCode())) {
throw new ServiceException("短信模板Code不能为空!");
}
// 设置系统的默认连接超时时间和读取超时时间
System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000");
// 初始化acsClient暂不支持region化
IClientProfile profile = DefaultProfile.getProfile(aliYunSmsTwoConfig.getRegionId(), aliYunSmsTwoConfig.getAccessKeyId(), aliYunSmsTwoConfig.getAccessKeySecret());
DefaultProfile.addEndpoint(aliYunSmsTwoConfig.getRegionId(), aliYunSmsTwoConfig.getProduct(), aliYunSmsTwoConfig.getDomain());
IAcsClient acsClient = new DefaultAcsClient(profile);
// 组装请求对象
SendSmsRequest request = new SendSmsRequest();
request.setPhoneNumbers(smsInfoDTO.getPhoneNumbers());
request.setSignName(smsInfoDTO.getSignName());
request.setTemplateCode(smsInfoDTO.getTemplateCode());
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
// 判断响应的结果
if (!SUCCESS.equals(sendSmsResponse.getCode())) {
SmsErrorCodeEnum errorCode = SmsErrorCodeEnum.getMsgByCode(sendSmsResponse.getCode());
log.error("短信发送失败,错误码:{},错误信息:{}", sendSmsResponse.getCode(), errorCode.getMessage());
return false;
}
log.info("短信发送成功code{}", sendSmsResponse.getCode());
return true;
} catch (ClientException e) {
log.error("发送短信出现异常,异常信息:{}", e.getMessage());
throw e;
}
}
} }

View File

@ -628,4 +628,10 @@
LEFT JOIN patient_info pi ON spmr.patient_id = pi.id LEFT JOIN patient_info pi ON spmr.patient_id = pi.id
where spmrn.id = #{manageRouteNodeId} where spmrn.id = #{manageRouteNodeId}
</select> </select>
<select id="selectPatientPhone" resultType="java.lang.String">
select patient_phone
from patient_info
where id = #{id}
</select>
</mapper> </mapper>

View File

@ -5,7 +5,7 @@ import com.aliyuncs.exceptions.ClientException;
import com.xinelu.common.config.AliYunSmsConfig; import com.xinelu.common.config.AliYunSmsConfig;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.utils.uuid.IdUtils; import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.mobile.dto.smssend.SmsInfoDTO; import com.xinelu.manage.dto.smssend.SmsInfoDTO;
import com.xinelu.mobile.utils.SmsSendUtils; import com.xinelu.mobile.utils.SmsSendUtils;
import com.xinelu.mobile.utils.WeChatAppletUtils; import com.xinelu.mobile.utils.WeChatAppletUtils;
import com.xinelu.mobile.utils.WeChatOfficialAccountUtils; import com.xinelu.mobile.utils.WeChatOfficialAccountUtils;

View File

@ -11,7 +11,7 @@ import com.xinelu.manage.domain.residentinfo.ResidentInfo;
import com.xinelu.manage.mapper.residentinfo.ResidentInfoMapper; import com.xinelu.manage.mapper.residentinfo.ResidentInfoMapper;
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordDTO; import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordDTO;
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordInfoDTO; import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordInfoDTO;
import com.xinelu.mobile.dto.smssend.SmsInfoDTO; import com.xinelu.manage.dto.smssend.SmsInfoDTO;
import com.xinelu.mobile.dto.verifysmscode.VerifySmsCodeDTO; import com.xinelu.mobile.dto.verifysmscode.VerifySmsCodeDTO;
import com.xinelu.mobile.mapper.appletpersoncenter.AppletPersonCenterMapper; import com.xinelu.mobile.mapper.appletpersoncenter.AppletPersonCenterMapper;
import com.xinelu.mobile.service.appletpersoncenter.AppletPersonCenterService; import com.xinelu.mobile.service.appletpersoncenter.AppletPersonCenterService;

View File

@ -104,6 +104,7 @@ public class HomePageServiceImpl implements HomePageService {
for (MyFollowUpVO myFollowUpVO : myFollowUpList) { for (MyFollowUpVO myFollowUpVO : myFollowUpList) {
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.setManageRouteNodeName(RouteNodeNameEnum.getNameByInfo(myFollowUpVO.getRouteNodeName()).getName());
} }
myFollowUpVO.setFollowName(myFollowUpVO.getManageRouteNodeName() + myFollowUpVO.getRouteNodeDay() + ""); myFollowUpVO.setFollowName(myFollowUpVO.getManageRouteNodeName() + myFollowUpVO.getRouteNodeDay() + "");
} }

View File

@ -10,7 +10,7 @@ import com.aliyuncs.profile.IClientProfile;
import com.xinelu.common.config.AliYunSmsConfig; import com.xinelu.common.config.AliYunSmsConfig;
import com.xinelu.common.enums.SmsErrorCodeEnum; import com.xinelu.common.enums.SmsErrorCodeEnum;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.mobile.dto.smssend.SmsInfoDTO; import com.xinelu.manage.dto.smssend.SmsInfoDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;

View File

@ -208,8 +208,7 @@ public class WeChatOfficialAccountUtils {
Map<String, Object> paramsMap = new LinkedHashMap<>(); Map<String, Object> paramsMap = new LinkedHashMap<>();
paramsMap.put("touser", patientVO.getOpenId()); paramsMap.put("touser", patientVO.getOpenId());
paramsMap.put("template_id", weChatAppletChatConfig.getHealthyPropagandaId()); paramsMap.put("template_id", weChatAppletChatConfig.getHealthyPropagandaId());
paramsMap.put("miniprogram_state", "developer");//todo paramsMap.put("page", "pages/propaganda/propaganda?manageRouteNodeId="+patientVO.getSignPatientManageRouteNodeId());
paramsMap.put("page", "/postDischarge/homePage/selectMessageContent?"+patientVO.getSignPatientManageRouteNodeId());
Map<String, Object> dataMap = new LinkedHashMap<>(); Map<String, Object> dataMap = new LinkedHashMap<>();
dataMap.put("thing5", new MessageValueEntity(thing5)); dataMap.put("thing5", new MessageValueEntity(thing5));
dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalAgencyName())); dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalAgencyName()));

View File

@ -64,7 +64,7 @@ public class MyFollowUpVO {
/** /**
* 随访方式 * 随访方式
*/ */
private String taskType; private String taskNodeType;
/** /**
* 管理路径节点时间 * 管理路径节点时间
@ -82,6 +82,9 @@ public class MyFollowUpVO {
*/ */
private Integer sign; private Integer sign;
/**
* 分页
*/
private Integer num; private Integer num;
private Integer size; private Integer size;
} }

View File

@ -20,11 +20,11 @@
IF(pter.id is NULL,0,1) sign, IF(pter.id is NULL,0,1) sign,
CASE CASE
WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN spmrn.phone_id WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN spmrn.phone_id
WHEN spmrn.task_node_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.question_info_id
END AS templateId END AS templateId
FROM sign_patient_manage_route_node spmrn FROM sign_patient_manage_route_node spmrn
LEFT JOIN sign_patient_manage_route spmr ON spmrn.manage_route_id = spmr.id 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_info pi ON spmr.patient_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_node_type in('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE') spmrn.task_node_type in('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE')
@ -45,11 +45,10 @@
resultType="com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord"> resultType="com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord">
select select
CASE CASE
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
WHEN spmrn.task_type = 'PROPAGANDA_ARTICLE' THEN spmrn.propaganda_title WHEN spmrn.task_node_type = 'PROPAGANDA_ARTICLE' THEN spmrn.propaganda_title
WHEN spmrn.task_type = 'TEXT_REMIND' THEN '文字提醒' WHEN spmrn.task_node_type = 'TEXT_REMIND' THEN '文字提醒'
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_name
END AS manageRouteNodeName, END AS manageRouteNodeName,
pter.execute_time pter.execute_time
from resident_info ri from resident_info ri
@ -72,7 +71,7 @@
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, pqsr.create_time executeTime,
(SELECT id (SELECT id
FROM patient_question_submit_result FROM patient_question_submit_result
WHERE resident_id = #{residentId} WHERE resident_id = #{residentId}
@ -81,10 +80,11 @@
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
LEFT JOIN question_info qi on qi.id = spmrn.question_info_id LEFT JOIN question_info qi on qi.id = spmrn.question_info_id
LEFT JOIN patient_question_submit_result pqsr on spmrn.id = pqsr.manage_route_node_id
WHERE qi.question_type = #{questionType} WHERE qi.question_type = #{questionType}
AND qi.questionnaire_status = #{questionnaireStatus} AND qi.questionnaire_status = #{questionnaireStatus}
and pi.resident_id = #{residentId} and pi.resident_id = #{residentId}
ORDER BY spmrn.execute_time DESC ORDER BY pqsr.create_time DESC, spmrn.create_time DESC
</select> </select>
<select id="selectResidentAndSubscribeMessageRecord" <select id="selectResidentAndSubscribeMessageRecord"