Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pension
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mengmeng
pension
Commits
45b721e1
Commit
45b721e1
authored
May 17, 2021
by
Shen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 机构移动端派单添加服务人员消息推送
parent
750025ed
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
1 deletion
+35
-1
WechatAccountConfig.java
...api/src/main/java/io/hmit/config/WechatAccountConfig.java
+2
-0
PensionOrderServiceImpl.java
...es/serviceOrder/service/impl/PensionOrderServiceImpl.java
+1
-0
PushMessage.java
hmit-api/src/main/java/io/hmit/service/PushMessage.java
+2
-0
PushMessageImpl.java
...i/src/main/java/io/hmit/service/impl/PushMessageImpl.java
+28
-0
application.yml
hmit-api/src/main/resources/application.yml
+2
-1
No files found.
hmit-api/src/main/java/io/hmit/config/WechatAccountConfig.java
View file @
45b721e1
...
...
@@ -21,4 +21,6 @@ public class WechatAccountConfig {
private
String
templateId
;
private
String
serviceTemplateId
;
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionOrderServiceImpl.java
View file @
45b721e1
...
...
@@ -202,6 +202,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
pensionOrderEntity
.
setOrderRecipientPhone
(
recipient
.
getMobile
());
pensionOrderEntity
.
setOrderRecipientTime
(
new
Date
());
update
(
ConvertUtils
.
sourceToTarget
(
pensionOrderEntity
,
PensionOrderDTO
.
class
));
pushMessage
.
sendServiceWeChatMsg
(
ConvertUtils
.
sourceToTarget
(
pensionOrderEntity
,
PensionOrderDTO
.
class
),
recipient
.
getOpenid
());
}
else
{
return
false
;
}
...
...
hmit-api/src/main/java/io/hmit/service/PushMessage.java
View file @
45b721e1
...
...
@@ -6,6 +6,8 @@ public interface PushMessage {
void
sendWeChatMsg
(
PensionOrderDTO
pensionOrderDTO
,
String
openId
,
String
flag
);
void
sendServiceWeChatMsg
(
PensionOrderDTO
pensionOrderDTO
,
String
openId
);
void
sendSMSMsg
(
PensionOrderDTO
pensionOrderDTO
,
String
receiver
);
}
hmit-api/src/main/java/io/hmit/service/impl/PushMessageImpl.java
View file @
45b721e1
...
...
@@ -69,6 +69,34 @@ public class PushMessageImpl implements PushMessage {
}
}
@Override
public
void
sendServiceWeChatMsg
(
PensionOrderDTO
pensionOrderDTO
,
String
openId
)
{
WxMpTemplateMessage
templateMessage
=
new
WxMpTemplateMessage
();
templateMessage
.
setTemplateId
(
wechatAccountConfig
.
getServiceTemplateId
());
templateMessage
.
setToUser
(
openId
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm"
);
String
appointmentTime
=
sdf
.
format
(
pensionOrderDTO
.
getAppointmentTime
());
List
<
WxMpTemplateData
>
data
=
Arrays
.
asList
(
new
WxMpTemplateData
(
"first"
,
"【智慧养老】您的服务单提醒"
),
new
WxMpTemplateData
(
"keyword1"
,
pensionOrderDTO
.
getAppointmentPerson
()
+
" - "
+
pensionOrderDTO
.
getAppointmentPhone
()),
new
WxMpTemplateData
(
"keyword2"
,
appointmentTime
),
new
WxMpTemplateData
(
"keyword3"
,
pensionOrderDTO
.
getAddress
()),
new
WxMpTemplateData
(
"keyword4"
,
pensionOrderDTO
.
getServiceName
()),
new
WxMpTemplateData
(
"keyword5"
,
pensionOrderDTO
.
getRemark
()),
new
WxMpTemplateData
(
"remark"
,
"当前状态:"
+
pensionOrderDTO
.
getStatusName
())
);
templateMessage
.
setData
(
data
);
String
url
=
SYSURL
+
"/#/orderDetail/?openid="
+
openId
+
"&id="
+
pensionOrderDTO
.
getId
()+
"&flag=attendant"
;
templateMessage
.
setUrl
(
url
);
try
{
wxMpService
.
getTemplateMsgService
().
sendTemplateMsg
(
templateMessage
);
}
catch
(
WxErrorException
e
){
log
.
error
(
"【微信模板消息】发送失败,{}"
,
e
);
}
}
@Override
public
void
sendSMSMsg
(
PensionOrderDTO
pensionOrderDTO
,
String
receiver
)
{
try
{
...
...
hmit-api/src/main/resources/application.yml
View file @
45b721e1
...
...
@@ -84,3 +84,4 @@ wechat:
mpAppSecret
:
f7b1120a49de078dd1be0080832ad42f
# mpAppSecret: 603d6ebf4db906bdb24eb9a1c0cbb444
templateId
:
gU3gtQxrwX0Z6khAL_9tuwzT83KlXk3oV6jbPNuNHbc
serviceTemplateId
:
xAaQHjjq17i9ONly90rEXfdRj3yPQsjELRmFEUh4idQ
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment