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
7a26bea8
Commit
7a26bea8
authored
Sep 10, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
f228f341
7104a592
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
20 deletions
+64
-20
OrderMsgBiz.java
...n/java/com/xxfc/platform/order/biz/inner/OrderMsgBiz.java
+9
-9
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-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderMsgBiz.java
View file @
7a26bea8
...
@@ -29,8 +29,8 @@ import java.util.HashSet;
...
@@ -29,8 +29,8 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
HOUR_MINUTE_FORMATTE_HUTOOL
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
constant
.
enumerate
.
MemberEnum
.
NONE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
*
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
/**
/**
...
@@ -472,7 +472,7 @@ public class OrderMsgBiz {
...
@@ -472,7 +472,7 @@ public class OrderMsgBiz {
private
void
handelSmsParamApp
(
CompanyDetail
startCompanyDetail
,
CompanyDetail
endCompanyDetail
,
OrderRentVehicleDetail
orvd
,
OrderTourDetail
otd
,
OrderMemberDetail
omd
,
BaseOrder
baseOrder
,
List
<
String
>
smsParams
,
AppUserDTO
appUserDTO
,
int
paramHandelType
)
{
private
void
handelSmsParamApp
(
CompanyDetail
startCompanyDetail
,
CompanyDetail
endCompanyDetail
,
OrderRentVehicleDetail
orvd
,
OrderTourDetail
otd
,
OrderMemberDetail
omd
,
BaseOrder
baseOrder
,
List
<
String
>
smsParams
,
AppUserDTO
appUserDTO
,
int
paramHandelType
)
{
switch
(
paramHandelType
)
{
switch
(
paramHandelType
)
{
case
SmsTemplateDTO
.
PAY_A
:
case
SmsTemplateDTO
.
PAY_A
:
if
(
0
<
appUserDTO
.
getMemberLevel
(
)
)
{
if
(
SYS_TRUE
.
equals
(
appUserDTO
.
getIsMember
())
&&
!
NONE
.
getCode
().
equals
(
appUserDTO
.
getMemberLevel
()
)
)
{
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
}
else
{
}
else
{
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
...
@@ -502,14 +502,14 @@ public class OrderMsgBiz {
...
@@ -502,14 +502,14 @@ public class OrderMsgBiz {
smsParams
.
add
(
appUserDTO
.
getRentFreeDays
().
toString
());
smsParams
.
add
(
appUserDTO
.
getRentFreeDays
().
toString
());
break
;
break
;
case
SmsTemplateDTO
.
CANCEL_A
:
case
SmsTemplateDTO
.
CANCEL_A
:
if
(
0
<
appUserDTO
.
getMemberLevel
(
)
)
{
if
(
SYS_TRUE
.
equals
(
appUserDTO
.
getIsMember
())
&&
!
NONE
.
getCode
().
equals
(
appUserDTO
.
getMemberLevel
()
)
)
{
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
}
else
{
}
else
{
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
}
}
break
;
break
;
case
SmsTemplateDTO
.
PAY_I
:
case
SmsTemplateDTO
.
PAY_I
:
if
(
0
<
appUserDTO
.
getMemberLevel
(
)
)
{
if
(
SYS_TRUE
.
equals
(
appUserDTO
.
getIsMember
())
&&
!
NONE
.
getCode
().
equals
(
appUserDTO
.
getMemberLevel
()
)
)
{
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
}
else
{
}
else
{
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
...
@@ -517,7 +517,7 @@ public class OrderMsgBiz {
...
@@ -517,7 +517,7 @@ public class OrderMsgBiz {
smsParams
.
add
(
startCompanyDetail
.
getAddrDetail
());
smsParams
.
add
(
startCompanyDetail
.
getAddrDetail
());
break
;
break
;
case
SmsTemplateDTO
.
PAY_J
:
case
SmsTemplateDTO
.
PAY_J
:
if
(
0
<
appUserDTO
.
getMemberLevel
(
)
)
{
if
(
SYS_TRUE
.
equals
(
appUserDTO
.
getIsMember
())
&&
!
NONE
.
getCode
().
equals
(
appUserDTO
.
getMemberLevel
()
)
)
{
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
}
else
{
}
else
{
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
...
@@ -534,7 +534,7 @@ public class OrderMsgBiz {
...
@@ -534,7 +534,7 @@ public class OrderMsgBiz {
private
void
handelDepositSmsParamApp
(
BigDecimal
originalAmount
,
BigDecimal
violateAmount
,
BigDecimal
refundAmount
,
BigDecimal
residueAmount
,
BaseOrder
baseOrder
,
List
<
String
>
smsParams
,
AppUserDTO
appUserDTO
,
int
paramHandelType
)
{
private
void
handelDepositSmsParamApp
(
BigDecimal
originalAmount
,
BigDecimal
violateAmount
,
BigDecimal
refundAmount
,
BigDecimal
residueAmount
,
BaseOrder
baseOrder
,
List
<
String
>
smsParams
,
AppUserDTO
appUserDTO
,
int
paramHandelType
)
{
switch
(
paramHandelType
)
{
switch
(
paramHandelType
)
{
case
SmsTemplateDTO
.
CANCEL_C
:
case
SmsTemplateDTO
.
CANCEL_C
:
if
(
0
<
appUserDTO
.
getMemberLevel
(
)
)
{
if
(
SYS_TRUE
.
equals
(
appUserDTO
.
getIsMember
())
&&
!
NONE
.
getCode
().
equals
(
appUserDTO
.
getMemberLevel
()
)
)
{
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
}
else
{
}
else
{
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
...
@@ -549,7 +549,7 @@ public class OrderMsgBiz {
...
@@ -549,7 +549,7 @@ public class OrderMsgBiz {
case
SmsTemplateDTO
.
REFUND_A
:
case
SmsTemplateDTO
.
REFUND_A
:
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
Integer
rentDepositAutoRefundTime
=
new
Integer
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_DEPOSIT_AUTO_REFUND_TIME
).
getDetail
());
Integer
rentDepositAutoRefundTime
=
new
Integer
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_DEPOSIT_AUTO_REFUND_TIME
).
getDetail
());
if
(
0
<
appUserDTO
.
getMemberLevel
(
)
)
{
if
(
SYS_TRUE
.
equals
(
appUserDTO
.
getIsMember
())
&&
!
NONE
.
getCode
().
equals
(
appUserDTO
.
getMemberLevel
()
)
)
{
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
}
else
{
}
else
{
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
...
@@ -562,7 +562,7 @@ public class OrderMsgBiz {
...
@@ -562,7 +562,7 @@ public class OrderMsgBiz {
smsParams
.
add
(
DateUtil
.
formatDateTime
(
DateUtil
.
date
(
baseOrder
.
getRefundTime
()
+
Long
.
valueOf
(
rentDepositAutoRefundTime
*
60
*
60
*
1000
))));
smsParams
.
add
(
DateUtil
.
formatDateTime
(
DateUtil
.
date
(
baseOrder
.
getRefundTime
()
+
Long
.
valueOf
(
rentDepositAutoRefundTime
*
60
*
60
*
1000
))));
break
;
break
;
case
SmsTemplateDTO
.
REFUND_B
:
case
SmsTemplateDTO
.
REFUND_B
:
if
(
0
<
appUserDTO
.
getMemberLevel
(
)
)
{
if
(
SYS_TRUE
.
equals
(
appUserDTO
.
getIsMember
())
&&
!
NONE
.
getCode
().
equals
(
appUserDTO
.
getMemberLevel
()
)
)
{
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_M
+
appUserDTO
.
getRealname
());
}
else
{
}
else
{
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
smsParams
.
add
(
USER_N
+
appUserDTO
.
getRealname
());
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/SmsService.java
View file @
7a26bea8
...
@@ -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 @
7a26bea8
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.RandomUtil
;
import
com.github.wxiaoqi.security.common.util.RandomUtil
;
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
;
...
@@ -192,6 +194,7 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
...
@@ -192,6 +194,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