修改短信参数

This commit is contained in:
Anlin
2025-07-28 17:18:27 +08:00
parent 2e9b30a257
commit 0f476aa28e
7 changed files with 55 additions and 46 deletions

View File

@ -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<String, String> 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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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());
}

View File

@ -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