From c6c6db2c86ef21a23b74a4ba0bb8c5ac076f4e1d Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Wed, 17 Jul 2024 16:40:06 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=88=91?= =?UTF-8?q?=E7=9A=84=E9=9A=8F=E8=AE=BF=EF=BC=8C=E5=81=A5=E5=BA=B7=E6=97=A5?= =?UTF-8?q?=E5=BF=97=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 25 +++++ .../common/config/AliYunSmsTwoConfig.java | 52 ++++++++++ postdischarge-manage/pom.xml | 6 ++ .../SignPatientManageRouteController.java | 3 +- .../manage}/dto/smssend/SmsInfoDTO.java | 2 +- .../SignPatientManageRouteMapper.java | 8 ++ .../ISignPatientManageRouteService.java | 4 +- .../SignPatientManageRouteServiceImpl.java | 97 +++++++++++++++---- .../SignPatientManageRouteMapper.xml | 6 ++ .../controller/MobileTestController.java | 2 +- .../Impl/AppletPersonCenterServiceImpl.java | 2 +- .../homepage/Impl/HomePageServiceImpl.java | 1 + .../com/xinelu/mobile/utils/SmsSendUtils.java | 2 +- .../utils/WeChatOfficialAccountUtils.java | 3 +- .../mobile/vo/myfollowup/MyFollowUpVO.java | 5 +- .../mapper/homepage/HomePageMapper.xml | 18 ++-- 16 files changed, 200 insertions(+), 36 deletions(-) create mode 100644 postdischarge-common/src/main/java/com/xinelu/common/config/AliYunSmsTwoConfig.java rename {postdischarge-mobile/src/main/java/com/xinelu/mobile => postdischarge-manage/src/main/java/com/xinelu/manage}/dto/smssend/SmsInfoDTO.java (93%) diff --git a/postdischarge-admin/src/main/resources/application.yml b/postdischarge-admin/src/main/resources/application.yml index 2bac0618..3d001ce7 100644 --- a/postdischarge-admin/src/main/resources/application.yml +++ b/postdischarge-admin/src/main/resources/application.yml @@ -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 diff --git a/postdischarge-common/src/main/java/com/xinelu/common/config/AliYunSmsTwoConfig.java b/postdischarge-common/src/main/java/com/xinelu/common/config/AliYunSmsTwoConfig.java new file mode 100644 index 00000000..73913e11 --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/config/AliYunSmsTwoConfig.java @@ -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; +} \ No newline at end of file diff --git a/postdischarge-manage/pom.xml b/postdischarge-manage/pom.xml index 6fbeeede..38cc3a6e 100644 --- a/postdischarge-manage/pom.xml +++ b/postdischarge-manage/pom.xml @@ -30,6 +30,12 @@ swagger-models 1.6.2 + + + com.alibaba.cloud + spring-cloud-alicloud-sms + 2.2.0.RELEASE + com.xinelu diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java index 744d1eb0..b42f8e64 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java @@ -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); } diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/dto/smssend/SmsInfoDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/smssend/SmsInfoDTO.java similarity index 93% rename from postdischarge-mobile/src/main/java/com/xinelu/mobile/dto/smssend/SmsInfoDTO.java rename to postdischarge-manage/src/main/java/com/xinelu/manage/dto/smssend/SmsInfoDTO.java index a26afc75..43e2a06e 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/dto/smssend/SmsInfoDTO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/smssend/SmsInfoDTO.java @@ -1,4 +1,4 @@ -package com.xinelu.mobile.dto.smssend; +package com.xinelu.manage.dto.smssend; import com.alibaba.fastjson2.JSONObject; import lombok.Data; diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroute/SignPatientManageRouteMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroute/SignPatientManageRouteMapper.java index daebe2ce..9c007420 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroute/SignPatientManageRouteMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroute/SignPatientManageRouteMapper.java @@ -91,4 +91,12 @@ public interface SignPatientManageRouteMapper { * 话术类型代办处理详情 */ PhonePush selectSignPatientManageRouteNode(Long manageRouteNodeId); + + /** + * 查询患者电话 + * + * @param patientId + * @return + */ + String selectPatientPhone(Long patientId); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java index d8186722..fec56c73 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java @@ -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 getRouteNodeInfo(Long signRecordId); - } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java index 03f13446..619107be 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java @@ -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"; /** * 查询签约患者管理任务路径 @@ -302,7 +308,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(); // 如果任务类型是电话外呼,更新节点任务表,新增患者管理任务执行记录 @@ -316,7 +322,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 { // 如果任务类型不是电话外呼,更新节点任务表,新增患者管理任务执行记录,新增问卷提交结果表、题目表、选项表 @@ -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; + } + } } 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 dc059fdf..d1dd9bc1 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml @@ -628,4 +628,10 @@ LEFT JOIN patient_info pi ON spmr.patient_id = pi.id where spmrn.id = #{manageRouteNodeId} + + \ No newline at end of file diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/MobileTestController.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/MobileTestController.java index a7c878e8..f0b028c3 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/MobileTestController.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/MobileTestController.java @@ -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; 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 16d1156f..63b96bd7 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 @@ -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; 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 9fc1fd61..84f60397 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 @@ -104,6 +104,7 @@ public class HomePageServiceImpl implements HomePageService { for (MyFollowUpVO myFollowUpVO : myFollowUpList) { if (Objects.nonNull(myFollowUpVO) && Objects.nonNull(myFollowUpVO.getDischargeTime())) { myFollowUpVO.setFollowDate(myFollowUpVO.getDischargeTime().plusDays(myFollowUpVO.getRouteNodeDay())); + myFollowUpVO.setManageRouteNodeName(RouteNodeNameEnum.getNameByInfo(myFollowUpVO.getRouteNodeName()).getName()); } myFollowUpVO.setFollowName(myFollowUpVO.getManageRouteNodeName() + myFollowUpVO.getRouteNodeDay() + "天"); } diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/SmsSendUtils.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/SmsSendUtils.java index 6f950f95..eaaa6249 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/SmsSendUtils.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/SmsSendUtils.java @@ -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; diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/WeChatOfficialAccountUtils.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/WeChatOfficialAccountUtils.java index 31dc9cec..97f19fa8 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/WeChatOfficialAccountUtils.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/WeChatOfficialAccountUtils.java @@ -208,8 +208,7 @@ public class WeChatOfficialAccountUtils { Map 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()); + paramsMap.put("page", "pages/propaganda/propaganda?manageRouteNodeId="+patientVO.getSignPatientManageRouteNodeId()); Map dataMap = new LinkedHashMap<>(); dataMap.put("thing5", new MessageValueEntity(thing5)); dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalAgencyName())); 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 55ef0919..59b94566 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 @@ -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; } \ No newline at end of file diff --git a/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml b/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml index c4f3e636..d77e95f4 100644 --- a/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml +++ b/postdischarge-mobile/src/main/resources/mapper/homepage/HomePageMapper.xml @@ -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 spmrn.task_node_type in('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE') @@ -45,11 +45,10 @@ 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 @@ -72,7 +71,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 +80,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