Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service
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
external
on-site-service
Commits
56cbc670
Commit
56cbc670
authored
Jul 28, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 指派估价员短信通知
parent
18399a96
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
3 deletions
+38
-3
CommonSmsService.java
...va/com/onsiteservice/common/service/CommonSmsService.java
+29
-1
ServiceOrderService.java
.../com/onsiteservice/service/order/ServiceOrderService.java
+4
-1
application-third-service.yaml
constant/src/main/resources/application-third-service.yaml
+2
-0
UserService.java
...a/com/onsiteservice/miniapp/service/user/UserService.java
+3
-1
No files found.
common/src/main/java/com/onsiteservice/common/service/CommonSmsService.java
View file @
56cbc670
...
@@ -36,6 +36,12 @@ public class CommonSmsService {
...
@@ -36,6 +36,12 @@ public class CommonSmsService {
@Value
(
"${aliyun.sms.template-code.paid}"
)
@Value
(
"${aliyun.sms.template-code.paid}"
)
private
String
paidTmpCode
;
// 手机号换绑
private
String
paidTmpCode
;
// 手机号换绑
@Value
(
"${aliyun.sms.template-code.valuator}"
)
private
String
valuatorTmpCode
;
// 通知客户已派估价员
@Value
(
"${aliyun.sms.template-code.revaluator}"
)
private
String
revaluatorTmpCode
;
// 通知客户已重新指派估价员
@Value
(
"${aliyun.sms.sign}"
)
@Value
(
"${aliyun.sms.sign}"
)
private
String
sign
;
private
String
sign
;
...
@@ -56,7 +62,7 @@ public class CommonSmsService {
...
@@ -56,7 +62,7 @@ public class CommonSmsService {
/***
/***
* 发送改变信息验证码
* 发送改变信息验证码
*/
*/
public
void
sendChange
Info
(
String
code
,
String
phone
)
{
public
void
sendChange
Phone
(
String
code
,
String
phone
)
{
if
(
StringUtils
.
isEmpty
(
phone
))
{
if
(
StringUtils
.
isEmpty
(
phone
))
{
return
;
return
;
}
}
...
@@ -110,4 +116,26 @@ public class CommonSmsService {
...
@@ -110,4 +116,26 @@ public class CommonSmsService {
}
}
}
}
public
void
valuator
(
String
phone
)
{
if
(
StringUtils
.
isEmpty
(
phone
))
{
return
;
}
try
{
smsUtils
.
send
(
sign
,
valuatorTmpCode
,
null
,
phone
);
}
catch
(
Exception
e
)
{
log
.
error
(
"发送短信错误"
,
e
);
}
}
public
void
revaluator
(
String
phone
)
{
if
(
StringUtils
.
isEmpty
(
phone
))
{
return
;
}
try
{
smsUtils
.
send
(
sign
,
revaluatorTmpCode
,
null
,
phone
);
}
catch
(
Exception
e
)
{
log
.
error
(
"发送短信错误"
,
e
);
}
}
}
}
common/src/main/java/com/onsiteservice/service/order/ServiceOrderService.java
View file @
56cbc670
...
@@ -107,6 +107,8 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> {
...
@@ -107,6 +107,8 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> {
if
(
result
==
1
)
{
if
(
result
==
1
)
{
// 记录估价员指派时间
// 记录估价员指派时间
serviceValuatorAssignMapper
.
insertSelective
(
buildServiceValuatorAssign
(
dto
,
userId
));
serviceValuatorAssignMapper
.
insertSelective
(
buildServiceValuatorAssign
(
dto
,
userId
));
// 通知用户
commonSmsService
.
valuator
(
serviceOrder
.
getPhone
());
String
description
=
String
.
format
(
ServiceOrderStatusEnum
.
VALUATION
.
getMsg
(),
user
.
getName
(),
valuatorUser
.
getUserName
());
String
description
=
String
.
format
(
ServiceOrderStatusEnum
.
VALUATION
.
getMsg
(),
user
.
getName
(),
valuatorUser
.
getUserName
());
recordComponent
.
recordProcess
(
serviceOrder
.
getId
(),
ServiceOrderStatusEnum
.
VALUATION
.
getStatus
(),
description
,
recordComponent
.
recordProcess
(
serviceOrder
.
getId
(),
ServiceOrderStatusEnum
.
VALUATION
.
getStatus
(),
description
,
...
@@ -140,7 +142,8 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> {
...
@@ -140,7 +142,8 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> {
disableServiceValuatorAssign
(
serviceOrder
,
userId
,
false
);
disableServiceValuatorAssign
(
serviceOrder
,
userId
,
false
);
// 设置新的估计员世间
// 设置新的估计员世间
serviceValuatorAssignMapper
.
insertSelective
(
buildServiceValuatorAssign
(
dto
,
userId
));
serviceValuatorAssignMapper
.
insertSelective
(
buildServiceValuatorAssign
(
dto
,
userId
));
// 通知用户
commonSmsService
.
revaluator
(
serviceOrder
.
getPhone
());
String
description
=
String
.
format
(
ServiceOrderStatusEnum
.
REVALUATION
.
getMsg
(),
user
.
getName
(),
valuatorUser
.
getUserName
());
String
description
=
String
.
format
(
ServiceOrderStatusEnum
.
REVALUATION
.
getMsg
(),
user
.
getName
(),
valuatorUser
.
getUserName
());
recordComponent
.
recordProcess
(
serviceOrder
.
getId
(),
ServiceOrderStatusEnum
.
REVALUATION
.
getStatus
(),
description
,
recordComponent
.
recordProcess
(
serviceOrder
.
getId
(),
ServiceOrderStatusEnum
.
REVALUATION
.
getStatus
(),
description
,
sourceEnum
,
valuatorUser
.
getId
(),
dto
.
getRemark
(),
dto
.
getExpectArrivalTime
());
sourceEnum
,
valuatorUser
.
getId
(),
dto
.
getRemark
(),
dto
.
getExpectArrivalTime
());
...
...
constant/src/main/resources/application-third-service.yaml
View file @
56cbc670
...
@@ -23,6 +23,8 @@ aliyun:
...
@@ -23,6 +23,8 @@ aliyun:
dispatched
:
SMS_226505027
# 通知用户已经派单 开发环境使用项目动态替代
dispatched
:
SMS_226505027
# 通知用户已经派单 开发环境使用项目动态替代
redispatched
:
SMS_226505027
# 通知用户已经重新派单 开发环境使用项目动态替代
redispatched
:
SMS_226505027
# 通知用户已经重新派单 开发环境使用项目动态替代
paid
:
SMS_226505027
# 通知业务人员客户已完成支付 开发环境使用优惠券发放替代
paid
:
SMS_226505027
# 通知业务人员客户已完成支付 开发环境使用优惠券发放替代
valuator
:
SMS_226505027
# 通知客户已派估价员 开发环境使用优惠券发放替代
revaluator
:
SMS_226505027
# 通知客户已重新指派估价员 开发环境使用优惠券发放替代
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/service/user/UserService.java
View file @
56cbc670
...
@@ -2,6 +2,7 @@ package com.onsiteservice.miniapp.service.user;
...
@@ -2,6 +2,7 @@ package com.onsiteservice.miniapp.service.user;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.onsiteservice.common.runner.InitDataRunner
;
import
com.onsiteservice.common.runner.InitDataRunner
;
import
com.onsiteservice.common.service.CommonSmsService
;
import
com.onsiteservice.constant.constant.Constants
;
import
com.onsiteservice.constant.constant.Constants
;
import
com.onsiteservice.constant.constant.DictConstants
;
import
com.onsiteservice.constant.constant.DictConstants
;
import
com.onsiteservice.constant.constant.RedisKeyConstants
;
import
com.onsiteservice.constant.constant.RedisKeyConstants
;
...
@@ -59,6 +60,7 @@ public class UserService extends AbstractMapper<User> {
...
@@ -59,6 +60,7 @@ public class UserService extends AbstractMapper<User> {
private
ServiceOrderBizMapper
serviceOrderBizMapper
;
private
ServiceOrderBizMapper
serviceOrderBizMapper
;
private
ServiceOrderMapper
serviceOrderMapper
;
private
ServiceOrderMapper
serviceOrderMapper
;
private
ServiceValuatorAssignMapper
serviceValuatorAssignMapper
;
private
ServiceValuatorAssignMapper
serviceValuatorAssignMapper
;
private
CommonSmsService
commonSmsService
;
public
Result
<
String
>
sendCode
(
SendCodeDTO
dto
)
{
public
Result
<
String
>
sendCode
(
SendCodeDTO
dto
)
{
...
@@ -81,7 +83,7 @@ public class UserService extends AbstractMapper<User> {
...
@@ -81,7 +83,7 @@ public class UserService extends AbstractMapper<User> {
// 置入
// 置入
redisTemplate
.
opsForValue
().
set
(
cacheKey
,
value
,
RedisKeyConstants
.
CODE_EXPIRED
,
TimeUnit
.
MILLISECONDS
);
redisTemplate
.
opsForValue
().
set
(
cacheKey
,
value
,
RedisKeyConstants
.
CODE_EXPIRED
,
TimeUnit
.
MILLISECONDS
);
// TODO 发送短信
commonSmsService
.
sendChangePhone
(
code
,
dto
.
getTo
());
return
ResultGenerator
.
success
();
return
ResultGenerator
.
success
();
}
}
...
...
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