diff --git a/ruoyi-modules/ruoyi-mp/src/main/java/org/dromara/mp/service/impl/SysUnitDomainServiceImpl.java b/ruoyi-modules/ruoyi-mp/src/main/java/org/dromara/mp/service/impl/SysUnitDomainServiceImpl.java index e462f04..8f87958 100644 --- a/ruoyi-modules/ruoyi-mp/src/main/java/org/dromara/mp/service/impl/SysUnitDomainServiceImpl.java +++ b/ruoyi-modules/ruoyi-mp/src/main/java/org/dromara/mp/service/impl/SysUnitDomainServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.mp.service.impl; import cn.hutool.core.util.RandomUtil; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -94,7 +95,7 @@ public class SysUnitDomainServiceImpl implements ISysUnitDomainService { map.put("code", code); map.put("expirs","2"); Map map1 = new HashMap<>(); - map1.put("smsConfig", smsConfig.getSmsConfig()); + String smsConfig1 = smsConfig.getSmsConfig(); // smsConfig.put("tempId","temp_dlyzm"); this.smsService.sendSmsCode(SmsType.MP,phone,map,map1); diff --git a/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/channel/service/impl/BusChannelServiceImpl.java b/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/channel/service/impl/BusChannelServiceImpl.java index 0bdcd74..786d13f 100644 --- a/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/channel/service/impl/BusChannelServiceImpl.java +++ b/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/channel/service/impl/BusChannelServiceImpl.java @@ -40,6 +40,8 @@ import org.dromara.system.api.RemoteUserService; import org.dromara.system.api.domain.bo.RemoteUserBo; import org.dromara.system.api.domain.vo.RemoteDictDataVo; import org.dromara.system.api.model.LoginUser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.dao.DuplicateKeyException; import org.springframework.stereotype.Service; import org.dromara.payment.channel.domain.bo.BusChannelBo; @@ -62,6 +64,7 @@ import java.util.*; @Service public class BusChannelServiceImpl extends BaseService implements IBusChannelService { + private static final Logger log = LoggerFactory.getLogger(BusChannelServiceImpl.class); private final BusChannelMapper baseMapper; private final BusMerchantMapper busMerchantMapper; @@ -479,13 +482,15 @@ public class BusChannelServiceImpl extends BaseService implements IBusChannelSer remoteUserBo.setPhonenumber(bcv.getWtrSjh()); remoteUserBo.setCreateBy(LoginHelper.getUserId()); remoteUserBo.setUserName("B"+StringUtils.randmNumber(5)); - String pwd = StringUtils.randmNumber(6); + String pwd = RandomUtil.randomNumbers(4); remoteUserBo.setPassword(BCrypt.hashpw(pwd)); this.addBusUser(remoteUserBo); LinkedHashMap smsMap = new LinkedHashMap(); - smsMap.put("type",BusRole.AGENT.getName()); - smsMap.put("name",remoteUserBo.getUserName()); - smsMap.put("pwd",pwd); +// smsMap.put("type",BusRole.AGENT.getName()); +// smsMap.put("name",remoteUserBo.getUserName()); +// smsMap.put("pwd",pwd); + smsMap.put("code",BusRole.MERCHANT.getName()+","+remoteUserBo.getUserName()+","+pwd); + log.info("短信发送参数:{}",smsMap+"!!!!!!!!!!!!!!!!!!!!!!!!!"); this.remoteSmsService.send(domain,remoteUserBo.getPhonenumber(),SmsType.UNIT_OPEN,smsMap); } diff --git a/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/merchant/service/impl/BusMerchantServiceImpl.java b/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/merchant/service/impl/BusMerchantServiceImpl.java index 9602ea2..98989f2 100644 --- a/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/merchant/service/impl/BusMerchantServiceImpl.java +++ b/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/merchant/service/impl/BusMerchantServiceImpl.java @@ -373,9 +373,10 @@ public class BusMerchantServiceImpl extends BaseService implements IBusMerchantS remoteUserBo.setPassword(BCrypt.hashpw(pwd)); this.addBusUser(remoteUserBo); LinkedHashMap smsMap = new LinkedHashMap(); - smsMap.put("type",BusRole.MERCHANT.getName()); - smsMap.put("name",remoteUserBo.getUserName()); - smsMap.put("pwd",pwd); +// smsMap.put("type",BusRole.MERCHANT.getName()); +// smsMap.put("name",remoteUserBo.getUserName()); +// smsMap.put("pwd",pwd); + smsMap.put("code",BusRole.MERCHANT.getName()+","+remoteUserBo.getUserName()+","+pwd); this.remoteSmsService.send(domain,remoteUserBo.getPhonenumber(), SmsType.UNIT_OPEN,smsMap); } diff --git a/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/operator/service/impl/BusOperatorServiceImpl.java b/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/operator/service/impl/BusOperatorServiceImpl.java index 878daf2..5733273 100644 --- a/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/operator/service/impl/BusOperatorServiceImpl.java +++ b/ruoyi-modules/ruoyi-payment/src/main/java/org/dromara/payment/operator/service/impl/BusOperatorServiceImpl.java @@ -167,9 +167,10 @@ public class BusOperatorServiceImpl implements IBusOperatorService { LinkedHashMap smsMap = new LinkedHashMap(); - smsMap.put("type",BusRole.OPERATOR.getName()); - smsMap.put("name",remoteUserBo.getUserName()); - smsMap.put("pwd",pwd); +// smsMap.put("type",BusRole.OPERATOR.getName()); +// smsMap.put("name",remoteUserBo.getUserName()); +// smsMap.put("pwd",pwd); + smsMap.put("code",BusRole.OPERATOR.getName()+","+remoteUserBo.getUserName()+","+pwd); this.remoteSmsService.send(bo.getDomain(),remoteUserBo.getPhonenumber(), SmsType.UNIT_OPEN,smsMap); return flag; } diff --git a/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/dubbo/RemoteSmsServiceImpl.java b/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/dubbo/RemoteSmsServiceImpl.java index 4aefcdc..fcb00e4 100644 --- a/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/dubbo/RemoteSmsServiceImpl.java +++ b/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/dubbo/RemoteSmsServiceImpl.java @@ -95,8 +95,9 @@ public class RemoteSmsServiceImpl implements RemoteSmsService { } JSONObject smsConfig = JSONObject.parseObject(site.getSmsConfig()); + smsConfig.put("verification",smsConfig.get(smsType.getTempId())); - DMSmsResult result = this.dmSmsUtils.verificationCode(site.getSmsConfig(), phone, param.get("code")); + DMSmsResult result = this.dmSmsUtils.verificationCode(smsConfig.toJSONString(), phone, param.get("code")); if(!result.isSuccess()){ log.error("{}-{}验证码短信发送异常 => {}",smsType.getDesc(),phone, result.getErrorMsg()); } @@ -132,7 +133,7 @@ public class RemoteSmsServiceImpl implements RemoteSmsService { smsEntity.setVTempId(smsType.getTempId()); smsEntity.setDtmSendTime(currentDate); smsEntity.setVType(smsType.getDesc()); - String msg = smsConfig.getString("templateContent"); + String msg = smsConfig.getString(smsType.getTempId()+"_txt"); if(StringUtils.isNotBlank(msg)){ Iterator paramIter = param.entrySet().iterator(); int paramIndex = 1; diff --git a/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/service/impl/SysSmsServiceImpl.java b/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/service/impl/SysSmsServiceImpl.java index 7993149..81a883c 100644 --- a/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/service/impl/SysSmsServiceImpl.java +++ b/ruoyi-modules/ruoyi-resource/src/main/java/org/dromara/resource/service/impl/SysSmsServiceImpl.java @@ -220,8 +220,8 @@ public class SysSmsServiceImpl implements ISysSmsService { // SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, tempId, param); JSONObject jsonObject = JSON.parseObject((String) smsConfig.get("smsConfig")); - - DMSmsResult result = this.dmSmsUtils.verificationCode((String) smsConfig.get("smsConfig"), phonenumber, param.get("code")); + jsonObject.put("verification",smsType.getTempId()); + DMSmsResult result = this.dmSmsUtils.verificationCode(jsonObject.toJSONString(), phonenumber, param.get("code")); if(!result.isSuccess()){ log.error("{}-{}验证码短信发送异常 => {}",smsType.getDesc(),phonenumber, result.getErrorMsg()); } diff --git a/ruoyi-modules/ruoyi-resource/src/main/resources/application.yml b/ruoyi-modules/ruoyi-resource/src/main/resources/application.yml index 5e8d4d5..e15a58e 100644 --- a/ruoyi-modules/ruoyi-resource/src/main/resources/application.yml +++ b/ruoyi-modules/ruoyi-resource/src/main/resources/application.yml @@ -40,35 +40,35 @@ junziqian: AppKey: 2c4399d12cd9ff33 AppSecret: 87d3e6a62c4399d12cd9ff33c01f2d37 -#旦米短信 -danmisms: - base_url: https://openapi.danmi.com/textSMS/sendSMS/V1 - account_sid: 8315b08c67c30decd030fc25d9766fd6 - auth_token: be7e9a3738882ca188d85e9d45823a09 - defalutCode: - - sig: 薪资社 - #验证码 - verification: 1000000008982 - #充值到账 - recharge: 407811 - #退款到账 - refund: 407812 - #发放完成 - giveout: 407813 - #账户余额 - balance: 407814 - #商户入驻 - merchant: 407801 - #代理入驻 - agent: 407809 - #签约提醒 - tosign: 407810 - #充值信息 - rechargeInfo: 461126 - #开票信息 - invoce: 460599 - -ruoyi: - captchaSMS: 1 +##旦米短信 +#danmisms: +# base_url: https://openapi.danmi.com/textSMS/sendSMS/V1 +# account_sid: 8315b08c67c30decd030fc25d9766fd6 +# auth_token: be7e9a3738882ca188d85e9d45823a09 +# defalutCode: +# +# sig: 薪资社 +# #验证码 +# verification: 1000000008982 +# #充值到账 +# recharge: 407811 +# #退款到账 +# refund: 407812 +# #发放完成 +# giveout: 407813 +# #账户余额 +# balance: 407814 +# #商户入驻 +# merchant: 407801 +# #代理入驻 +# agent: 407809 +# #签约提醒 +# tosign: 407810 +# #充值信息 +# rechargeInfo: 461126 +# #开票信息 +# invoce: 460599 +# +#ruoyi: +# captchaSMS: 1