| | |
| | | <version>3.1.0</version> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | </dependency> |
| | | |
| | | <!--shiro依赖--> |
| | | <dependency> |
| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.util.ALiSendSms; |
| | | import com.stylefeng.guns.modular.system.util.PushUtil; |
| | | import com.stylefeng.guns.modular.system.util.SMSUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.ActivityWarpper; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | |
| | | templateCode = "SMS_482775061";//司机注册失败 |
| | | break; |
| | | } |
| | | String s = aLiSendSms.sendSms(driver.getPhone(), templateCode, "{}"); |
| | | // SMSUtil.send(driver.getPhone(), ); |
| | | // String s = aLiSendSms.sendSms(driver.getPhone(), templateCode, "{}"); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | public void sendVerificationCode(Integer orderId) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | String random = ""; |
| | | for(int i = 0; i < 6; i++){ |
| | | for(int i = 0; i < 4; i++){ |
| | | random += Double.valueOf(Math.random() * 10).intValue(); |
| | | } |
| | | orderLogistics.setPickUpCode(random); |
| | | this.updateById(orderLogistics); |
| | | //发送短信 |
| | | aLiSendSms.sendSms(orderLogistics.getRecipientPhone(), "SMS_482775061", "{\"code\":\"" + random + "\"}"); |
| | | SMSUtil.send(orderLogistics.getRecipientPhone(), "您的验证码:" + random + ",您正在进行身份验证,请勿泄露于他人!", "2431012312847"); |
| | | // aLiSendSms.sendSms(orderLogistics.getRecipientPhone(), "SMS_482775061", "{\"code\":\"" + random + "\"}"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SystemPriceMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ICarService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderPositionService; |
| | |
| | | }).start(); |
| | | //发送短信 |
| | | try{ |
| | | UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId()); |
| | | |
| | | String sData = aLiSendSms.sendSms(orderPrivateCar.getPassengersPhone(), "SMS_476900230", "{\"code1\":\"" + driver.getName() + "\",\"code2\":\"" + driver.getPhone() + "\",\"code3\":\"" +carService.selectById(orderPrivateCar.getCarId()) .getCarLicensePlate() + "\"}"); |
| | | Car car = carService.selectById(orderPrivateCar.getCarId()); |
| | | SMSUtil.send(orderPrivateCar.getPassengersPhone(), "您的订单已被司机" + driver.getName() + "接单,联系电话" + driver.getPhone() + "车牌号" + car.getCarLicensePlate() + "请耐心等待。", "2431012312845"); |
| | | // String sData = aLiSendSms.sendSms(orderPrivateCar.getPassengersPhone(), "SMS_476900230", "{\"code1\":\"" + driver.getName() + "\",\"code2\":\"" + driver.getPhone() + "\",\"code3\":\"" + car.getCarLicensePlate() + "\"}"); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | |
| | | templateCode = "SMS_482775061";//修改密码 |
| | | break; |
| | | } |
| | | String sData = aLiSendSms.sendSms(phone, templateCode, "{\"code\":\"" + authCode + "\"}"); |
| | | JSONObject jsonObject = JSON.parseObject(sData); |
| | | String message = jsonObject.getString("Message"); |
| | | if(!"OK".equals(message)){ |
| | | return ResultUtil.error(""); |
| | | } |
| | | |
| | | SMSUtil.send(phone, "您的验证码:" + authCode + ",您正在进行身份验证,请勿泄露于他人!", "2431012312847"); |
| | | // String sData = aLiSendSms.sendSms(phone, templateCode, "{\"code\":\"" + authCode + "\"}"); |
| | | // JSONObject jsonObject = JSON.parseObject(sData); |
| | | // String message = jsonObject.getString("Message"); |
| | | // if(!"OK".equals(message)){ |
| | | // return ResultUtil.error(""); |
| | | // } |
| | | System.out.println(sms); |
| | | // MsgUtil.Send_Post(phone, authCode); |
| | | return ResultUtil.success(); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/4/30 12:10 |
| | | */ |
| | | @Slf4j |
| | | public class SMSUtil { |
| | | //企业编号 |
| | | private static final String SpCode = "277952"; |
| | | //用户名 |
| | | private static final String LoginName = "xn95128"; |
| | | //接口秘钥 |
| | | private static final String Password = "fadfe94036a41b873150e3e6726236f1"; |
| | | |
| | | |
| | | /** |
| | | * 发送短信 |
| | | * @param UserNumber |
| | | * @param MessageContent |
| | | * @param templateId |
| | | */ |
| | | public static void send(String UserNumber, String MessageContent, String templateId){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String url = "https://api.ums86.com:9600/sms/Api/Send.do"; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.header("accept", "application/x-www-form-urlencoded"); |
| | | post.charset("GBK"); |
| | | post.form("SpCode", SpCode); |
| | | post.form("LoginName", LoginName); |
| | | post.form("Password", Password); |
| | | post.form("MessageContent", MessageContent); |
| | | post.form("UserNumber", UserNumber); |
| | | post.form("templateId", templateId); |
| | | post.form("SerialNumber", sdf.format(new Date())); |
| | | post.form("f", "1"); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(status != 200){ |
| | | log.error("短信发送失败:{}", execute.body()); |
| | | return; |
| | | } |
| | | String body = execute.body(); |
| | | String[] split = body.split("&"); |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (String s : split) { |
| | | String[] split1 = s.split("="); |
| | | String k = split1[0]; |
| | | String v = null; |
| | | if(split1.length == 2){ |
| | | v = s.split("=")[1]; |
| | | } |
| | | map.put(k, v); |
| | | } |
| | | String result = map.get("result"); |
| | | if(!"0".equals(result)){ |
| | | log.error("短信发送失败:{}", map.get("description")); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | send("15828353127", "您的验证码:1255,您正在进行身份验证,请勿泄露于他人!", "2431012312847"); |
| | | } |
| | | } |
| | |
| | | driverService.updateById(driver); |
| | | Car car = carService.selectById(driver.getCarId()); |
| | | // String s = MsgUtil.SendDriverPost(orderTaxi.getPassengersPhone(), car.getCarLicensePlate(),driver.getName(), driver.getPhone()); |
| | | String s = aLiSendSms.sendSms(orderTaxi.getPassengersPhone(), "SMS_476900230", "{\"code1\":\"" + driver.getName() + "\",\"code2\":\"" + driver.getPhone() + "\",\"code3\":\"" +car.getCarLicensePlate() + "\"}"); |
| | | System.err.println("====电话回调==="+s); |
| | | |
| | | // String s = aLiSendSms.sendSms(orderTaxi.getPassengersPhone(), "SMS_476900230", "{\"code1\":\"" + driver.getName() + "\",\"code2\":\"" + driver.getPhone() + "\",\"code3\":\"" +car.getCarLicensePlate() + "\"}"); |
| | | // System.err.println("====电话回调==="+s); |
| | | SMSUtil.send(orderTaxi.getPassengersPhone(), "您的订单已被司机" + driver.getName() + "接单,联系电话" + driver.getPhone() + "车牌号" + car.getCarLicensePlate() + "请耐心等待。", "2431012312845"); |
| | | } |
| | | |
| | | //调用移动的小号接口 |
| | |
| | | //发送短信 |
| | | try{ |
| | | UserInfo userInfo = userInfoMapper.selectById(orderTaxi.getUserId()); |
| | | String sData = aLiSendSms.sendSms(userInfo.getPhone(), "SMS_476900230", "{\"code1\":\"" + driver.getName() + "\",\"code2\":\"" + driver.getPhone() + "\",\"code3\":\"" +carService.selectById(orderTaxi.getCarId()) .getCarLicensePlate() + "\"}"); |
| | | Car car = carService.selectById(orderTaxi.getCarId()); |
| | | // String sData = aLiSendSms.sendSms(userInfo.getPhone(), "SMS_476900230", "{\"code1\":\"" + driver.getName() + "\",\"code2\":\"" + driver.getPhone() + "\",\"code3\":\"" + car.getCarLicensePlate() + "\"}"); |
| | | SMSUtil.send(userInfo.getPhone(), "您的订单已被司机" + driver.getName() + "接单,联系电话" + driver.getPhone() + "车牌号" + car.getCarLicensePlate() + "请耐心等待。", "2431012312845"); |
| | | |
| | | }catch (Exception e){ |
| | | |
| | |
| | | //发送短信 |
| | | try{ |
| | | UserInfo userInfo = userInfoMapper.selectById(orderTaxi.getUserId()); |
| | | String sData = aLiSendSms.sendSms(userInfo.getPhone(), "SMS_476900230", "{\"code1\":\"" + driver.getName() + "\",\"code2\":\"" + driver.getPhone() + "\",\"code3\":\"" +carService.selectById(orderTaxi.getCarId()) .getCarLicensePlate() + "\"}"); |
| | | Car car = carService.selectById(orderTaxi.getCarId()); |
| | | // String sData = aLiSendSms.sendSms(userInfo.getPhone(), "SMS_476900230", "{\"code1\":\"" + driver.getName() + "\",\"code2\":\"" + driver.getPhone() + "\",\"code3\":\"" + car.getCarLicensePlate() + "\"}"); |
| | | SMSUtil.send(userInfo.getPhone(), "您的订单已被司机" + driver.getName() + "接单,联系电话" + driver.getPhone() + "车牌号" + car.getCarLicensePlate() + "请耐心等待。", "2431012312845"); |
| | | |
| | | }catch (Exception e){ |
| | | |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TComplaint; |
| | | import com.stylefeng.guns.modular.system.model.TPubWithdrawal; |
| | | import com.stylefeng.guns.modular.system.model.TSystemNotice; |
| | | import com.stylefeng.guns.modular.system.model.TWithdrawal; |
| | | import com.stylefeng.guns.modular.system.service.ITPubWithdrawalService; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.ITWithdrawalService; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TPubWithdrawal; |
| | | import com.stylefeng.guns.modular.system.service.ITPubWithdrawalService; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | @RequestMapping("/tPubWithdrawal") |
| | | public class TPubWithdrawalController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tPubWithdrawal/"; |
| | | private String PREFIX = "/system/tWithdrawal/"; |
| | | |
| | | @Autowired |
| | | private ITPubWithdrawalService tPubWithdrawalService; |
| | |
| | | |
| | | @Autowired |
| | | private ITSystemNoticeService tSystemNoticeService; |
| | | @Autowired |
| | | private ITWithdrawalService withdrawalService; |
| | | |
| | | /** |
| | | * 跳转到提现列表首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tPubWithdrawal.html"; |
| | | return PREFIX + "tWithdrawal.html"; |
| | | } |
| | | |
| | | /** |
| | |
| | | model.addAttribute("str",str); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | @Autowired |
| | | private ITWithdrawalService withdrawalService; |
| | | |
| | | /** |
| | | * 跳转到立即处理页面 |
| | | */ |
| | |
| | | templateCode = "SMS_482775061";//修改密码 |
| | | break; |
| | | } |
| | | String sData = aLiSendSms.sendSms(phone, templateCode, "{\"code\":\"" + authCode + "\"}"); |
| | | JSONObject jsonObject = JSON.parseObject(sData); |
| | | String message = jsonObject.getString("Message"); |
| | | if(!"OK".equals(message)){ |
| | | System.err.println(message); |
| | | return ResultUtil.error(message); |
| | | } |
| | | // String sData = aLiSendSms.sendSms(phone, templateCode, "{\"code\":\"" + authCode + "\"}"); |
| | | SMSUtil.send(phone, "您的验证码:" + authCode + ",您正在进行身份验证,请勿泄露于他人!", "2431012312847"); |
| | | // JSONObject jsonObject = JSON.parseObject(sData); |
| | | // String message = jsonObject.getString("Message"); |
| | | // if(!"OK".equals(message)){ |
| | | // System.err.println(message); |
| | | // return ResultUtil.error(message); |
| | | // } |
| | | System.out.println(sms); |
| | | return ResultUtil.success(); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/4/30 12:10 |
| | | */ |
| | | @Slf4j |
| | | public class SMSUtil { |
| | | //企业编号 |
| | | private static final String SpCode = "277952"; |
| | | //用户名 |
| | | private static final String LoginName = "xn95128"; |
| | | //接口秘钥 |
| | | private static final String Password = "fadfe94036a41b873150e3e6726236f1"; |
| | | |
| | | |
| | | /** |
| | | * 发送短信 |
| | | * @param UserNumber |
| | | * @param MessageContent |
| | | * @param templateId |
| | | */ |
| | | public static void send(String UserNumber, String MessageContent, String templateId){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String url = "https://api.ums86.com:9600/sms/Api/Send.do"; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | post.header("accept", "application/x-www-form-urlencoded"); |
| | | post.charset("GBK"); |
| | | post.form("SpCode", SpCode); |
| | | post.form("LoginName", LoginName); |
| | | post.form("Password", Password); |
| | | post.form("MessageContent", MessageContent); |
| | | post.form("UserNumber", UserNumber); |
| | | post.form("templateId", templateId); |
| | | post.form("SerialNumber", sdf.format(new Date())); |
| | | post.form("f", "1"); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(status != 200){ |
| | | log.error("短信发送失败:{}", execute.body()); |
| | | return; |
| | | } |
| | | String body = execute.body(); |
| | | String[] split = body.split("&"); |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (String s : split) { |
| | | String[] split1 = s.split("="); |
| | | String k = split1[0]; |
| | | String v = null; |
| | | if(split1.length == 2){ |
| | | v = s.split("=")[1]; |
| | | } |
| | | map.put(k, v); |
| | | } |
| | | String result = map.get("result"); |
| | | if(!"0".equals(result)){ |
| | | log.error("短信发送失败:{}", map.get("description")); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | send("15828353127", "您的验证码:1255,您正在进行身份验证,请勿泄露于他人!", "2431012312847"); |
| | | } |
| | | } |