| | |
| | | String templateCode = null; |
| | | // 生成四位数数字验证码 |
| | | String code = String.valueOf((int)((Math.random()*9+1)*1000)); |
| | | redisUtil.setStrValue(driver.getPhone(),code); |
| | | redisUtil.setStrValue(driver.getPhone(),code,5 * 60); |
| | | switch (type){ |
| | | case 1: |
| | | templateCode = "SMS_333555212";//身份验证 |
| | |
| | | orderLogistics.setPickUpCode(random); |
| | | this.updateById(orderLogistics); |
| | | //发送短信 |
| | | aLiSendSms.sendSms(orderLogistics.getRecipientPhone(), "SMS_240075144", "{\"code\":\"" + random + "\"}"); |
| | | // aLiSendSms.sendSms(orderLogistics.getRecipientPhone(), "SMS_240075144", "{\"code\":\"" + random + "\"}"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | try{ |
| | | UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId()); |
| | | |
| | | String sData = aLiSendSms.sendSms(orderPrivateCar.getPassengersPhone(), "SMS_244480455", "{\"name\":\"" + driver.getName() + "\",\"phone\":\"" + driver.getPhone() + "\",\"carInfo\":\"" +carService.selectById(orderPrivateCar.getCarId()) .getCarLicensePlate() + "\",}"); |
| | | // String sData = aLiSendSms.sendSms(orderPrivateCar.getPassengersPhone(), "SMS_244480455", "{\"name\":\"" + driver.getName() + "\",\"phone\":\"" + driver.getPhone() + "\",\"carInfo\":\"" +carService.selectById(orderPrivateCar.getCarId()) .getCarLicensePlate() + "\",}"); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | |
| | | // return ResultUtil.error(""); |
| | | // } |
| | | // System.out.println(sms); |
| | | MsgUtil.Send_Post(phone, authCode); |
| | | String s = aLiSendSms.sendSms(phone, "SMS_333555212", "{\"code\":\""+authCode+"\"}"); |
| | | // MsgUtil.Send_Post(phone, authCode); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | UserInfo userInfo = userInfoMapper.selectById(orderTaxi.getUserId()); |
| | | // String sData = aLiSendSms.sendSms(userInfo.getPhone(), "SMS_244480455", "{\"name\":\"" + driver.getName() + "\",\"phone\":\"" + driver.getPhone() + "\",\"carInfo\":\"" +carService.selectById(orderTaxi.getCarId()) .getCarLicensePlate() + "\",}"); |
| | | Car car = carService.selectById(driver.getCarId()); |
| | | String s = MsgUtil.SendDriverPost(orderTaxi.getPassengersPhone(), car.getCarLicensePlate(), driver.getName(), driver.getPhone()); |
| | | System.err.println("====电话回调===" + s); |
| | | // String s = MsgUtil.SendDriverPost(orderTaxi.getPassengersPhone(), car.getCarLicensePlate(), driver.getName(), driver.getPhone()); |
| | | // System.err.println("====电话回调===" + s); |
| | | } catch (Exception e) { |
| | | return ResultUtil.error("抢单失败"); |
| | | } finally { |
| | |
| | | //发送短信 |
| | | try { |
| | | UserInfo userInfo = userInfoMapper.selectById(orderTaxi.getUserId()); |
| | | String sData = aLiSendSms.sendSms(userInfo.getPhone(), "SMS_244480455", "{\"name\":\"" + driver.getName() + "\",\"phone\":\"" + driver.getPhone() + "\",\"carInfo\":\"" + carService.selectById(orderTaxi.getCarId()).getCarLicensePlate() + "\",}"); |
| | | // String sData = aLiSendSms.sendSms(userInfo.getPhone(), "SMS_244480455", "{\"name\":\"" + driver.getName() + "\",\"phone\":\"" + driver.getPhone() + "\",\"carInfo\":\"" + carService.selectById(orderTaxi.getCarId()).getCarLicensePlate() + "\",}"); |
| | | |
| | | } catch (Exception e) { |
| | | |
| | |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | </dependency> |
| | | <!--华为云的obs--> |
| | | <dependency> |
| | | <groupId>com.huaweicloud</groupId> |
| | | <artifactId>esdk-obs-java</artifactId> |
| | | <version>3.19.5</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | |
| | | // System.out.println(sms); |
| | | System.err.println("222222"); |
| | | |
| | | String s = MsgUtil.Send_Post(phone, authCode); |
| | | String s = aLiSendSms.sendSms(phone, "SMS_333555212", "{\"code\":\""+authCode+"\"}"); |
| | | // String s = MsgUtil.Send_Post(phone, authCode); |
| | | System.err.println(s); |
| | | |
| | | return ResultUtil.success(); |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.amazonaws.ClientConfiguration; |
| | | import com.amazonaws.Protocol; |
| | | import com.amazonaws.auth.BasicAWSCredentials; |
| | | import com.amazonaws.services.s3.AmazonS3Client; |
| | | import com.amazonaws.services.s3.S3ClientOptions; |
| | | import com.amazonaws.services.s3.model.CannedAccessControlList; |
| | | import com.amazonaws.services.s3.model.PutObjectRequest; |
| | | import com.amazonaws.services.s3.model.PutObjectResult; |
| | | import com.obs.services.ObsClient; |
| | | import com.obs.services.model.ObjectMetadata; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.UUID; |
| | | |
| | | public class OssUploadUtil { |
| | |
| | | for (OrderTaxi orderTaxi : list) { |
| | | orderTaxi.setState(10); |
| | | if (StringUtils.hasLength(orderTaxi.getPassengersPhone())) { |
| | | String s = MsgUtil.SendUserCancel(orderTaxi.getPassengersPhone()); |
| | | log.info("取消订单id:" + orderTaxi.getId() + ",短信发送状态:" + s); |
| | | // String s = MsgUtil.SendUserCancel(orderTaxi.getPassengersPhone()); |
| | | // log.info("取消订单id:" + orderTaxi.getId() + ",短信发送状态:" + s); |
| | | } |
| | | orderTaxiService.updateById(orderTaxi); |
| | | } |