Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
59d0abff
Commit
59d0abff
authored
Sep 10, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
6dd926a1
d5c41661
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
11 deletions
+55
-11
SmsService.java
.../java/com/xxfc/platform/universal/service/SmsService.java
+52
-11
CompanyBaseBiz.java
...in/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
+3
-0
No files found.
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/SmsService.java
View file @
59d0abff
...
@@ -16,6 +16,9 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -16,6 +16,9 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
@Service
@Service
@Slf4j
@Slf4j
...
@@ -196,12 +199,23 @@ public class SmsService {
...
@@ -196,12 +199,23 @@ public class SmsService {
JSONObject
jsonParams
=
new
JSONObject
();
JSONObject
jsonParams
=
new
JSONObject
();
for
(
int
i
=
0
;
i
<
params
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
params
.
length
;
i
++){
String
para
=
params
[
i
];
String
para
=
params
[
i
];
if
(
para
.
contains
(
"【"
)){
if
(
StringUtils
.
isNotBlank
(
para
)){
para
=
para
.
replaceAll
(
"【"
,
""
);
if
(
para
.
contains
(
"【"
)){
}
para
=
para
.
replaceAll
(
"【"
,
""
);
if
(
para
.
contains
(
"】"
)){
}
para
=
para
.
replaceAll
(
"】"
,
""
);
if
(
para
.
contains
(
"】"
)){
para
=
para
.
replaceAll
(
"】"
,
""
);
}
if
(
para
.
length
()>
20
){
if
(
isNumeric
(
para
)){
para
.
substring
(
0
,
20
);
}
else
{
para
=
para
.
substring
(
0
,
18
);
para
+=
".."
;
}
}
}
}
jsonParams
.
put
(
param
+(
i
+
1
),
para
);
jsonParams
.
put
(
param
+(
i
+
1
),
para
);
}
}
sendTemplate
(
PhoneNumbers
,
jsonParams
.
toJSONString
(),
templateCode
);
sendTemplate
(
PhoneNumbers
,
jsonParams
.
toJSONString
(),
templateCode
);
...
@@ -216,12 +230,24 @@ public class SmsService {
...
@@ -216,12 +230,24 @@ public class SmsService {
JSONObject
jsonParams
=
new
JSONObject
();
JSONObject
jsonParams
=
new
JSONObject
();
for
(
int
i
=
0
;
i
<
params
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
params
.
length
;
i
++){
String
para
=
params
[
i
];
String
para
=
params
[
i
];
if
(
para
.
contains
(
"【"
)){
if
(
StringUtils
.
isNotBlank
(
para
)){
para
=
para
.
replaceAll
(
"【"
,
""
);
if
(
para
.
contains
(
"【"
)){
}
para
=
para
.
replaceAll
(
"【"
,
""
);
if
(
para
.
contains
(
"】"
)){
}
para
=
para
.
replaceAll
(
"】"
,
""
);
if
(
para
.
contains
(
"】"
)){
para
=
para
.
replaceAll
(
"】"
,
""
);
}
if
(
para
.
length
()>
20
){
if
(
isNumeric
(
para
)){
para
.
substring
(
0
,
20
);
}
else
{
para
=
para
.
substring
(
0
,
18
);
para
+=
".."
;
}
}
}
}
if
(
i
>
3
){
if
(
i
>
3
){
jsonParams
.
put
(
param
+(
i
+
2
),
para
);
jsonParams
.
put
(
param
+(
i
+
2
),
para
);
}
else
{
}
else
{
...
@@ -236,11 +262,26 @@ public class SmsService {
...
@@ -236,11 +262,26 @@ public class SmsService {
}
}
/**
* 是否是数字
* @param str
* @return
*/
public
static
boolean
isNumeric
(
String
str
){
Pattern
pattern
=
Pattern
.
compile
(
"[0-9]*"
);
Matcher
isNum
=
pattern
.
matcher
(
str
);
if
(
!
isNum
.
matches
()
){
return
false
;
}
return
true
;
}
public
static
void
main
(
String
[]
args
)
throws
ClientException
,
InterruptedException
{
public
static
void
main
(
String
[]
args
)
throws
ClientException
,
InterruptedException
{
SmsService
smsService
=
new
SmsService
();
SmsService
smsService
=
new
SmsService
();
//发短信
//发短信
String
[]
params
={
"1"
,
"2"
,
"3"
,
"2019-08-29"
,
"【松山湖】"
};
String
[]
params
={
"1"
,
"2"
,
"3"
,
"2019-08-29"
,
"【松山湖】"
};
SmsService
.
sendTemplateToJson
(
"13612688539
,13265487972
"
,
params
,
"SMS_169904346"
);
SmsService
.
sendTemplateToJson
(
"13612688539"
,
params
,
"SMS_169904346"
);
/*System.out.println("短信接口返回的数据----------------");
/*System.out.println("短信接口返回的数据----------------");
System.out.println("Code=" + response.getCode());
System.out.println("Code=" + response.getCode());
System.out.println("Message=" + response.getMessage());
System.out.println("Message=" + response.getMessage());
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
View file @
59d0abff
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyStockInfoMapper
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyStockInfoMapper
;
import
com.xxfc.platform.vehicle.mapper.CompanyBaseMapper
;
import
com.xxfc.platform.vehicle.mapper.CompanyBaseMapper
;
...
@@ -145,6 +147,7 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
...
@@ -145,6 +147,7 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
//设置基础信息
//设置基础信息
@CacheClear
(
pre
=
RedisKey
.
BRANCH_COMPANY_CACHE
)
public
ObjectRestResponse
updCompany
(
CompanyVo
companyVo
){
public
ObjectRestResponse
updCompany
(
CompanyVo
companyVo
){
if
(
companyVo
==
null
||
StringUtils
.
isBlank
(
companyVo
.
getCompanyName
())||
StringUtils
.
isBlank
(
companyVo
.
getName
())||
if
(
companyVo
==
null
||
StringUtils
.
isBlank
(
companyVo
.
getCompanyName
())||
StringUtils
.
isBlank
(
companyVo
.
getName
())||
companyVo
.
getZoneId
()==
null
||
companyVo
.
getZoneId
()==
0
||
companyVo
.
getAddrProvince
()==
null
||
companyVo
.
getAddrProvince
()==
0
companyVo
.
getZoneId
()==
null
||
companyVo
.
getZoneId
()==
0
||
companyVo
.
getAddrProvince
()==
null
||
companyVo
.
getAddrProvince
()==
0
...
...
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