From 80f1bdaaae6f1b3456ed33528c176c1c4f17d8b0 Mon Sep 17 00:00:00 2001 From: bynt Date: Fri, 3 Dec 2021 09:33:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E7=9F=AD=E4=BF=A1=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A8=A1=E6=9D=BF=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/uploadnew/task/SendMessageTask.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SendMessageTask.java b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SendMessageTask.java index 57d9cda..6922edf 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SendMessageTask.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SendMessageTask.java @@ -75,7 +75,7 @@ public class SendMessageTask { // 获取需求的地址 String tempFilesPath = tbUploadFileNewDto.getLocalSavePath(); // 单文件处理 - boolean finalTag = handleEachFileContent(tempFilesPath, tbUploadFileNewDto.getFileFormat(), smsConfigurationDto); + boolean finalTag = handleEachFileContent(tempFilesPath, tbUploadFileNewDto.getId(), tbUploadFileNewDto.getFileFormat(), smsConfigurationDto); // 更新状态为成功,更新解析成功的条数 TbUploadFileNew tbUploadFileNew = new TbUploadFileNew(); BeanUtils.copyProperties(tbUploadFileNewDto, tbUploadFileNew); @@ -88,14 +88,16 @@ public class SendMessageTask { * 对每一个文件的处理操作 * * @param filePath 进行操作的每一个文件的路径 + * @param sendId * @param smsConfigurationDto */ @SneakyThrows - private boolean handleEachFileContent(String filePath, String fileFormat, SmsConfigurationDto smsConfigurationDto) { + private boolean handleEachFileContent(String filePath, Integer sendId, + String fileFormat, SmsConfigurationDto smsConfigurationDto) { //根据文件类型进行解析 List list = fileFormat.contains(FileConstant.TXT_FILE_SUB_NAME) ? TxtUtils.txtParseListVyUrl(filePath) : - ToolExcelUtils.excelParseListByUrl(filePath); + ToolExcelUtils.excelParseListByUrl(filePath); if (!CollectionUtils.isEmpty(list)) { List stringList = list.stream().filter @@ -120,8 +122,8 @@ public class SendMessageTask { sendSms = new TbSendSms(); // StrUtil 工具类 String[] split = StringUtils.split(resultUrl, SmsConstant.VERTICAL_LINE); - phone = split[1]; - linkUrl = split[0]; + phone = split[DefaultConstant.ONE_NUMBER]; + linkUrl = split[DefaultConstant.ZERO_NUMBER]; String sendMessage = smsConfigurationDto.getMessageContent().replace ("${url}", StrUtil.SPACE + @@ -129,6 +131,7 @@ public class SendMessageTask { sendSms.setPhone(phone); sendSms.setLinkUrl(linkUrl); sendSms.setSendMessage(sendMessage); + sendSms.setTemplateId((long) sendId); sendSms.setIsLinkCallback(DefaultConstant.ZERO_NUMBER); sendSms.setSendTime(new Timestamp(System.currentTimeMillis())); boolean sendResult = SmsUtil.sendSms(phone, sendMessage, smsConfigurationDto.getId());