Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
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
base_platform_enterprise
gic-platform-enterprise
Commits
6cbd1e55
Commit
6cbd1e55
authored
Mar 05, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源解除失败发送短信
parent
b2e90766
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
6 deletions
+29
-6
UnionEnterpriseAuthResDetailApiServiceImpl.java
...mpl/union/UnionEnterpriseAuthResDetailApiServiceImpl.java
+29
-6
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/union/UnionEnterpriseAuthResDetailApiServiceImpl.java
View file @
6cbd1e55
...
...
@@ -54,6 +54,7 @@ public class UnionEnterpriseAuthResDetailApiServiceImpl implements UnionEnterpri
private
static
String
SMS_CODE_TO_OWN
=
"GICSHHT002"
;
private
static
String
SMS_CODE_TO_UNION
=
"GICSHHT012"
;
private
static
String
SMS_CODE_TO_RELIEVE
=
"GICSHHT013"
;
@Override
public
ServiceResponse
<
Void
>
authDataCallback
()
{
...
...
@@ -111,6 +112,24 @@ public class UnionEnterpriseAuthResDetailApiServiceImpl implements UnionEnterpri
}
else
{
dto
.
setStatusFlag
(
UnionEnterpriseAuthStatusEnum
.
RELIEVING
.
getCode
());
}
//如果是解除失败,则要发送短信
if
(
UnionEnterpriseAuthDetailStatusEnum
.
RELIEVE_FAIL
.
getCode
().
equals
(
authStatus
))
{
Map
<
String
,
String
>
enterpriseMap
=
getEnterpriseNameMap
(
ownEnterpriseId
,
unionEnterpriseId
);
//发送短信
String
[]
smsArrOfOwn
=
new
String
[]
{
enterpriseMap
.
get
(
unionEnterpriseId
),
UnionEnterpriseAuthResTypeEnum
.
getMessage
(
resourceType
)};
ServiceResponse
<
UserDTO
>
userResponse
=
userApiService
.
getUserByEnterpriseId
(
ownEnterpriseId
);
//发送手机验证码
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
SMS_CODE_TO_RELIEVE
,
ownEnterpriseId
,
userResponse
.
getResult
().
getPhoneAreaCode
(),
userResponse
.
getResult
().
getPhoneNumber
(),
smsArrOfOwn
);
if
(!
smsSendResult
.
isSuccess
())
{
LOGGER
.
warn
(
"资源解除失败发送短信错误信息:{}"
,
JSON
.
toJSONString
(
smsSendResult
));
}
}
unionEnterpriseAuthService
.
update
(
dto
);
unionEnterpriseAuthResDetailService
.
union
(
detail
.
getUnionEnterpriseAuthResDetailId
(),
authStatus
,
null
,
null
);
}
...
...
@@ -140,12 +159,7 @@ public class UnionEnterpriseAuthResDetailApiServiceImpl implements UnionEnterpri
dto
.
setLastUnionTime
(
new
Date
());
unionEnterpriseAuthService
.
update
(
dto
);
List
<
Integer
>
enterpriseIdList
=
new
ArrayList
<>(
2
);
enterpriseIdList
.
add
(
ownEnterpriseId
);
enterpriseIdList
.
add
(
unionEnterpriseId
);
List
<
TabEnterprise
>
enterpriseList
=
enterpriseService
.
listEnterpriseByIds
(
enterpriseIdList
);
Map
<
String
,
String
>
enterpriseMap
=
enterpriseList
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getEnterpriseId
().
toString
(),
e
->
e
.
getEnterpriseName
()));
Map
<
String
,
String
>
enterpriseMap
=
getEnterpriseNameMap
(
ownEnterpriseId
,
unionEnterpriseId
);
sendSms
(
ownEnterpriseId
,
enterpriseMap
.
get
(
ownEnterpriseId
),
enterpriseMap
.
get
(
unionEnterpriseId
),
true
);
sendSms
(
unionEnterpriseId
,
enterpriseMap
.
get
(
ownEnterpriseId
),
enterpriseMap
.
get
(
unionEnterpriseId
),
false
);
}
...
...
@@ -192,4 +206,13 @@ public class UnionEnterpriseAuthResDetailApiServiceImpl implements UnionEnterpri
return
isAllDealSuccess
;
}
private
Map
<
String
,
String
>
getEnterpriseNameMap
(
Integer
ownEnterpriseId
,
Integer
unionEnterpriseId
)
{
List
<
Integer
>
enterpriseIdList
=
new
ArrayList
<>(
2
);
enterpriseIdList
.
add
(
ownEnterpriseId
);
enterpriseIdList
.
add
(
unionEnterpriseId
);
List
<
TabEnterprise
>
enterpriseList
=
enterpriseService
.
listEnterpriseByIds
(
enterpriseIdList
);
Map
<
String
,
String
>
enterpriseMap
=
enterpriseList
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getEnterpriseId
().
toString
(),
e
->
e
.
getEnterpriseName
()));
return
enterpriseMap
;
}
}
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