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
0635c06f
Commit
0635c06f
authored
Aug 15, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
Dev See merge request
!16
parents
03ea93ae
02908591
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
0 deletions
+34
-0
SysUserBizMapper.xml
admin/src/main/resources/mapper/sys/sys/SysUserBizMapper.xml
+1
-0
CommonSmsService.java
...va/com/onsiteservice/common/service/CommonSmsService.java
+26
-0
SmsUtils.java
...src/main/java/com/onsiteservice/util/aliyun/SmsUtils.java
+4
-0
application-third-service-prod.yaml
...nt/src/main/resources/application-third-service-prod.yaml
+1
-0
application-third-service.yaml
constant/src/main/resources/application-third-service.yaml
+1
-0
ServiceOrderBizService.java
...service/miniapp/service/order/ServiceOrderBizService.java
+1
-0
No files found.
admin/src/main/resources/mapper/sys/sys/SysUserBizMapper.xml
View file @
0635c06f
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
select t1.*
select t1.*
from sys_user t1
from sys_user t1
<where>
<where>
and t1.id != 1
<if
test=
"param.username != null and param.username != ''"
>
<if
test=
"param.username != null and param.username != ''"
>
AND t1.user_name LIKE '%${param.username}%'
AND t1.user_name LIKE '%${param.username}%'
</if>
</if>
...
...
common/src/main/java/com/onsiteservice/common/service/CommonSmsService.java
View file @
0635c06f
...
@@ -2,12 +2,16 @@ package com.onsiteservice.common.service;
...
@@ -2,12 +2,16 @@ package com.onsiteservice.common.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.onsiteservice.common.redis.RedisUtils
;
import
com.onsiteservice.common.redis.RedisUtils
;
import
com.onsiteservice.constant.enums.ServiceUserTypeEnum
;
import
com.onsiteservice.dao.mapper.user.UserMapper
;
import
com.onsiteservice.entity.user.User
;
import
com.onsiteservice.util.aliyun.SmsUtils
;
import
com.onsiteservice.util.aliyun.SmsUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Condition
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -44,6 +48,9 @@ public class CommonSmsService {
...
@@ -44,6 +48,9 @@ public class CommonSmsService {
@Value
(
"${aliyun.sms.template-code.revaluator}"
)
@Value
(
"${aliyun.sms.template-code.revaluator}"
)
private
String
revaluatorTmpCode
;
// 通知客户已重新指派估价员
private
String
revaluatorTmpCode
;
// 通知客户已重新指派估价员
@Value
(
"${aliyun.sms.template-code.submit}"
)
private
String
submitOrderTmpCode
;
@Value
(
"${aliyun.sms.sign}"
)
@Value
(
"${aliyun.sms.sign}"
)
private
String
sign
;
private
String
sign
;
...
@@ -52,6 +59,9 @@ public class CommonSmsService {
...
@@ -52,6 +59,9 @@ public class CommonSmsService {
@Resource
@Resource
private
RedisUtils
redisUtil
;
private
RedisUtils
redisUtil
;
@Resource
private
UserMapper
userMapper
;
/***
/***
* 禁用短信方法
* 禁用短信方法
*/
*/
...
@@ -140,4 +150,20 @@ public class CommonSmsService {
...
@@ -140,4 +150,20 @@ public class CommonSmsService {
}
}
}
}
public
void
submit
(
String
serviceName
)
{
Condition
userCondition
=
new
Condition
(
User
.
class
);
userCondition
.
createCriteria
().
andEqualTo
(
"roleType"
,
ServiceUserTypeEnum
.
ADMIN
.
getId
())
.
andIsNotNull
(
"phone"
);
var
userList
=
userMapper
.
selectByCondition
(
userCondition
);
if
(
userList
.
isEmpty
())
{
return
;
}
String
[]
phones
=
userList
.
stream
().
map
(
User:
:
getPhone
).
toArray
(
String
[]::
new
);
try
{
smsUtils
.
send
(
sign
,
submitOrderTmpCode
,
JSONObject
.
toJSONString
(
Map
.
of
(
"name"
,
serviceName
)),
phones
);
}
catch
(
Exception
e
)
{
log
.
error
(
"发送短信错误"
,
e
);
}
}
}
}
common/src/main/java/com/onsiteservice/util/aliyun/SmsUtils.java
View file @
0635c06f
...
@@ -44,6 +44,10 @@ public class SmsUtils {
...
@@ -44,6 +44,10 @@ public class SmsUtils {
*/
*/
@Async
// 如果在mq里就不需要再异步线程了否则响应数据返回时间不确定
@Async
// 如果在mq里就不需要再异步线程了否则响应数据返回时间不确定
public
String
send
(
String
sign
,
String
templateCode
,
String
templateParam
,
String
...
phoneNums
)
throws
ClientException
{
public
String
send
(
String
sign
,
String
templateCode
,
String
templateParam
,
String
...
phoneNums
)
throws
ClientException
{
return
sendSync
(
sign
,
templateCode
,
templateParam
,
phoneNums
);
}
public
String
sendSync
(
String
sign
,
String
templateCode
,
String
templateParam
,
String
...
phoneNums
)
throws
ClientException
{
if
(
phoneNums
.
length
>
1000
)
{
if
(
phoneNums
.
length
>
1000
)
{
return
"最大发送数量不能超过1000"
;
return
"最大发送数量不能超过1000"
;
}
}
...
...
constant/src/main/resources/application-third-service-prod.yaml
View file @
0635c06f
...
@@ -25,4 +25,5 @@ aliyun:
...
@@ -25,4 +25,5 @@ aliyun:
paid
:
SMS_247560593
# 通知业务人员客户已完成支付
paid
:
SMS_247560593
# 通知业务人员客户已完成支付
valuator
:
SMS_247605613
# 通知客户已派估价员
valuator
:
SMS_247605613
# 通知客户已派估价员
revaluator
:
SMS_247620558
# 通知客户已重新指派估价员
revaluator
:
SMS_247620558
# 通知客户已重新指派估价员
submit
:
SMS_248815347
# 下单
constant/src/main/resources/application-third-service.yaml
View file @
0635c06f
...
@@ -25,6 +25,7 @@ aliyun:
...
@@ -25,6 +25,7 @@ aliyun:
paid
:
SMS_226505027
# 通知业务人员客户已完成支付 开发环境使用优惠券发放替代
paid
:
SMS_226505027
# 通知业务人员客户已完成支付 开发环境使用优惠券发放替代
valuator
:
SMS_226505027
# 通知客户已派估价员 开发环境使用优惠券发放替代
valuator
:
SMS_226505027
# 通知客户已派估价员 开发环境使用优惠券发放替代
revaluator
:
SMS_226505027
# 通知客户已重新指派估价员 开发环境使用优惠券发放替代
revaluator
:
SMS_226505027
# 通知客户已重新指派估价员 开发环境使用优惠券发放替代
submit
:
SMS_226505027
# 客户下单
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/service/order/ServiceOrderBizService.java
View file @
0635c06f
...
@@ -222,6 +222,7 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
...
@@ -222,6 +222,7 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
// 记录流程
// 记录流程
if
(
result
==
1
)
{
if
(
result
==
1
)
{
recordComponent
.
recordProcess
(
serviceOrder
.
getId
(),
ServiceOrderStatusEnum
.
RESERVE
.
getStatus
(),
ServiceOrderStatusEnum
.
RESERVE
.
getMsg
(),
sourceEnum
,
null
,
null
,
null
);
recordComponent
.
recordProcess
(
serviceOrder
.
getId
(),
ServiceOrderStatusEnum
.
RESERVE
.
getStatus
(),
ServiceOrderStatusEnum
.
RESERVE
.
getMsg
(),
sourceEnum
,
null
,
null
,
null
);
commonSmsService
.
submit
(
serviceOrder
.
getServiceName
());
}
}
return
result
;
return
result
;
...
...
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