Merge remote-tracking branch 'origin/master'
New file |
| | |
| | | package com.ruoyi.account.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "发送短信dto类") |
| | | public class SendMessageDTO implements Serializable { |
| | | |
| | | private String phone; |
| | | private String code; |
| | | private String site; |
| | | private String chargeGun; |
| | | private Integer type;// 1 codeMsg 2 applyCodeMsg 3 faultMsg |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.api.factory; |
| | | |
| | | import com.ruoyi.account.api.dto.GiveVipDto; |
| | | import com.ruoyi.account.api.dto.SendMessageDTO; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppCoupon; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | |
| | | public R<String> getWXToken() { |
| | | return R.fail("获取微信token失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<Boolean> sensitiveWordDetection(String content, String openid) { |
| | | return R.fail("敏感词校验失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> sendMessage(SendMessageDTO sendMessageDTO) { |
| | | return R.fail("短信发送失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | }; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.account.api.feignClient; |
| | | |
| | | import com.ruoyi.account.api.dto.GiveVipDto; |
| | | import com.ruoyi.account.api.dto.SendMessageDTO; |
| | | import com.ruoyi.account.api.model.TAppCoupon; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | |
| | | */ |
| | | @PostMapping("/wxLogin/getWXToken") |
| | | R<String> getWXToken(); |
| | | |
| | | |
| | | /** |
| | | * 敏感词检测 |
| | | * @param content |
| | |
| | | */ |
| | | @PostMapping("/wxLogin/sensitiveWordDetection") |
| | | R<Boolean> sensitiveWordDetection (@RequestParam("content") String content, @RequestParam("openid") String openid); |
| | | |
| | | /** |
| | | * 短信发送 |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-app-user/sendMessage") |
| | | R<String> sendMessage(@RequestBody SendMessageDTO sendMessageDTO); |
| | | } |
| | |
| | | import com.ruoyi.account.util.carBrand.CarBrandUtil; |
| | | import com.ruoyi.account.wx.model.WeixinProperties; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.MsgConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.PointChangeDto; |
| | | import com.ruoyi.common.core.enums.status.AppUserStatusEnum; |
| | | import com.ruoyi.common.core.utils.JwtUtils; |
| | | import com.ruoyi.common.core.utils.OrderCodeUtil; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.*; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.domain.BasePojo; |
| | |
| | | appUserService.updateById(appUser); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/sendMessage") |
| | | public R<String> sendMessage(@RequestBody SendMessageDTO sendMessageDTO){ |
| | | switch (sendMessageDTO.getType()){ |
| | | case 1: |
| | | String reqStr1 = MsgUtil.codeMsg(sendMessageDTO.getPhone(), sendMessageDTO.getCode()); |
| | | String result1 = HttpUtils.post(MsgConstants.SEND_URL, reqStr1); |
| | | return R.ok(result1); |
| | | case 2: |
| | | String reqStr2 = MsgUtil.applyCodeMsg(sendMessageDTO.getPhone(), sendMessageDTO.getCode()); |
| | | String result2 = HttpUtils.post(MsgConstants.SEND_URL, reqStr2); |
| | | return R.ok(result2); |
| | | default: |
| | | String reqStr3 = MsgUtil.faultMsg(sendMessageDTO.getPhone(), sendMessageDTO.getSite(), sendMessageDTO.getChargeGun()); |
| | | String result3 = HttpUtils.post(MsgConstants.SEND_URL, reqStr3); |
| | | return R.ok(result3); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | import com.ruoyi.account.api.dto.SendMessageDTO; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | |
| | | } |
| | | String code = MsgUtil.createCode(); |
| | | redisService.setCacheObject(phone+ Constants.UPDATE_PHONE,code,5L, TimeUnit.MINUTES); |
| | | String reqStr = MsgUtil.codeMsg(phone, code); |
| | | String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setPhone(phone); |
| | | sendMessageDTO.setCode(code); |
| | | sendMessageDTO.setType(1); |
| | | String result = appUserClient.sendMessage(sendMessageDTO).getData(); |
| | | // String reqStr = MsgUtil.codeMsg(phone, code); |
| | | // String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | // 记录短信发送 |
| | | chargingPileNotificationService.saveData(1,-1,-1,phone,"验证码:"+code+",用于更换手机号。请勿转发。"); |
| | | return AjaxResult.success(result); |
| | |
| | | { |
| | | String code = MsgUtil.createCode(); |
| | | redisService.setCacheObject(phone+ Constants.APPLY_CHARGING,code,5L, TimeUnit.MINUTES); |
| | | String reqStr = MsgUtil.applyCodeMsg(phone, code); |
| | | String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setPhone(phone); |
| | | sendMessageDTO.setCode(code); |
| | | sendMessageDTO.setType(2); |
| | | String result = appUserClient.sendMessage(sendMessageDTO).getData(); |
| | | // String reqStr = MsgUtil.applyCodeMsg(phone, code); |
| | | // String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | // 记录短信发送 |
| | | chargingPileNotificationService.saveData(1,-1,-1,phone,"验证码:"+code+",用于申请建桩。请勿转发。"); |
| | | return AjaxResult.success(result); |
| | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.dto.SendMessageDTO; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.PartnerClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | |
| | | |
| | | @Resource |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Override |
| | | public void add(TFaultMessage dto) { |
| | |
| | | Site site = siteService.getById(dto.getSiteId()); |
| | | TChargingPile chargingPile = chargingPileService.getById(dto.getChargingPileId()); |
| | | String siteName = site.getName(); |
| | | String reqStr = MsgUtil.faultMsg(site.getPhone(), site.getName(), chargingPile.getNumber() + ""); |
| | | String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | // String reqStr = MsgUtil.faultMsg(site.getPhone(), site.getName(), chargingPile.getNumber() + ""); |
| | | // String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setPhone(site.getPhone()); |
| | | sendMessageDTO.setCode(site.getName()); |
| | | sendMessageDTO.setChargeGun(chargingPile.getNumber() + ""); |
| | | sendMessageDTO.setType(3); |
| | | String result = appUserClient.sendMessage(sendMessageDTO).getData(); |
| | | log.info("故障短信提醒:{}",result); |
| | | if(siteName.length()>10){ |
| | | siteName = siteName.substring(0,10); |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.dto.SendMessageDTO; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | |
| | | |
| | | @Resource |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | Site site = siteService.getById(dto.getSiteId()); |
| | | TChargingPile chargingPile = chargingPileService.getById(dto.getChargingPileId()); |
| | | String siteName = site.getName(); |
| | | String reqStr = MsgUtil.faultMsg(site.getPhone(), site.getName(), chargingPile.getNumber() + ""); |
| | | String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | // String reqStr = MsgUtil.faultMsg(site.getPhone(), site.getName(), chargingPile.getNumber() + ""); |
| | | // String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setPhone(site.getPhone()); |
| | | sendMessageDTO.setCode(site.getName()); |
| | | sendMessageDTO.setChargeGun(chargingPile.getNumber() + ""); |
| | | sendMessageDTO.setType(3); |
| | | String result = appUserClient.sendMessage(sendMessageDTO).getData(); |
| | | log.info("故障短信提醒:{}",result); |
| | | if(siteName.length()>10){ |
| | | siteName = siteName.substring(0,10); |