Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 33fd03e7
authored
Mar 23, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
工单标准接口-短信异步修改
1 parent
7c387159
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
src/main/java/cn/com/glsx/stdinterface/modules/service/MessageService.java
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
src/main/java/cn/com/glsx/stdinterface/modules/service/MessageService.java
View file @
33fd03e
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
package
cn
.
com
.
glsx
.
stdinterface
.
modules
.
service
;
import
cn.com.glsx.stdinterface.common.exception.StdInterfaceException
;
import
cn.com.glsx.stdinterface.modules.util.RopHttpUtil
;
import
cn.com.glsx.stdinterface.modules.util.RopHttpUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.context.config.annotation.RefreshScope
;
import
org.springframework.cloud.context.config.annotation.RefreshScope
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
@@ -34,6 +34,7 @@ public class MessageService {
...
@@ -34,6 +34,7 @@ public class MessageService {
* @param type 类型
* @param type 类型
* @param context 发送内容
* @param context 发送内容
*/
*/
@Async
public
void
sendMessage
(
String
phone
,
String
source
,
String
type
,
String
context
)
{
public
void
sendMessage
(
String
phone
,
String
source
,
String
type
,
String
context
)
{
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<>(
4
);
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<>(
4
);
try
{
try
{
...
@@ -46,10 +47,14 @@ public class MessageService {
...
@@ -46,10 +47,14 @@ public class MessageService {
log
.
info
(
"发送短信结果{}"
,
post
);
log
.
info
(
"发送短信结果{}"
,
post
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
info
(
"发送短信异常,{}"
,
e
.
getMessage
());
log
.
error
(
"发送短信到{}异常,{}"
,
phone
,
e
.
getMessage
());
throw
new
StdInterfaceException
(
"4
444444"
,
e
.
getMessage
());
//throw new StdInterfaceException("
444444", e.getMessage());
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
MessageService
messageService
=
new
MessageService
();
messageService
.
sendMessage
(
"18682185876"
,
"eshield_workOrder_warm"
,
"1"
,
"this is a test!"
);
}
}
}
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderService.java
View file @
33fd03e
...
@@ -41,7 +41,6 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -41,7 +41,6 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -1285,7 +1284,6 @@ public class WorkOrderService {
...
@@ -1285,7 +1284,6 @@ public class WorkOrderService {
* @param workOrder
* @param workOrder
* @param vehicle
* @param vehicle
*/
*/
@Async
public
void
finishedNotifyTarget
(
WorkOrder
workOrder
,
Vehicle
vehicle
)
{
public
void
finishedNotifyTarget
(
WorkOrder
workOrder
,
Vehicle
vehicle
)
{
String
receiveNumbers
=
workOrder
.
getNotifyTarget
();
String
receiveNumbers
=
workOrder
.
getNotifyTarget
();
if
(
StringUtils
.
isNullOrEmpty
(
receiveNumbers
))
{
if
(
StringUtils
.
isNullOrEmpty
(
receiveNumbers
))
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment