| | |
| | | |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.ruoyi.admin.service.SendSmsService; |
| | | import com.ruoyi.admin.utils.ALiSendSms; |
| | | import com.ruoyi.admin.utils.SendSmsUtil; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.RedisConstants; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | @Resource |
| | | private SendSmsUtil sendSmsUtil; |
| | | @Resource |
| | | private ALiSendSms aLiSendSms; |
| | | |
| | | |
| | | @Override |
| | | public String workerSettleSms(String phone) { |
| | |
| | | sendSmsUtil.loginId); |
| | | } |
| | | |
| | | @Override |
| | | public String dispatchOrder(Order order) { |
| | | // 发送验证码 |
| | | String phone = order.getReservationPhone(); |
| | | String[] arr = {order.getOrderNumber()}; |
| | | // sendSmsUtil.sendSms(new SendSmsUtil.SendSmsRequest(phone, sendSmsUtil.reservationId, arr)); |
| | | aLiSendSms.send(phone, order.getServerPhone()); |
| | | return "发送成功!"; |
| | | } |
| | | |
| | | private String sendPhoneCode(String phone, String redisKey, String templateId) { |
| | | // 生成随机 6位数字 验证码 |
| | | String phoneCode = RandomUtil.randomNumbers(6); |