Merge branch '0418_小程序开发' of http://182.92.166.109:3000/zhuangyuanke/PostDischargePatientManage into 0418_小程序开发
This commit is contained in:
commit
789068d2ee
@ -242,3 +242,28 @@ aliyun-sms:
|
||||
# 阿里云登录确认验证模板-模板内容
|
||||
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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -30,6 +30,12 @@
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<!--阿里云发送短信-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-alicloud-sms</artifactId>
|
||||
<version>2.2.0.RELEASE</version>
|
||||
</dependency>
|
||||
<!-- 系统公共模块 -->
|
||||
<dependency>
|
||||
<groupId>com.xinelu</groupId>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.manage.controller.signpatientmanageroute;
|
||||
|
||||
import com.aliyuncs.exceptions.ClientException;
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
@ -124,7 +125,7 @@ public class SignPatientManageRouteController extends BaseController {
|
||||
* 人工随访代办处理
|
||||
*/
|
||||
@PostMapping("/addPatientQuestionResult")
|
||||
public AjaxResult addPatientQuestionResult(@RequestBody PatientQuestionSubmitResultDTO dto) {
|
||||
public AjaxResult addPatientQuestionResult(@RequestBody PatientQuestionSubmitResultDTO dto) throws ClientException {
|
||||
return signPatientManageRouteService.addPatientQuestionResult(dto);
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.xinelu.mobile.dto.smssend;
|
||||
package com.xinelu.manage.dto.smssend;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
@ -91,4 +91,12 @@ public interface SignPatientManageRouteMapper {
|
||||
* 话术类型代办处理详情
|
||||
*/
|
||||
PhonePush selectSignPatientManageRouteNode(Long manageRouteNodeId);
|
||||
|
||||
/**
|
||||
* 查询患者电话
|
||||
*
|
||||
* @param patientId
|
||||
* @return
|
||||
*/
|
||||
String selectPatientPhone(Long patientId);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.manage.service.signpatientmanageroute;
|
||||
|
||||
import com.aliyuncs.exceptions.ClientException;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
|
||||
import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO;
|
||||
@ -84,7 +85,7 @@ public interface ISignPatientManageRouteService {
|
||||
* @param dto 患者问卷提交结果信息表DTO
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult addPatientQuestionResult(PatientQuestionSubmitResultDTO dto);
|
||||
AjaxResult addPatientQuestionResult(PatientQuestionSubmitResultDTO dto) throws ClientException;
|
||||
|
||||
/**
|
||||
* 话术类型代办处理详情
|
||||
@ -104,5 +105,4 @@ public interface ISignPatientManageRouteService {
|
||||
* @return 节点详细信息列表
|
||||
*/
|
||||
List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long signRecordId);
|
||||
|
||||
}
|
||||
|
||||
@ -1,19 +1,21 @@
|
||||
package com.xinelu.manage.service.signpatientmanageroute.impl;
|
||||
|
||||
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.config.AliYunSmsTwoConfig;
|
||||
import com.xinelu.common.constant.TaskContentConstants;
|
||||
import com.xinelu.common.constant.TaskCreateTypeConstant;
|
||||
import com.xinelu.common.constant.TaskNodeTypeConstants;
|
||||
import com.xinelu.common.constant.TemplateTypeConstants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.enums.NodeExecuteStatusEnum;
|
||||
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.enums.*;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.AgeUtil;
|
||||
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.patientquestionsubjectresult.PatientQuestionSubjectResultDTO;
|
||||
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.patientquestionoptionresult.PatientQuestionOptionResultMapper;
|
||||
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.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import java.time.LocalDateTime;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
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.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 签约患者管理任务路径Service业务层处理
|
||||
@ -82,6 +83,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
* @author haown
|
||||
* @date 2024-03-18
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SignPatientManageRouteServiceImpl implements ISignPatientManageRouteService {
|
||||
@Resource
|
||||
@ -118,6 +120,10 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
private LabelFieldContentMapper labelFieldContentMapper;
|
||||
@Resource
|
||||
private ISignPatientManageRouteNodeService signPatientManageRouteNodeService;
|
||||
@Resource
|
||||
private AliYunSmsTwoConfig aliYunSmsTwoConfig;
|
||||
|
||||
private static final String SUCCESS = "OK";
|
||||
|
||||
/**
|
||||
* 查询签约患者管理任务路径
|
||||
@ -308,7 +314,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult addPatientQuestionResult(PatientQuestionSubmitResultDTO dto) {
|
||||
public AjaxResult addPatientQuestionResult(PatientQuestionSubmitResultDTO dto) throws ClientException {
|
||||
String routeHandlePerson = dto.getRouteHandlePerson();
|
||||
LocalDateTime time = LocalDateTime.now();
|
||||
// 如果任务类型是电话外呼,更新节点任务表,新增患者管理任务执行记录
|
||||
@ -322,7 +328,16 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
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())))) {
|
||||
|
||||
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 {
|
||||
// 如果任务类型不是电话外呼,更新节点任务表,新增患者管理任务执行记录,新增问卷提交结果表、题目表、选项表
|
||||
@ -789,4 +804,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -628,4 +628,10 @@
|
||||
LEFT JOIN patient_info pi ON spmr.patient_id = pi.id
|
||||
where spmrn.id = #{manageRouteNodeId}
|
||||
</select>
|
||||
|
||||
<select id="selectPatientPhone" resultType="java.lang.String">
|
||||
select patient_phone
|
||||
from patient_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -5,7 +5,7 @@ import com.aliyuncs.exceptions.ClientException;
|
||||
import com.xinelu.common.config.AliYunSmsConfig;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
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.WeChatAppletUtils;
|
||||
import com.xinelu.mobile.utils.WeChatOfficialAccountUtils;
|
||||
|
||||
@ -44,7 +44,7 @@ public class HomePageController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 问卷信息
|
||||
* 问卷信息(随访)
|
||||
*/
|
||||
@GetMapping("/selectQuestion")
|
||||
public AjaxResult selectQuestion(Long templateId) {
|
||||
@ -52,7 +52,7 @@ public class HomePageController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 问卷记录信息(消息记录)
|
||||
* 问卷记录信息(消息记录、我的随访)
|
||||
*/
|
||||
@GetMapping("/selectQuestionSubmit")
|
||||
public AjaxResult selectQuestionSubmit(Long patientQuestionSubmitResultId, Long patientTaskExecuteRecordId) {
|
||||
|
||||
@ -11,7 +11,7 @@ import com.xinelu.manage.domain.residentinfo.ResidentInfo;
|
||||
import com.xinelu.manage.mapper.residentinfo.ResidentInfoMapper;
|
||||
import com.xinelu.mobile.dto.appletpersoncenter.HealthRecordDTO;
|
||||
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.mapper.appletpersoncenter.AppletPersonCenterMapper;
|
||||
import com.xinelu.mobile.service.appletpersoncenter.AppletPersonCenterService;
|
||||
|
||||
@ -24,7 +24,6 @@ import com.xinelu.manage.mapper.patienttaskexecuterecord.PatientTaskExecuteRecor
|
||||
import com.xinelu.manage.mapper.questioninfo.QuestionInfoMapper;
|
||||
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;
|
||||
@ -95,26 +94,36 @@ public class HomePageServiceImpl implements HomePageService {
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo myFollowUp(MyFollowUpVO myFollowUp) {
|
||||
//查询已执行数据
|
||||
myFollowUp.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTED.getInfo());
|
||||
List<MyFollowUpVO> myFollowUpList = homePageMapper.selectManageRouteNode(myFollowUp);
|
||||
int total = myFollowUpList.size();
|
||||
if (CollectionUtils.isEmpty(myFollowUpList)) {
|
||||
return pageServiceUtil.getDataTable(new ArrayList<>());
|
||||
}
|
||||
//筛选未提交路径、组装数据
|
||||
List<MyFollowUpVO> myFollowUpVOS = new ArrayList<>();
|
||||
for (MyFollowUpVO myFollowUpVO : myFollowUpList) {
|
||||
if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) {
|
||||
//筛选未提交路径
|
||||
if (Objects.nonNull(myFollowUpVO.getSign()) && myFollowUpVO.getSign() == 0) {
|
||||
continue;
|
||||
}
|
||||
//组装数据
|
||||
if (Objects.nonNull(myFollowUpVO.getDischargeTime())) {
|
||||
myFollowUpVO.setFollowDate(myFollowUpVO.getDischargeTime().plusDays(myFollowUpVO.getRouteNodeDay()));
|
||||
myFollowUpVO.setManageRouteNodeName(RouteNodeNameEnum.getNameByInfo(myFollowUpVO.getRouteNodeName()).getName());
|
||||
}
|
||||
myFollowUpVO.setFollowName(myFollowUpVO.getManageRouteNodeName() + myFollowUpVO.getRouteNodeDay() + "天");
|
||||
myFollowUpVOS.add(myFollowUpVO);
|
||||
}
|
||||
myFollowUpList.sort(Comparator.comparing(MyFollowUpVO::getFollowDate).reversed());
|
||||
//处理上面查询的list集合
|
||||
myFollowUpVOS.sort(Comparator.comparing(MyFollowUpVO::getFollowDate).reversed());
|
||||
//分页
|
||||
if (Objects.nonNull(myFollowUp.getNum()) || Objects.nonNull(myFollowUp.getSize())) {
|
||||
Integer pageNum = myFollowUp.getNum();
|
||||
Integer pageSize = myFollowUp.getSize();
|
||||
myFollowUpList = myFollowUpList.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
||||
myFollowUpVOS = myFollowUpVOS.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
||||
}
|
||||
TableDataInfo dataTable = pageServiceUtil.getDataTable(myFollowUpList);
|
||||
TableDataInfo dataTable = pageServiceUtil.getDataTable(myFollowUpVOS);
|
||||
dataTable.setTotal(total);
|
||||
return dataTable;
|
||||
}
|
||||
@ -263,6 +272,7 @@ public class HomePageServiceImpl implements HomePageService {
|
||||
public TableDataInfo satisfactionQuestionnaire(Long residentId) {
|
||||
pageServiceUtil.startPage();
|
||||
List<SatisfactionQuestionnaire> satisfactionQuestionnaires = homePageMapper.satisfactionQuestionnaireByResidentId(residentId, QuestionTypeEnum.SATISFACTION_QUESTIONNAIRE.getInfo(), QuestionnaireStatusEnum.PUBLISHED.getInfo());
|
||||
//判断是否完成
|
||||
for (SatisfactionQuestionnaire satisfactionQuestionnaire : satisfactionQuestionnaires) {
|
||||
if (Objects.isNull(satisfactionQuestionnaire.getPatientQuestionSubmitResultId())) {
|
||||
satisfactionQuestionnaire.setSign("incomplete");
|
||||
@ -281,22 +291,26 @@ public class HomePageServiceImpl implements HomePageService {
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectSignPatientManageRouteNode(Long residentId) {
|
||||
//查询已执行人工随访
|
||||
List<MessageTabulationVO> signPatientManageRouteNodes = homePageMapper.selectManageRouteByResidentId(residentId, NodeExecuteStatusEnum.EXECUTED.getInfo());
|
||||
if (CollectionUtils.isEmpty(signPatientManageRouteNodes)) {
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
//过滤电话外呼数据
|
||||
List<MessageTabulationVO> messageTabulationVOS = new ArrayList<>();
|
||||
for (MessageTabulationVO manageRouteNode : signPatientManageRouteNodes) {
|
||||
if (Objects.isNull(manageRouteNode) || TaskContentEnum.PHONE_OUTBOUND.getInfo().equals(manageRouteNode.getTaskNodeType())) {
|
||||
signPatientManageRouteNodes.remove(manageRouteNode);
|
||||
continue;
|
||||
}
|
||||
if (Objects.nonNull(manageRouteNode) && StringUtils.isNotBlank(manageRouteNode.getManageRouteName()) && StringUtils.isNotBlank(manageRouteNode.getRouteNodeName()) && Objects.nonNull(manageRouteNode.getRouteNodeDay())) {
|
||||
if (StringUtils.isNotBlank(manageRouteNode.getManageRouteName()) && StringUtils.isNotBlank(manageRouteNode.getRouteNodeName()) && Objects.nonNull(manageRouteNode.getRouteNodeDay())) {
|
||||
if (StringUtils.isNotBlank(manageRouteNode.getRouteNodeName())) {
|
||||
manageRouteNode.setRouteNodeName(RouteNodeNameEnum.getNameByInfo(manageRouteNode.getRouteNodeName()).getName());
|
||||
}
|
||||
manageRouteNode.setRouteNodeName(manageRouteNode.getManageRouteName() + manageRouteNode.getRouteNodeName() + "第" + manageRouteNode.getRouteNodeDay() + "天");
|
||||
messageTabulationVOS.add(manageRouteNode);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(signPatientManageRouteNodes);
|
||||
return AjaxResult.success(messageTabulationVOS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,7 @@ import com.aliyuncs.profile.IClientProfile;
|
||||
import com.xinelu.common.config.AliYunSmsConfig;
|
||||
import com.xinelu.common.enums.SmsErrorCodeEnum;
|
||||
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 org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@ -203,13 +203,13 @@ public class WeChatOfficialAccountUtils {
|
||||
}
|
||||
//获取微信小程序的accessToken
|
||||
String accessToken = this.getWeChatAppletAccessToken();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
//定义模板内容
|
||||
Map<String, Object> paramsMap = new LinkedHashMap<>();
|
||||
paramsMap.put("touser", patientVO.getOpenId());
|
||||
paramsMap.put("template_id", weChatAppletChatConfig.getHealthyPropagandaId());
|
||||
paramsMap.put("miniprogram_state", "developer");//todo
|
||||
paramsMap.put("page", "/postDischarge/homePage/selectMessageContent?"+patientVO.getSignPatientManageRouteNodeId());
|
||||
//跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
|
||||
//paramsMap.put("miniprogram_state", "developer");
|
||||
paramsMap.put("page", "pages/propaganda/propaganda?manageRouteNodeId="+patientVO.getSignPatientManageRouteNodeId());
|
||||
Map<String, Object> dataMap = new LinkedHashMap<>();
|
||||
dataMap.put("thing5", new MessageValueEntity(thing5));
|
||||
dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalAgencyName()));
|
||||
|
||||
@ -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 num;
|
||||
private Integer size;
|
||||
}
|
||||
@ -20,11 +20,11 @@
|
||||
IF(pter.id is NULL,0,1) sign,
|
||||
CASE
|
||||
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
|
||||
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_info pi ON spmr.patient_id = pi.id
|
||||
LEFT JOIN patient_task_execute_record pter ON pter.manage_route_node_id = spmrn.id
|
||||
<where>
|
||||
spmrn.task_node_type in('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE')
|
||||
@ -45,17 +45,17 @@
|
||||
resultType="com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord">
|
||||
select
|
||||
CASE
|
||||
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name
|
||||
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
|
||||
WHEN spmrn.task_type = 'PROPAGANDA_ARTICLE' THEN spmrn.propaganda_title
|
||||
WHEN spmrn.task_type = 'TEXT_REMIND' THEN '文字提醒'
|
||||
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_name
|
||||
WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name
|
||||
WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
|
||||
WHEN spmrn.task_node_type = 'PROPAGANDA_ARTICLE' THEN spmrn.propaganda_title
|
||||
WHEN spmrn.task_node_type = 'TEXT_REMIND' THEN '文字提醒'
|
||||
END AS manageRouteNodeName,
|
||||
pter.execute_time
|
||||
from resident_info ri
|
||||
LEFT JOIN patient_info pi ON ri.id = pi.resident_id
|
||||
LEFT JOIN patient_task_execute_record pter ON pter.patient_id = pi.id
|
||||
LEFT JOIN sign_patient_manage_route_node spmrn ON spmrn.id = pter.manage_route_node_id
|
||||
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 resident_info ri ON ri.id = pi.resident_id
|
||||
LEFT JOIN patient_task_execute_record pter ON spmrn.id = pter.manage_route_node_id
|
||||
<where>
|
||||
ri.del_flag = 0 AND pi.del_flag = 0
|
||||
<if test="residentId != null ">
|
||||
@ -72,7 +72,7 @@
|
||||
resultType="com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire">
|
||||
SELECT spmrn.question_info_id templateId,
|
||||
spmrn.questionnaire_name,
|
||||
spmrn.execute_time,
|
||||
pqsr.create_time executeTime,
|
||||
(SELECT id
|
||||
FROM patient_question_submit_result
|
||||
WHERE resident_id = #{residentId}
|
||||
@ -81,10 +81,11 @@
|
||||
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 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}
|
||||
AND qi.questionnaire_status = #{questionnaireStatus}
|
||||
and pi.resident_id = #{residentId}
|
||||
ORDER BY spmrn.execute_time DESC
|
||||
ORDER BY pqsr.create_time DESC, spmrn.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectResidentAndSubscribeMessageRecord"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user