Commit 710b3933 authored by fangxinjiang's avatar fangxinjiang

容联云调整-fxj

parent a710ab4d
......@@ -16,4 +16,6 @@ public class MessageTempleteVo implements Serializable {
String signName;
// 模版编号
String templeteCode;
// 应用AppId
String appId;
}
......@@ -1226,7 +1226,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
t = new String[1][3]; // 创建正确大小的二维数组
t[0]=paramsDetail;
//调用RlySmsUtil的sendBatchSms方法
sendResult = rlySmsUtil.sendBatchSms(phonesArr, templeteVo.getTempleteCode(), t);
sendResult = rlySmsUtil.sendBatchSms(phonesArr, templeteVo.getTempleteCode(), t,templeteVo.getAppId());
handleSmsRes(sendResult, errorList, updatePre, smsEmployee);
}
......@@ -1277,7 +1277,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
t = new String[1][3]; // 创建正确大小的二维数组
t[0]=paramsDetail;
//调用RlySmsUtil的sendBatchSms方法
sendResult = rlySmsUtil.sendBatchSms(phonesArr, templeteVo.getTempleteCode(), t);
sendResult = rlySmsUtil.sendBatchSms(phonesArr, templeteVo.getTempleteCode(), t,templeteVo.getAppId());
handleSmsRes(sendResult, errorList, updatePre, smsEmployee);
}
}
......
......@@ -275,7 +275,8 @@
<select id="selectTempleteVo" resultMap="messageTempleteVoMap">
SELECT
a.model_code,
a.sign_name
a.sign_name,
a.APP_ID
from t_message_templete a
where id = #{id}
</select>
......
......@@ -35,9 +35,10 @@ public class RlySmsUtil {
// 主账号令牌
private String accountToken = "5487aa42bb574b47aca1c785b4e7c018";
// 应用ID
// 应用ID-生产
private String appId = "2c94811c9787a27f019854cd1b532b7e";
/**
* 初始化SDK
*
......@@ -65,10 +66,15 @@ public class RlySmsUtil {
* @param phoneNumber 手机号码
* @param templateId 模板ID
* @param datas 短信参数
* @param appIdTemp 应用ID 有配置的话,则使用配置的appId
* @return 发送结果 true-成功 false-失败
*/
public boolean sendSingleSms(String phoneNumber, String templateId, String[] datas) {
init(accountSId, accountToken, appId);
public boolean sendSingleSms(String phoneNumber, String templateId, String[] datas,String appIdTemp) {
if (Common.isNotNull(appIdTemp)){
init(accountSId, accountToken, appIdTemp);
}else {
init(accountSId, accountToken, appId);
}
HashMap<String, Object> result = sdk.sendTemplateSMS(phoneNumber, templateId, datas);
if ("000000".equals(result.get("statusCode"))) {
......@@ -92,10 +98,15 @@ public class RlySmsUtil {
* @param phoneNumbers 手机号码数组
* @param templateId 模板ID
* @param datas 短信参数
* @param appIdTemp 应用ID 有配置的话,则使用配置的appId
* @return 发送结果 true-成功 false-失败
*/
public HashMap<String, Object> sendBatchSms(String[] phoneNumbers, String templateId, String[][] datas) {
init(accountSId, accountToken, appId);
public HashMap<String, Object> sendBatchSms(String[] phoneNumbers, String templateId, String[][] datas,String appIdTemp) {
if (Common.isNotNull(appIdTemp)){
init(accountSId, accountToken, appIdTemp);
}else {
init(accountSId, accountToken, appId);
}
// 将手机号数组转换为逗号分隔的字符串
StringBuilder phoneNumbersStr = new StringBuilder();
for (int i = 0; i < phoneNumbers.length; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment