Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
9ec134a4
Commit
9ec134a4
authored
Dec 19, 2024
by
honghy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正短信节点不能更新bug
parent
fba11b8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
SmsNodeServiceImpl.java
...r/yudao/module/system/service/sms/SmsNodeServiceImpl.java
+9
-9
No files found.
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsNodeServiceImpl.java
View file @
9ec134a4
...
...
@@ -223,6 +223,8 @@ public class SmsNodeServiceImpl extends AbstractService<SmsNodeMapper, SmsNodeDO
smsNodeDO
.
setIsOrders
(
createReqVO
.
getIsOrders
());
List
<
SmsNodeDO
>
smsNodeDOList
=
smsNodeMapper
.
selectList
(
smsNodeDO
);
String
country
=
createReqVO
.
getCountryId
();
// 获取目的仓
List
<
List
<
Long
>>
receiveAddrs
=
getReceiveAddrList
(
createReqVO
.
getReceiveAddrList
());
if
(
smsNodeDOList
!=
null
&&
!
smsNodeDOList
.
isEmpty
())
{
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
for
(
SmsNodeDO
nodeDO
:
smsNodeDOList
)
{
...
...
@@ -251,10 +253,9 @@ public class SmsNodeServiceImpl extends AbstractService<SmsNodeMapper, SmsNodeDO
}
}
Set
<
String
>
existingCountryIds
=
new
HashSet
<>(
Arrays
.
asList
(
country
.
split
(
","
)));
// 获取目的仓
List
<
List
<
Long
>>
receiveAddrList
=
getReceiveAddrList
(
createReqVO
.
getReceiveAddrList
());
for
(
List
<
Long
>
integers
:
receiveAddrList
)
{
for
(
List
<
Long
>
integers
:
receiveAddrs
)
{
for
(
String
existingCountryId
:
existingCountryIds
)
{
String
key
=
generateKey
(
existingCountryId
,
integers
);
if
(
map
.
containsKey
(
key
))
{
...
...
@@ -263,11 +264,10 @@ public class SmsNodeServiceImpl extends AbstractService<SmsNodeMapper, SmsNodeDO
}
}
}
SmsNodeExtraVO
smsNodeExtraVO
=
new
SmsNodeExtraVO
();
smsNodeExtraVO
.
setReceiveAddrList
(
receiveAddrList
);
smsNode
.
setExtra
(
JSON
.
toJSONString
(
smsNodeExtraVO
));
}
SmsNodeExtraVO
smsNodeExtraVO
=
new
SmsNodeExtraVO
();
smsNodeExtraVO
.
setReceiveAddrList
(
receiveAddrs
);
smsNode
.
setExtra
(
JSON
.
toJSONString
(
smsNodeExtraVO
));
// 插入新的短信节点到数据库
smsNodeMapper
.
insert
(
smsNode
);
// 设置新的缓存
...
...
@@ -378,14 +378,14 @@ public class SmsNodeServiceImpl extends AbstractService<SmsNodeMapper, SmsNodeDO
}
Set
<
String
>
existingCountryIds
=
new
HashSet
<>(
Arrays
.
asList
(
country
.
split
(
","
)));
List
<
List
<
Long
>>
receiveAddrList
=
updateReqVO
.
getReceiveAddrList
(
);
List
<
List
<
Long
>>
receiveAddrList
=
getReceiveAddrList
(
updateReqVO
.
getReceiveAddrList
()
);
for
(
List
<
Long
>
integers
:
receiveAddrList
)
{
for
(
String
existingCountryId
:
existingCountryIds
)
{
String
key
=
generateKey
(
existingCountryId
,
integers
);
if
(
map
.
containsKey
(
key
))
{
SmsNodeDO
nodeDO
=
map
.
get
(
key
);
if
(
nodeDO
.
getId
()
!=
updateObj
.
getId
(
))
{
if
(
!
nodeDO
.
getId
().
equals
(
updateObj
.
getId
()
))
{
// 如果节点已存在,抛出异常
throw
new
ServiceException
(
500
,
"不能重复设置"
);
}
...
...
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