Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
43e5381e
由
张雷
编写于
2024-12-26 15:28:36 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
短信增加异常处理,会议通知BUG修改
1 个父辈
0e765740
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
21 行增加
和
4 行删除
sk-base-common/src/main/java/com/skua/tool/util/AliSmsUtil.java
sk-module-biz/src/main/java/com/skua/modules/ajh/controller/AjhMeetingSendController.java
sk-base-common/src/main/java/com/skua/tool/util/AliSmsUtil.java
查看文件 @
43e5381
...
...
@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.client.SimpleClientHttpRequestFactory
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
...
...
@@ -22,13 +23,26 @@ import java.util.Map;
@Slf4j
@Service
public
class
AliSmsUtil
{
static
String
url
=
"http://47.104.23.94:8088/
"
;
static
String
URL
=
"http://47.104.23.94:8088/sms/send
"
;
static
String
signName
=
"金控数矿"
;
// 项目id(每个项目独立使用)
static
String
projectId
=
"556a0a9d-5a78-400e-bf10-24fa14a1a925"
;
// 项目accessKey(每个项目独立使用)
static
String
accessKey
=
"9a1832e31135dc5bd72590580dc89943b68554dd8d26af0021af84aae7259773"
;
static
RestTemplate
restTemplate
=
new
RestTemplate
();
// 设置连接超时和读取超时
static
int
connectionTimeout
=
5000
;
static
int
readTimeout
=
5000
;
// 使用 RestTemplate 发送请求
static
RestTemplate
restTemplate
=
createRestTemplate
();
// 创建带有超时设置的 RestTemplate
private
static
RestTemplate
createRestTemplate
()
{
// 设置连接超时和读取超时
SimpleClientHttpRequestFactory
factory
=
new
SimpleClientHttpRequestFactory
();
factory
.
setConnectTimeout
(
connectionTimeout
);
// 设置连接超时
factory
.
setReadTimeout
(
readTimeout
);
// 设置读取超时
return
new
RestTemplate
(
factory
);
}
/**
*
...
...
@@ -49,7 +63,7 @@ public class AliSmsUtil {
requestBody
.
put
(
"sign_name"
,
signName
);
requestBody
.
put
(
"project_id"
,
projectId
);
requestBody
.
put
(
"access_key"
,
accessKey
);
requestEntity
=
RequestEntity
.
post
(
new
URI
(
url
+
"sms/send"
))
requestEntity
=
RequestEntity
.
post
(
new
URI
(
URL
))
.
header
(
"content-type"
,
"application/json"
)
.
body
(
requestBody
,
Map
.
class
);
responseEntity
=
restTemplate
.
exchange
(
requestEntity
,
Map
.
class
);
...
...
@@ -63,7 +77,7 @@ public class AliSmsUtil {
ok
=
false
;
log
.
error
(
String
.
format
(
"阿里短信发送失败 请求=%s 响应=%s"
,
requestEntity
==
null
?
""
:
requestEntity
.
toString
()
,
responseEntity
==
null
?
""
:
responseEntity
.
toString
())
,
e
);
responseEntity
==
null
?
""
:
responseEntity
.
toString
()));
}
return
ok
;
}
...
...
@@ -150,5 +164,6 @@ public class AliSmsUtil {
aliCode
.
setProduct
(
"数字化企业大脑"
);
aliCode
.
setType
(
"login"
);
sendCodeMsg
(
aliCode
);
System
.
out
.
println
(
"==================短信发送完成===================="
);
}
}
...
...
sk-module-biz/src/main/java/com/skua/modules/ajh/controller/AjhMeetingSendController.java
查看文件 @
43e5381
...
...
@@ -133,9 +133,11 @@ public class AjhMeetingSendController {
newList
.
add
(
ajhMeetingSend
);
}
}
if
(
newList
.
size
()
>
0
){
ajhMeetingSendService
.
updateBatchById
(
newList
);
}
}
}
@AutoLog
(
value
=
"会议记录-数量统计"
)
@ApiOperation
(
value
=
"会议记录-数量统计"
,
notes
=
"会议记录-数量统计"
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论