| | |
| | | |
| | | import cn.com.flaginfo.sdk.cmc.api.sms.send.SMSSendRequest; |
| | | import cn.gistack.alerts.sms.entity.SmsResult; |
| | | import cn.gistack.alerts.sms.service.ISmsResultService; |
| | | import cn.gistack.alerts.sms.service.SmsService; |
| | | import cn.gistack.alerts.sms.vo.SmsResponseVO; |
| | | import cn.gistack.alerts.sms.vo.SmsResultVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 短信发送记录 |
| | |
| | | public class SmsRecordClient implements ISmsRecordClient { |
| | | |
| | | private final SmsService smsService; |
| | | private final ISmsResultService smsResultService; |
| | | |
| | | @Override |
| | | public List<SmsResultVO> smsSuccessList(SmsResultVO smsResult) { |
| | | List<SmsResultVO> resultVOList = (List<SmsResultVO>) smsResultService.selectSmsResultPage(null, smsResult); |
| | | return resultVOList; |
| | | } |
| | | |
| | | /** |
| | | * 短信记录发送保存 |
| | |
| | | request.setUserNumber(userNumber); |
| | | request.setTemplateId(templateId); |
| | | request.setMessageContent(messageContent); |
| | | SmsResponseVO smsResponse = new SmsResponseVO(); |
| | | smsResponse.setCode(code); |
| | | smsResponse.setMsg(msg); |
| | | // 记录发送记录操作 |
| | | SmsResult smsResult = smsService.saveSendResult(smsResponse,request, number); |
| | | SmsResult smsResult = smsService.saveSendResult(null,code,msg,request, number); |
| | | if (null != smsResult){ |
| | | smsService.saveSendRecord(request, code,msg,smsResult.getId()); |
| | | } |
| | |
| | | public String sendSmsByOutCallNotConnect(String taskId,String time) { |
| | | return smsService.sendSmsByOutCallNotConnect(taskId,time); |
| | | } |
| | | |
| | | /** |
| | | * 外呼任务创建失败发送短信提醒 |
| | | * @param msg 失败原因 |
| | | */ |
| | | @Override |
| | | @GetMapping(CREATE_OUT_CALL_ERROR_SEND_SMS) |
| | | public void createOutCallErrorSendSms(String msg) { |
| | | // 创建map 集合 |
| | | Map<String, Object> map = new HashMap<>(3); |
| | | // 查询需要告警的人员手机号 |
| | | List<String> list = new ArrayList<>(); |
| | | list.add("15170720695"); |
| | | list.add("15179776420"); |
| | | //封装数据 |
| | | map.put("templateId","2431012254505"); |
| | | map.put("phones",list); |
| | | map.put("content",msg); |
| | | // 发送短信 |
| | | smsService.batchSendSms(map); |
| | | } |
| | | } |