|
|
|
@ -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,10 +88,12 @@ 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<String> list = fileFormat.contains(FileConstant.TXT_FILE_SUB_NAME) ?
|
|
|
|
|
TxtUtils.txtParseListVyUrl(filePath) :
|
|
|
|
@ -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());
|
|
|
|
|