发送短信增加模板编号

master
bynt 3 years ago
parent 1293fab273
commit 80f1bdaaae

@ -75,7 +75,7 @@ public class SendMessageTask {
// 获取需求的地址 // 获取需求的地址
String tempFilesPath = tbUploadFileNewDto.getLocalSavePath(); String tempFilesPath = tbUploadFileNewDto.getLocalSavePath();
// 单文件处理 // 单文件处理
boolean finalTag = handleEachFileContent(tempFilesPath, tbUploadFileNewDto.getFileFormat(), smsConfigurationDto); boolean finalTag = handleEachFileContent(tempFilesPath, tbUploadFileNewDto.getId(), tbUploadFileNewDto.getFileFormat(), smsConfigurationDto);
// 更新状态为成功,更新解析成功的条数 // 更新状态为成功,更新解析成功的条数
TbUploadFileNew tbUploadFileNew = new TbUploadFileNew(); TbUploadFileNew tbUploadFileNew = new TbUploadFileNew();
BeanUtils.copyProperties(tbUploadFileNewDto, tbUploadFileNew); BeanUtils.copyProperties(tbUploadFileNewDto, tbUploadFileNew);
@ -88,10 +88,12 @@ public class SendMessageTask {
* *
* *
* @param filePath * @param filePath
* @param sendId
* @param smsConfigurationDto * @param smsConfigurationDto
*/ */
@SneakyThrows @SneakyThrows
private boolean handleEachFileContent(String filePath, String fileFormat, SmsConfigurationDto smsConfigurationDto) { private boolean handleEachFileContent(String filePath, Integer sendId,
String fileFormat, SmsConfigurationDto smsConfigurationDto) {
//根据文件类型进行解析 //根据文件类型进行解析
List<String> list = fileFormat.contains(FileConstant.TXT_FILE_SUB_NAME) ? List<String> list = fileFormat.contains(FileConstant.TXT_FILE_SUB_NAME) ?
TxtUtils.txtParseListVyUrl(filePath) : TxtUtils.txtParseListVyUrl(filePath) :
@ -120,8 +122,8 @@ public class SendMessageTask {
sendSms = new TbSendSms(); sendSms = new TbSendSms();
// StrUtil 工具类 // StrUtil 工具类
String[] split = StringUtils.split(resultUrl, SmsConstant.VERTICAL_LINE); String[] split = StringUtils.split(resultUrl, SmsConstant.VERTICAL_LINE);
phone = split[1]; phone = split[DefaultConstant.ONE_NUMBER];
linkUrl = split[0]; linkUrl = split[DefaultConstant.ZERO_NUMBER];
String sendMessage = smsConfigurationDto.getMessageContent().replace String sendMessage = smsConfigurationDto.getMessageContent().replace
("${url}", ("${url}",
StrUtil.SPACE + StrUtil.SPACE +
@ -129,6 +131,7 @@ public class SendMessageTask {
sendSms.setPhone(phone); sendSms.setPhone(phone);
sendSms.setLinkUrl(linkUrl); sendSms.setLinkUrl(linkUrl);
sendSms.setSendMessage(sendMessage); sendSms.setSendMessage(sendMessage);
sendSms.setTemplateId((long) sendId);
sendSms.setIsLinkCallback(DefaultConstant.ZERO_NUMBER); sendSms.setIsLinkCallback(DefaultConstant.ZERO_NUMBER);
sendSms.setSendTime(new Timestamp(System.currentTimeMillis())); sendSms.setSendTime(new Timestamp(System.currentTimeMillis()));
boolean sendResult = SmsUtil.sendSms(phone, sendMessage, smsConfigurationDto.getId()); boolean sendResult = SmsUtil.sendSms(phone, sendMessage, smsConfigurationDto.getId());

Loading…
Cancel
Save